


'''simple docstring'''




from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt

def 			__UpperCamelCase    (    _A    :				int				)    ->      bool:




	"""simple docstring"""





	lowerCAmelCase					:    int      							= int(number**0.5				)
	return number == sq * sq

def 			__UpperCamelCase    (    _A    :				int					,   _A    :				int					,   _A    :				int					,   _A    :				int					,   _A    :				int					,   _A    :				int				)    ->      tuple[int, int]:




	"""simple docstring"""





	lowerCAmelCase					:    int      							= x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
	lowerCAmelCase					:    int      							= x_den * y_den * z_den
	lowerCAmelCase					:    int      							= gcd(_A					,   _A				)
	top //= hcf
	bottom //= hcf
	return top, bottom

def 			__UpperCamelCase    (    _A    :				int = 35				)    ->      int:




	"""simple docstring"""





	lowerCAmelCase					:    set      							= set()
	lowerCAmelCase					:    int
	lowerCAmelCase					:    Fraction      							= Fraction(0				)
	lowerCAmelCase					:    tuple[int, int]

	for x_num in range(1					,   order + 1				):
		for x_den in range(x_num + 1					,   order + 1				):
			for y_num in range(1					,   order + 1				):
				for y_den in range(y_num + 1					,   order + 1				):
					# n=1
					lowerCAmelCase					:    str      							= x_num * y_den + x_den * y_num
					lowerCAmelCase					:    str      							= x_den * y_den
					lowerCAmelCase					:    List[str]      							= gcd(_A					,   _A				)
					z_num //= hcf
					z_den //= hcf
					if 0 < z_num < z_den <= order:
						lowerCAmelCase					:    Any      							= add_three(
						    _A					,   _A					,   _A					,   _A					,   _A					,   _A				)
						unique_s.add(_A				)

					# n=2
					lowerCAmelCase					:    str      							= (
					    x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
					)
					lowerCAmelCase					:    Any      							= x_den * x_den * y_den * y_den
					if is_sq(_A				) and is_sq(_A				):
						lowerCAmelCase					:    Tuple      							= int(sqrt(_A				)				)
						lowerCAmelCase					:    List[Any]      							= int(sqrt(_A				)				)
						lowerCAmelCase					:    str      							= gcd(_A					,   _A				)
						z_num //= hcf
						z_den //= hcf
						if 0 < z_num < z_den <= order:
							lowerCAmelCase					:    str      							= add_three(
							    _A					,   _A					,   _A					,   _A					,   _A					,   _A				)
							unique_s.add(_A				)

                    # n=-1
					lowerCAmelCase					:    List[Any]      							= x_num * y_num
					lowerCAmelCase					:    Dict      							= x_den * y_num + x_num * y_den
					lowerCAmelCase					:    Any      							= gcd(_A					,   _A				)
					z_num //= hcf
					z_den //= hcf
					if 0 < z_num < z_den <= order:
						lowerCAmelCase					:    int      							= add_three(
						    _A					,   _A					,   _A					,   _A					,   _A					,   _A				)
						unique_s.add(_A				)

					# n=2
					lowerCAmelCase					:    List[Any]      							= x_num * x_num * y_num * y_num
					lowerCAmelCase					:    List[str]      							= (
					    x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
					)
					if is_sq(_A				) and is_sq(_A				):
						lowerCAmelCase					:    List[str]      							= int(sqrt(_A				)				)
						lowerCAmelCase					:    Union[str, Any]      							= int(sqrt(_A				)				)
						lowerCAmelCase					:    str      							= gcd(_A					,   _A				)
						z_num //= hcf
						z_den //= hcf
						if 0 < z_num < z_den <= order:
							lowerCAmelCase					:    str      							= add_three(
							    _A					,   _A					,   _A					,   _A					,   _A					,   _A				)
							unique_s.add(_A				)

	for num, den in unique_s:
		total += Fraction(_A					,   _A				)

	return total.denominator + total.numerator


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




'''simple docstring'''




_lowerCAmelCase  :		List[str]		     =	{str(digit): digit**5 for digit in range(10)}

def 			__UpperCamelCase    (    _A    :				int				)    ->      int:




	"""simple docstring"""





	return sum(DIGITS_FIFTH_POWER[digit] for digit in str(_A				)				)

def 			__UpperCamelCase    (    )    ->      int:




	"""simple docstring"""





	return sum(
	    number
	    for number in range(10_00					,   1_00_00_00				)
	    if number == digits_fifth_powers_sum(_A				)				)


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