




# Lint as: python3

import hashlib
from typing import Union
def        lowerCamelCase_     (     SCREAMING_SNAKE_CASE ):
			'''simple docstring'''
			if isinstance(SCREAMING_SNAKE_CASE       ,						SCREAMING_SNAKE_CASE ):
						# Data already in bytes, returns as it as
						return hash_data
			elif isinstance(SCREAMING_SNAKE_CASE       ,						SCREAMING_SNAKE_CASE ):
						# We keep the data as it as for it ot be later encoded to UTF-8
						# However replace `\\` with `/` for Windows compatibility
						SCREAMING_SNAKE_CASE     =       hash_data.replace("""\\"""       ,						"""/""" )
			elif isinstance(SCREAMING_SNAKE_CASE       ,						SCREAMING_SNAKE_CASE ):
						SCREAMING_SNAKE_CASE     =       str(SCREAMING_SNAKE_CASE )
			else:
						# If data is not of the required type, raise error
						raise InvalidKeyError(SCREAMING_SNAKE_CASE )

			return hash_data.encode("""utf-8""" )




class       UpperCAmelCase_   ( A							):




							'''simple docstring'''



							def __init__(       self							:						List[Any]							,  a							:						Any      )      ->       Optional[Any]:
										SCREAMING_SNAKE_CASE     =       """\nFAILURE TO GENERATE DATASET: Invalid key type detected"""
										SCREAMING_SNAKE_CASE     =       f"""\nFound Key {hash_data} of type {type(a      )}"""
										SCREAMING_SNAKE_CASE     =       """\nKeys should be either str, int or bytes type"""
										super().__init__(f"""{self.prefix}{self.err_msg}{self.suffix}"""      )





class       UpperCAmelCase_   ( A							):




							'''simple docstring'''



							def __init__(       self							:						str							,  a							:						Dict							,  a							:						Any							,  a							:						int=""      )      ->       Any:
										SCREAMING_SNAKE_CASE     =       key
										SCREAMING_SNAKE_CASE     =       duplicate_key_indices
										SCREAMING_SNAKE_CASE     =       fix_msg
										SCREAMING_SNAKE_CASE     =       """Found multiple examples generated with the same key"""
										if len(a      ) <= 20:
													SCREAMING_SNAKE_CASE     =       f"""\nThe examples at index {", ".join(a      )} have the key {key}"""
										else:
													SCREAMING_SNAKE_CASE     =       f"""\nThe examples at index {", ".join(duplicate_key_indices[:20]      )}... ({len(a      ) - 20} more) have the key {key}"""
										SCREAMING_SNAKE_CASE     =       """\n""" + fix_msg if fix_msg else """"""
										super().__init__(f"""{self.prefix}{self.err_msg}{self.suffix}"""      )





class       UpperCAmelCase_   :




							'''simple docstring'''



							def __init__(       self							:						Tuple							,  a							:						str      )      ->       List[Any]:
										SCREAMING_SNAKE_CASE     =       hashlib.mda(_as_bytes(a      )      )







							def  _UpperCAmelCase  (       self							:						Dict							,  a							:						Union[str, int, bytes]      )      ->       int:
										SCREAMING_SNAKE_CASE     =       self._split_mda.copy()
										SCREAMING_SNAKE_CASE     =       _as_bytes(a      )
										mda.update(a      )
										# Convert to integer with hexadecimal conversion
										return int(mda.hexdigest()							,  16      )












def        lowerCamelCase_     (     SCREAMING_SNAKE_CASE       ,						SCREAMING_SNAKE_CASE ):
			'''simple docstring'''
			if n == 0:
						return 1

			elif n % 2 == 1:
						return binary_exponentiation(SCREAMING_SNAKE_CASE       ,						n - 1 ) * a

			else:
						SCREAMING_SNAKE_CASE     =       binary_exponentiation(SCREAMING_SNAKE_CASE       ,						n / 2 )
						return b * b


if __name__ == "__main__":
		try:
				__A    :				Tuple    						=	int(input("""Enter Base : """).strip())
				__A    :				Any    						=	int(input("""Enter Power : """).strip())
		except ValueError:
				print("""Invalid literal for integer""")

		__A    :				Union[str, Any]    						=	binary_exponentiation(BASE, POWER)
		print(f'''{BASE}^({POWER}) : {RESULT}''')






