import math
def        a_	( _A					)     ->     Any:







				"""simple docstring"""
				return sum(int(_UpperCamelCase					) for digit in str(_UpperCamelCase					)					)
def        a_	( _A = 30					)     ->     Optional[int]:







				"""simple docstring"""
				snake_case__													=       []
				for digit in range(2 ,				100					):
								for power in range(2 ,				100					):
												snake_case__													=       int(math.pow(_UpperCamelCase ,				_UpperCamelCase					)					)
												if digit == digit_sum(_UpperCamelCase					):
																digit_to_powers.append(_UpperCamelCase					)

				digit_to_powers.sort()
				return digit_to_powers[n - 1]


if __name__ == "__main__":
							print(solution())












def        a_	( _A ,				_A					)     ->     Union[str, Any]:







				"""simple docstring"""
				snake_case__													=       1
				while b > 0:
								if b & 1:
												res *= a

								a *= a
								b >>= 1

				return res
def        a_	( _A ,				_A ,				_A					)     ->     Dict:







				"""simple docstring"""
				snake_case__													=       1
				while b > 0:
								if b & 1:
												snake_case__													=       ((res % c) * (a % c)) % c

								a *= a
								b >>= 1

				return res




