

import math

def      a__	(						UpperCAmelCase				:     Any     )    ->		Any:
  return sum(int(lowerCamelCase_     ) for digit in str(lowerCamelCase_     )     )

def      a__	(						UpperCAmelCase				:     str = 30     )    ->		Tuple:
  UpperCAmelCase			:				List[Any]										=					[]
  for digit in range(2							,					100     ):
    for power in range(2							,					100     ):
      UpperCAmelCase			:				Optional[int]										=					int(math.pow(lowerCamelCase_							,					lowerCamelCase_     )     )
      if digit == digit_sum(lowerCamelCase_     ):
        digit_to_powers.append(lowerCamelCase_     )

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


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













"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tokenizers_available


__a							:						Tuple   							=			{}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__a							:						str   							=			['CpmTokenizer']

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__a							:						List[str]   							=			['CpmTokenizerFast']


if TYPE_CHECKING:
	try:
		if not is_sentencepiece_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_cpm import CpmTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_cpm_fast import CpmTokenizerFast

else:
	import sys

	__a							:						Tuple   							=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


