code: 
  
  
  
  from __future__ import annotations
  
  from collections.abc import Iterable, Iterator
  from typing import Any, Generic, TypeVar
  
  lowerCAmelCase__	:  int 		=TypeVar('''T''', bound=bool)
  
  class      UpperCAmelCase_						(     Generic[T] ):
  
  						'''simple docstring'''
  
  
  
  
  						def __init__(					self   ,							_A	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													__SCREAMING_SNAKE_CASE								=      value
  													__SCREAMING_SNAKE_CASE								=      None
  													__SCREAMING_SNAKE_CASE								=      None
  
  
  
  
  
  
  						@property
  						def  _A			(					self	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													return self._value
  
  
  
  
  
  
  						@staticmethod
  						def  _A			(					_A   ,							_A	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													if not roota:
  																				return roota
  
  													if not roota:
  																				return roota
  
  													if roota.value > roota.value:
  																				__SCREAMING_SNAKE_CASE							, __SCREAMING_SNAKE_CASE								=      roota, roota
  
  													__SCREAMING_SNAKE_CASE								=      roota
  													__SCREAMING_SNAKE_CASE								=      roota.right
  													__SCREAMING_SNAKE_CASE								=      roota.left
  													__SCREAMING_SNAKE_CASE								=      SkewNode.merge(_A   ,							_A	)
  
  													return result
  
  
  
  
  
  
  
  class      UpperCAmelCase_						(     Generic[T] ):
  
  						'''simple docstring'''
  
  
  
  
  						def __init__(					self   ,							_A = ()	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													__SCREAMING_SNAKE_CASE								=      None
  													if data:
  																				for item in data:
  																											self.insert(_A	)
  
  
  
  
  
  
  						def __bool__(					self	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													return self._root is not None
  
  
  
  
  
  
  						def __iter__(					self	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													__SCREAMING_SNAKE_CASE								=      []
  													while self:
  																				result.append(self.pop()	)
  
  													# Pushing items back to the heap not to clear it.
  													for item in result:
  																				self.insert(_A	)
  
  													return iter(_A	)
  
  
  
  
  
  
  						def  _A			(					self   ,							_A	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													__SCREAMING_SNAKE_CASE								=      SkewNode.merge(self._root   ,							SkewNode(_A	)	)
  
  
  
  
  
  
  						def  _A			(					self	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													__SCREAMING_SNAKE_CASE								=      self.top()
  													__SCREAMING_SNAKE_CASE								=      (
  													    SkewNode.merge(self._root.left   ,							self._root.right	) if self._root else None
  													)
  
  													return result
  
  
  
  
  
  
  						def  _A			(					self	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													if not self._root:
  																				raise IndexError('Can\'t get top element for the empty heap.'	)
  													return self._root.value
  
  
  
  
  
  
  						def  _A			(					self	):
  
  
  
  
  
  
  
  													'''simple docstring'''
  
  													__SCREAMING_SNAKE_CASE								=      None
  
  
  if __name__ == "__main__":
  			import doctest
  
  			doctest.testmod()
  
  
  
  
  
  
  
style_context: 
  
  
  
  def 			__lowercase     (				a__							,     a__     )       ->				List[str]:
  							if n == 0:
  														return 1
  
  							elif n % 2 == 1:
  														return binary_exponentiation(a__							,     n - 1     ) * a
  
  							else:
  														__SCREAMING_SNAKE_CASE								=      binary_exponentiation(a__							,     n / 2     )
  														return b * b
  
  
  if __name__ == "__main__":
  			try:
  						lowerCAmelCase__	:  str 		=int(input('''Enter Base : ''').strip())
  						lowerCAmelCase__	:  Optional[int] 		=int(input('''Enter Power : ''').strip())
  			except ValueError:
  						print('''Invalid literal for integer''')
  
  			lowerCAmelCase__	:  Any 		=binary_exponentiation(BASE, POWER)
  			print(F'''{BASE}^({POWER}) : {RESULT}''')
  
  
  
  
  
  
  