


"""simple docstring"""






import math
from decimal import Decimal, getcontext



def 			A__		(					_UpperCAmelCase    :      int = 4_00_00_00	)							->	int:

	'''simple docstring'''


	try:
		snake_case__  :						Optional[Any]		=      int(_UpperCAmelCase	)
	except (TypeError, ValueError):
		raise TypeError("Parameter n must be int or castable to int."	)
	if n <= 0:
		raise ValueError("Parameter n must be greater than or equal to one."	)
	snake_case__  :						List[str]		=      1_00
	snake_case__  :						Tuple		=      (Decimal(5	) ** Decimal(0.5	) + 1) / Decimal(2	)

	snake_case__  :						str		=      (math.floor(math.log(n * (phi + 2)				,    _UpperCAmelCase	) - 1	) // 3) * 3 + 2
	snake_case__  :						List[str]		=      Decimal(round(phi ** Decimal(index + 1	)	)	) / (phi + 2)
	snake_case__  :						List[Any]		=      num // 2
	return int(_UpperCAmelCase	)


if __name__ == "__main__":
					print(f"{solution() = }")









import math
def 							UpperCAmelCase_   (				__snake_case		)	->     int:







 """simple docstring"""


 return sum(int(__snake_case		) for digit in str(__snake_case		)		)
def 							UpperCAmelCase_   (				__snake_case = 30		)	->     int:







 """simple docstring"""


 _lowercase				 =[]
 for digit in range(2	,		100		):
  for power in range(2	,		100		):
   _lowercase				 =int(math.pow(__snake_case	,		__snake_case		)		)
   if digit == digit_sum(__snake_case		):
    digit_to_powers.append(__snake_case		)

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


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

