
from __future__ import annotations

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

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



class       a_   ( Generic[T]						):






			def __init__(			self							, __UpperCamelCase     ):
									_lowercase									=				value
									_lowercase									=				None
									_lowercase									=				None






			@property
			def       UpperCamelCase_							(			self     ):
									return self._value






			@staticmethod
			def       UpperCamelCase_							(			__UpperCamelCase							, __UpperCamelCase     ):

									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(lowerCamelCase_							, lowerCamelCase_     )

									return result







class       a_   ( Generic[T]						):






			def __init__(			self							, __UpperCamelCase = ()     ):
									_lowercase									=				None
									if data:
															for item in data:
																					self.insert(lowerCamelCase_     )






			def __bool__(			self     ):
									return self._root is not None






			def __iter__(			self     ):
									_lowercase									=				[]
									while self:
															result.append(self.pop()     )

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

									return iter(lowerCamelCase_     )






			def       UpperCamelCase_							(			self							, __UpperCamelCase     ):
									_lowercase									=				SkewNode.merge(self._root							, SkewNode(lowerCamelCase_     )     )






			def       UpperCamelCase_							(			self     ):
									_lowercase									=				self.top()
									_lowercase									=				(
									    SkewNode.merge(self._root.left							, self._root.right     ) if self._root else None
									)

									return result






			def       UpperCamelCase_							(			self     ):

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






			def       UpperCamelCase_							(			self     ):
									_lowercase									=				None


if __name__ == "__main__":
		import doctest

		doctest.testmod()

def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    int:
						return n * (2 * n - 1)




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						_lowercase									=				(1 + 24 * n) ** 0.5
						return ((1 + root) / 6) % 1 == 0




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int = 1_44					)     ->    int:
						_lowercase									=				start
						_lowercase									=				hexagonal_num(SCREAMING_SNAKE_CASE_					)
						while not is_pentagonal(SCREAMING_SNAKE_CASE_					):
												n += 1
												_lowercase									=				hexagonal_num(SCREAMING_SNAKE_CASE_					)
						return num


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