





"""simple docstring"""




from __future__ import annotations

import sys





def        a_				(							_lowercase       ,						_lowercase   ):






						if abs(SCREAMING_SNAKE_CASE_   ) == 1:
												return a, 0
						elif abs(SCREAMING_SNAKE_CASE_   ) == 1:
												return 0, b

						_UpperCamelCase   ,							_UpperCamelCase			:					Optional[Any]     =    a, b
						_UpperCamelCase   ,							_UpperCamelCase			:					Optional[Any]     =    1, 0
						_UpperCamelCase   ,							_UpperCamelCase			:					List[Any]     =    0, 1

						while remainder != 0:
												_UpperCamelCase			:					int     =    old_remainder // remainder
												_UpperCamelCase   ,							_UpperCamelCase			:					List[str]     =    remainder, old_remainder - quotient * remainder
												_UpperCamelCase   ,							_UpperCamelCase			:					Dict     =    coeff_a, old_coeff_a - quotient * coeff_a
												_UpperCamelCase   ,							_UpperCamelCase			:					Optional[int]     =    coeff_b, old_coeff_b - quotient * coeff_b

						# sign correction for negative numbers
						if a < 0:
												_UpperCamelCase			:					Tuple     =    -old_coeff_a
						if b < 0:
												_UpperCamelCase			:					List[str]     =    -old_coeff_b

						return old_coeff_a, old_coeff_b





def        a_				(							):






						if len(sys.argv   ) < 3:
												print('''2 integer arguments required'''   )
												return 1
						_UpperCamelCase			:					int     =    int(sys.argv[1]   )
						_UpperCamelCase			:					List[str]     =    int(sys.argv[2]   )
						print(extended_euclidean_algorithm(SCREAMING_SNAKE_CASE_       ,						SCREAMING_SNAKE_CASE_   )   )
						return 0


if __name__ == "__main__":
						raise SystemExit(main())






class 		__magic_name__ :






     def __init__(							self     )->			int:
         UpperCamelCase_          =		[0]
         UpperCamelCase_          =		0






     def      UpperCAmelCase_							(							self						,		_lowercase     )->			None:
         UpperCamelCase_          =		self.__heap[i]
         while i // 2 > 0:
             if self.__heap[i] > self.__heap[i // 2]:
                 UpperCamelCase_          =		self.__heap[i // 2]
                 UpperCamelCase_          =		temporary
             i //= 2






     def      UpperCAmelCase_							(							self						,		_lowercase     )->			None:
         self.__heap.append(_lowercase     )
         self.__size += 1
         self.__swap_up(self.__size     )






     def      UpperCAmelCase_							(							self						,		_lowercase     )->			None:
         while self.__size >= 2 * i:
             if 2 * i + 1 > self.__size:
                 UpperCamelCase_          =		2 * i
             else:
                 if self.__heap[2 * i] > self.__heap[2 * i + 1]:
                     UpperCamelCase_          =		2 * i
                 else:
                     UpperCamelCase_          =		2 * i + 1
             UpperCamelCase_          =		self.__heap[i]
             if self.__heap[i] < self.__heap[bigger_child]:
                 UpperCamelCase_          =		self.__heap[bigger_child]
                 UpperCamelCase_          =		temporary
             UpperCamelCase_          =		bigger_child






     def      UpperCAmelCase_							(							self     )->			int:
         UpperCamelCase_          =		self.__heap[1]
         UpperCamelCase_          =		self.__heap[self.__size]
         self.__size -= 1
         self.__heap.pop()
         self.__swap_down(1     )
         return max_value






     @property
     def      UpperCAmelCase_							(							self     )->			List[Any]:
         return self.__heap[1:]






     def __len__(							self     )->			List[str]:
         return self.__size


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 # create an instance of BinaryHeap
 SCREAMING_SNAKE_CASE						:Optional[int]      =			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))
