




'''simple docstring'''
from __future__ import annotations

from collections.abc import Iterable, Iterator
from typing import Any, Generic, TypeVar

A				: int					      =			TypeVar("""T""", bound=bool)






class 			SCREAMING_SNAKE_CASE(							Generic[T]	):

       def __init__(       self   ,						lowerCamelCase__	)       ->   None:

           """simple docstring"""



           __lowercase     							=		value
           __lowercase     							=		None
           __lowercase     							=		None

       @property
       def        snake_case__     (       self	)       ->   T:

           """simple docstring"""



           return self._value




       @staticmethod
       def        snake_case__     (       lowerCamelCase__   ,						lowerCamelCase__	)       ->   SkewNode[T] | None:

           """simple docstring"""



           if not roota:
               return roota

           if not roota:
               return roota

           if roota.value > roota.value:
               __lowercase							,__lowercase     							=		roota, roota

           __lowercase     							=		roota
           __lowercase     							=		roota.right
           __lowercase     							=		roota.left
           __lowercase     							=		SkewNode.merge(snake_case_   ,						snake_case_	)

           return result






class 			SCREAMING_SNAKE_CASE(							Generic[T]	):

       def __init__(       self   ,						lowerCamelCase__ = ()	)       ->   None:

           """simple docstring"""



           __lowercase     							=		None
           if data:
               for item in data:
                   self.insert(snake_case_	)

       def __bool__(       self	)       ->   bool:

           """simple docstring"""



           return self._root is not None

       def __iter__(       self	)       ->   Iterator[T]:

           """simple docstring"""



           __lowercase     							=		[]
           while self:
               result.append(self.pop()	)

           # Pushing items back to the heap not to clear it.
           for item in result:
               self.insert(snake_case_	)

           return iter(snake_case_	)

       def        snake_case__     (       self   ,						lowerCamelCase__	)       ->   None:

           """simple docstring"""



           __lowercase     							=		SkewNode.merge(self._root   ,						SkewNode(snake_case_	)	)

       def        snake_case__     (       self	)       ->   T | None:

           """simple docstring"""



           __lowercase     							=		self.top()
           __lowercase     							=		(
               SkewNode.merge(self._root.left   ,						self._root.right	) if self._root else None
           )

           return result

       def        snake_case__     (       self	)       ->   T:

           """simple docstring"""



           if not self._root:
               raise IndexError("""Can't get top element for the empty heap."""	)
           return self._root.value




       def        snake_case__     (       self	)       ->   None:

           """simple docstring"""



           __lowercase     							=		None


if __name__ == "__main__":
  import doctest

  doctest.testmod()










"""simple docstring"""



def     _SCREAMING_SNAKE_CASE  (				lowercase_ = 10_00		)		->						int:
 A__			=							0
 A__			=							0
 while 1:
  num += 3
  if num >= n:
   break
  total += num
  num += 2
  if num >= n:
   break
  total += num
  num += 1
  if num >= n:
   break
  total += num
  num += 3
  if num >= n:
   break
  total += num
  num += 1
  if num >= n:
   break
  total += num
  num += 2
  if num >= n:
   break
  total += num
  num += 3
  if num >= n:
   break
  total += num
 return total


if __name__ == "__main__":
      print(f'{solution() = }')





