



import dataclasses
import enum
import functools
import math
import re

# The following script is adapted from the script of TaPas.
# Original: https://github.com/google-research/tapas/master/wikisql_utils.py
from typing import Any, List, Text


lowerCAmelCase__	:  List[str] 		='''none'''
lowerCAmelCase__	:  Optional[Any] 		='''none'''






def 			__lowercase     (				a__							,     a__     )       ->				Any:
							__SCREAMING_SNAKE_CASE								=      value.split(a__     )
							return len(a__     ) > 1 and any((len(a__     ) == 3 for x in split)     )






def 			__lowercase     (				a__     )       ->				Optional[Any]:
							if isinstance(a__							,     a__     ):
														return value
							if isinstance(a__							,     a__     ):
														return float(a__     )
							if not isinstance(a__							,     a__     ):
														raise ValueError('Argument value is not a string. Can\'t parse it as float'     )
							__SCREAMING_SNAKE_CASE								=      value

							try:
														# Example: 1,000.7
														if "." in sanitized and "," in sanitized:
																					return float(sanitized.replace(','							,     ''     )     )
														# 1,000
														if "," in sanitized and _split_thousands(','							,     a__     ):
																					return float(sanitized.replace(','							,     ''     )     )
														# 5,5556
														if "," in sanitized and sanitized.count(','     ) == 1 and not _split_thousands(','							,     a__     ):
																					return float(sanitized.replace(','							,     '.'     )     )
														# 0.0.0.1
														if sanitized.count('.'     ) > 1:
																					return float(sanitized.replace('.'							,     ''     )     )
														# 0,0,0,1
														if sanitized.count(','     ) > 1:
																					return float(sanitized.replace(','							,     ''     )     )
														return float(a__     )
							except ValueError:
														# Avoid adding the sanitized value in the error message.
														raise ValueError('Unable to convert value to float'     )






def 			__lowercase     (				a__     )       ->				Optional[int]:
							if answer is None:
														return None
							try:
														__SCREAMING_SNAKE_CASE								=      convert_to_float(a__     )
														if isinstance(a__							,     a__     ) and math.isnan(a__     ):
																					return None
														return value
							except ValueError:
														return answer.lower()


lowerCAmelCase__	:  Union[str, Any] 		={
    '''text''': lambda x: x,
    '''real''': convert_to_float,
}

class      UpperCAmelCase_						(     enum.Enum ):

						'''simple docstring'''




						UpperCamelCase__    :				Tuple       						=						0
						UpperCamelCase__    :				Union[str, Any]       						=						1
						UpperCamelCase__    :				Optional[Any]       						=						2
						UpperCamelCase__    :				str       						=						3
						UpperCamelCase__    :				Optional[int]       						=						4
						UpperCamelCase__    :				Optional[int]       						=						5







class      UpperCAmelCase_						(     enum.Enum ):

						'''simple docstring'''




						UpperCamelCase__    :				Dict       						=						0
						UpperCamelCase__    :				Any       						=						1
						UpperCamelCase__    :				List[Any]       						=						2







@dataclasses.dataclass
class      UpperCAmelCase_						:

						'''simple docstring'''




						UpperCamelCase__    :				Text
						UpperCamelCase__    :				_Operator
						UpperCamelCase__    :				Any







lowerCAmelCase__	:  Optional[int] 		=re.compile(r'''\w+|[^\w\s]+''', re.UNICODE | re.MULTILINE | re.DOTALL)






def 			__lowercase     (				a__     )       ->				Union[str, Any]:
							return list(_TOKENIZER.findall(x.lower()     )     )






def 			__lowercase     (				a__							,     a__							,     a__     )       ->				Tuple:
							if operator == _Operator.EQUALS:
														return src == tgt
							elif operator == _Operator.GREATER:
														return src > tgt
							elif operator == _Operator.LESSER:
														return src < tgt
							raise ValueError(f"""Unknown operator: {operator}"""     )






def 			__lowercase     (				a__							,     a__							,     a__     )       ->				List[Any]:
							__SCREAMING_SNAKE_CASE								=      table['types']
							return _TYPE_CONVERTER[types[column]](a__     )






def 			__lowercase     (				a__     )       ->				str:
							return isinstance(a__							,     a__     )






