





"""simple docstring"""




from __future__ import annotations

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

UpperCamelCase_     =TypeVar("""T""", bound=bool)




class 				_a		(   Generic[T]       ):






				def __init__(				self	:					Any,				lowerCAmelCase__	:					T							)			->   None:




										'''simple docstring'''



										_UpperCamelCase    :      T						     =					value
										_UpperCamelCase    :      SkewNode[T] | None						     =					None
										_UpperCamelCase    :      SkewNode[T] | None						     =					None






				@property
				def        snake_case			(				self	:					List[Any]							)			->   T:




										'''simple docstring'''



										return self._value






				@staticmethod
				def        snake_case			(				lowerCAmelCase__	:					SkewNode[T] | None,				lowerCAmelCase__	:					SkewNode[T] | None							)			->   SkewNode[T] | None:




										'''simple docstring'''



										if not roota:
																return roota

										if not roota:
																return roota

										if roota.value > roota.value:
																_UpperCamelCase     ,							_UpperCamelCase    :      Tuple						     =					roota, roota

										_UpperCamelCase    :      List[str]						     =					roota
										_UpperCamelCase    :      str						     =					roota.right
										_UpperCamelCase    :      Optional[Any]						     =					roota.left
										_UpperCamelCase    :      int						     =					SkewNode.merge(lowerCAmelCase__,				lowerCAmelCase__							)

										return result




class 				_a		(   Generic[T]       ):






				def __init__(				self	:					Optional[Any],				lowerCAmelCase__	:					Iterable[T] | None = ()							)			->   None:




										'''simple docstring'''



										_UpperCamelCase    :      SkewNode[T] | None						     =					None
										if data:
																for item in data:
																						self.insert(lowerCAmelCase__							)






				def __bool__(				self	:					Union[str, Any]							)			->   bool:




										'''simple docstring'''



										return self._root is not None






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




										'''simple docstring'''



										_UpperCamelCase    :      list[Any]						     =					[]
										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        snake_case			(				self	:					List[str],				lowerCAmelCase__	:					T							)			->   None:




										'''simple docstring'''



										_UpperCamelCase    :      Tuple						     =					SkewNode.merge(self._root,				SkewNode(lowerCAmelCase__							)							)






				def        snake_case			(				self	:					Any							)			->   T | None:




										'''simple docstring'''



										_UpperCamelCase    :      int						     =					self.top()
										_UpperCamelCase    :      Dict						     =					(
										    SkewNode.merge(self._root.left,				self._root.right							) if self._root else None
										)

										return result






				def        snake_case			(				self	:					Tuple							)			->   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	:					Union[str, Any]							)			->   None:




										'''simple docstring'''



										_UpperCamelCase    :      List[str]						     =					None


if __name__ == "__main__":
						import doctest

						doctest.testmod()










"""simple docstring"""




def  a_       (							_lowercase     ):
						return 1 if input_a == 0 else 0





def  a_       (							):
						assert not_gate(0     ) == 1
						assert not_gate(1     ) == 0


if __name__ == "__main__":
						print(not_gate(0))
						print(not_gate(1))



