"""simple docstring"""

from __future__ import annotations

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

__lowercase    =				TypeVar('''T''', bound=bool)






class 		_lowercase (						Generic[T]      ):



						"""simple docstring"""




						def __init__(				self							:    Optional[int]     , UpperCamelCase__							:    T				)				->				None:
													'''simple docstring'''



													__UpperCamelCase							=value
													__UpperCamelCase							=None
													__UpperCamelCase							=None





						@property
						def   UpperCAmelCase_ (				self							:    Optional[Any]				)				->				T:
													'''simple docstring'''



													return self._value





						@staticmethod
						def   UpperCAmelCase_ (				UpperCamelCase__							:    SkewNode[T] | None     , UpperCamelCase__							:    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							=roota, roota

													__UpperCamelCase							=roota
													__UpperCamelCase							=roota.right
													__UpperCamelCase							=roota.left
													__UpperCamelCase							=SkewNode.merge(UpperCamelCase__     , UpperCamelCase__				)

													return result






class 		_lowercase (						Generic[T]      ):



						"""simple docstring"""




						def __init__(				self							:    Optional[Any]     , UpperCamelCase__							:    Iterable[T] | None = ()				)				->				None:
													'''simple docstring'''



													__UpperCamelCase							=None
													if data:
																				for item in data:
																											self.insert(UpperCamelCase__				)





						def __bool__(				self							:    Optional[Any]				)				->				bool:
													'''simple docstring'''



													return self._root is not None





						def __iter__(				self							:    Optional[Any]				)				->				Iterator[T]:
													'''simple docstring'''



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

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

													return iter(UpperCamelCase__				)





						def   UpperCAmelCase_ (				self							:    int     , UpperCamelCase__							:    T				)				->				None:
													'''simple docstring'''



													__UpperCamelCase							=SkewNode.merge(self._root     , SkewNode(UpperCamelCase__				)				)





						def   UpperCAmelCase_ (				self							:    Dict				)				->				T | None:
													'''simple docstring'''



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

													return result





						def   UpperCAmelCase_ (				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   UpperCAmelCase_ (				self							:    str				)				->				None:
													'''simple docstring'''



													__UpperCamelCase							=None


if __name__ == "__main__":
				import doctest

				doctest.testmod()




"""simple docstring"""

def    lowerCAmelCase			(__UpperCamelCase							:    int							,					__UpperCamelCase							:    int			):
							"""simple docstring"""


							return (input_a, input_a).count(0			) % 2


def    lowerCAmelCase			():
							"""simple docstring"""


							assert xor_gate(0							,					0			) == 0
							assert xor_gate(0							,					1			) == 1
							assert xor_gate(1							,					0			) == 1
							assert xor_gate(1							,					1			) == 0


if __name__ == "__main__":
				print(xor_gate(0, 0))
				print(xor_gate(0, 1))