def 			__lowercase     (				a__							,     a__							,     a__     )       ->				str:
							for cond in conditions:
														__SCREAMING_SNAKE_CASE								=      row[cond.column]

														__SCREAMING_SNAKE_CASE								=      _parse_value(a__							,     cond.column							,     cond.cmp_value     )

														if _is_string(a__     ) and _is_string(a__     ):
																					__SCREAMING_SNAKE_CASE								=      _normalize_for_match(a__     )
																					__SCREAMING_SNAKE_CASE								=      _normalize_for_match(a__     )

														if not isinstance(a__							,     type(a__     )     ):
																					raise ValueError('Type difference {} != {}'.format(type(a__     )							,     type(a__     )     )     )

														if not _compare(cond.operator							,     a__							,     a__     ):
																					return False
							return True






def 			__lowercase     (				a__							,     a__							,     a__     )       ->				Union[str, Any]:
							if not answer_coordinates:
														if aggregation_op == _Aggregation.COUNT:
																					return 0.0
														else:
																					return EMPTY_ANSWER_AGG

    # Count can support non numeric answers.
							if aggregation_op == _Aggregation.COUNT:
														return float(len(a__     )     )

							# If we have just one answer, if float returns it or try a conversion.
							__SCREAMING_SNAKE_CASE								=      [table['rows'][i][j] for (i, j) in answer_coordinates]
							if len(a__     ) == 1:
														try:
																					return convert_to_float(values[0]     )
														except ValueError as e:
																					if aggregation_op != _Aggregation.NONE:
																												raise e

							if aggregation_op == _Aggregation.NONE:
														return None

							# Other aggregation only support numeric values. Bail out if we have strings.
							if not all((isinstance(a__							,     (int, float)     ) for v in values)     ):
														return None

							if aggregation_op == _Aggregation.SUM:
														return float(sum(a__     )     )
							elif aggregation_op == _Aggregation.AVERAGE:
														return sum(a__     ) / len(a__     )
							else:
														raise ValueError(f"""Unknown aggregation: {aggregation_op}"""     )






def 			__lowercase     (				a__							,     a__     )       ->				Union[str, Any]:
							__SCREAMING_SNAKE_CASE								=      sql_query['agg']
							if aggregation_op_index >= 3:
														__SCREAMING_SNAKE_CASE								=      _Aggregation(a__     )
							else:
														__SCREAMING_SNAKE_CASE								=      _Aggregation.NONE

							__SCREAMING_SNAKE_CASE								=      sql_query['sel']
							__SCREAMING_SNAKE_CASE								=      [
							    _Condition(a__							,     _Operator(a__     )							,     a__     )
							    for column, operator, cmp_value in zip(
							        sql_query['conds']['column_index']							,     sql_query['conds']['operator_index']							,     sql_query['conds']['condition']     )
							]

							__SCREAMING_SNAKE_CASE								=      []
							for row in range(len(table['rows']     )     ):
														if _respect_conditions(a__							,     table['rows'][row]							,     a__     ):
																					indices.append((row, target_column)     )

							if not indices:
														return [], aggregation_op

							if len(a__     ) == 1:
														return indices, aggregation_op

							# Parsing of MIN/MAX.
							if aggregation_op_index in (1, 2):
														__SCREAMING_SNAKE_CASE								=      {2: min, 1: max}
														__SCREAMING_SNAKE_CASE								=      [(table['rows'][i][j], index) for index, (i, j) in enumerate(a__     )]
														__SCREAMING_SNAKE_CASE								=      functools.reduce(operators[sql_query['agg']]							,     a__     )

														__SCREAMING_SNAKE_CASE								=      [indices[reduced[1]]]
														return ret, _Aggregation.NONE

							return indices, aggregation_op






def 			__lowercase     (				a__							,     a__							,     a__     )       ->				List[str]:
							if float_answer is not None:
														return [str(a__     )]
							return [str(table['real_rows'][r][c]     ) for r, c in answer_coordinates]






def 			__lowercase     (				a__							,     a__     )       ->				List:
							__SCREAMING_SNAKE_CASE							, __SCREAMING_SNAKE_CASE								=      _get_answer_coordinates(a__							,     a__     )
							__SCREAMING_SNAKE_CASE								=      _get_float_answer(a__							,     a__							,     a__     )
							__SCREAMING_SNAKE_CASE								=      _get_answer_text(a__							,     a__							,     a__     )
							# keep the original data the same with TaPas
							if len(a__     ) == 0:
														__SCREAMING_SNAKE_CASE								=      [EMPTY_ANSWER]
							return answer_text











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}''')






