
'''simple docstring'''






class 							_snake_case     :
	"""simple docstring"""





	def __init__(						self				: Optional[Any]      ):
			lowerCAmelCase_   :       int    							=[0]
			lowerCAmelCase_   :       Tuple    							=0




	def 	__A      (						self				: Optional[Any]					,						UpperCamelCase_				: int      ):
			lowerCAmelCase_   :       int    							=self.__heap[i]
			while i // 2 > 0:
					if self.__heap[i] > self.__heap[i // 2]:
							lowerCAmelCase_   :       str    							=self.__heap[i // 2]
							lowerCAmelCase_   :       Dict    							=temporary
					i //= 2




	def 	__A      (						self				: Optional[Any]					,						UpperCamelCase_				: int      ):
			self.__heap.append(_SCREAMING_SNAKE_CASE      )
			self.__size += 1
			self.__swap_up(self.__size      )




	def 	__A      (						self				: Dict					,						UpperCamelCase_				: int      ):
			while self.__size >= 2 * i:
					if 2 * i + 1 > self.__size:
							lowerCAmelCase_   :       Optional[int]    							=2 * i
					else:
							if self.__heap[2 * i] > self.__heap[2 * i + 1]:
									lowerCAmelCase_   :       List[Any]    							=2 * i
							else:
									lowerCAmelCase_   :       Optional[int]    							=2 * i + 1
					lowerCAmelCase_   :       List[str]    							=self.__heap[i]
					if self.__heap[i] < self.__heap[bigger_child]:
							lowerCAmelCase_   :       List[str]    							=self.__heap[bigger_child]
							lowerCAmelCase_   :       str    							=temporary
					lowerCAmelCase_   :       int    							=bigger_child




	def 	__A      (						self				: Tuple      ):
			lowerCAmelCase_   :       Any    							=self.__heap[1]
			lowerCAmelCase_   :       Tuple    							=self.__heap[self.__size]
			self.__size -= 1
			self.__heap.pop()
			self.__swap_down(1      )
			return max_value




	@property
	def 	__A      (						self				: Tuple      ):
			return self.__heap[1:]





	def __len__(						self				: Optional[Any]      ):
			return self.__size


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							# create an instance of BinaryHeap
							__lowercase	=    BinaryHeap()
							binary_heap.insert(6)
							binary_heap.insert(10)
							binary_heap.insert(15)
							binary_heap.insert(12)
							# pop root(max-values because it is max heap)
							print(binary_heap.pop())  # 15
							print(binary_heap.pop())  # 12
							# get the list and size after operations
							print(binary_heap.get_list)
							print(len(binary_heap))














def   snake_case		(				UpperCAmelCase						:							set,    UpperCAmelCase						:							set ):
				assert isinstance(UpperCAmelCase,    UpperCAmelCase ), f'The input value of [set_a={set_a}] is not a set'
				assert isinstance(UpperCAmelCase,    UpperCAmelCase ), f'The input value of [set_b={set_b}] is not a set'

				return {a + b for a in set_a for b in set_b}


if __name__ == "__main__":
					from doctest import testmod

					testmod()





