
from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt




def 					__magic_name__					(  __lowerCAmelCase      :		int				)     ->  bool:
				__lowerCamelCase          =      int(number**0.5				)
				return number == sq * sq




def 					__magic_name__					(  __lowerCAmelCase      :		int						,    __lowerCAmelCase      :		int						,    __lowerCAmelCase      :		int						,    __lowerCAmelCase      :		int						,    __lowerCAmelCase      :		int						,    __lowerCAmelCase      :		int				)     ->  tuple[int, int]:
				__lowerCamelCase          =      x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
				__lowerCamelCase          =      x_den * y_den * z_den
				__lowerCamelCase          =      gcd(_lowerCamelCase						,    _lowerCamelCase				)
				top //= hcf
				bottom //= hcf
				return top, bottom




def 					__magic_name__					(  __lowerCAmelCase      :		int = 35				)     ->  int:
				__lowerCamelCase          =      set()
				__lowerCamelCase          =      42
				__lowerCamelCase          =      Fraction(0				)
				__lowerCamelCase          =      42

				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          =      x_num * y_den + x_den * y_num
																				__lowerCamelCase          =      x_den * y_den
																				__lowerCamelCase          =      gcd(_lowerCamelCase						,    _lowerCamelCase				)
																				z_num //= hcf
																				z_den //= hcf
																				if 0 < z_num < z_den <= order:
																								__lowerCamelCase          =      add_three(
																								    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase				)
																								unique_s.add(_lowerCamelCase				)

																				# n=2
																				__lowerCamelCase          =      (
																				    x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
																				)
																				__lowerCamelCase          =      x_den * x_den * y_den * y_den
																				if is_sq(_lowerCamelCase				) and is_sq(_lowerCamelCase				):
																								__lowerCamelCase          =      int(sqrt(_lowerCamelCase				)				)
																								__lowerCamelCase          =      int(sqrt(_lowerCamelCase				)				)
																								__lowerCamelCase          =      gcd(_lowerCamelCase						,    _lowerCamelCase				)
																								z_num //= hcf
																								z_den //= hcf
																								if 0 < z_num < z_den <= order:
																												__lowerCamelCase          =      add_three(
																												    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase				)
																												unique_s.add(_lowerCamelCase				)

                    # n=-1
																				__lowerCamelCase          =      x_num * y_num
																				__lowerCamelCase          =      x_den * y_num + x_num * y_den
																				__lowerCamelCase          =      gcd(_lowerCamelCase						,    _lowerCamelCase				)
																				z_num //= hcf
																				z_den //= hcf
																				if 0 < z_num < z_den <= order:
																								__lowerCamelCase          =      add_three(
																								    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase				)
																								unique_s.add(_lowerCamelCase				)

																				# n=2
																				__lowerCamelCase          =      x_num * x_num * y_num * y_num
																				__lowerCamelCase          =      (
																				    x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
																				)
																				if is_sq(_lowerCamelCase				) and is_sq(_lowerCamelCase				):
																								__lowerCamelCase          =      int(sqrt(_lowerCamelCase				)				)
																								__lowerCamelCase          =      int(sqrt(_lowerCamelCase				)				)
																								__lowerCamelCase          =      gcd(_lowerCamelCase						,    _lowerCamelCase				)
																								z_num //= hcf
																								z_den //= hcf
																								if 0 < z_num < z_den <= order:
																												__lowerCamelCase          =      add_three(
																												    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase						,    _lowerCamelCase				)
																												unique_s.add(_lowerCamelCase				)

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

				return total.denominator + total.numerator


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





"""simple docstring"""






from ..utils import DummyObject, requires_backends



class 			lowercase					( metaclass=lowercase__		):
			lowercase        =     ['''flax''', '''transformers''']






			def __init__(self  :	List[Any]      ,*SCREAMING_SNAKE_CASE_  :	Union[str, Any]      ,**SCREAMING_SNAKE_CASE_  :	Union[str, Any]			)       ->	str:





				"""simple docstring"""


				requires_backends(self      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	List[Any]      ,*SCREAMING_SNAKE_CASE_  :	List[Any]      ,**SCREAMING_SNAKE_CASE_  :	int			)       ->	Optional[int]:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	List[Any]      ,*SCREAMING_SNAKE_CASE_  :	str      ,**SCREAMING_SNAKE_CASE_  :	Union[str, Any]			)       ->	Union[str, Any]:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)





class 			lowercase					( metaclass=lowercase__		):
			lowercase        =     ['''flax''', '''transformers''']






			def __init__(self  :	int      ,*SCREAMING_SNAKE_CASE_  :	List[Any]      ,**SCREAMING_SNAKE_CASE_  :	Any			)       ->	Union[str, Any]:





				"""simple docstring"""


				requires_backends(self      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	int      ,*SCREAMING_SNAKE_CASE_  :	str      ,**SCREAMING_SNAKE_CASE_  :	int			)       ->	Optional[Any]:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	List[str]      ,*SCREAMING_SNAKE_CASE_  :	List[str]      ,**SCREAMING_SNAKE_CASE_  :	Optional[Any]			)       ->	Dict:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)





class 			lowercase					( metaclass=lowercase__		):
			lowercase        =     ['''flax''', '''transformers''']






			def __init__(self  :	Tuple      ,*SCREAMING_SNAKE_CASE_  :	Optional[int]      ,**SCREAMING_SNAKE_CASE_  :	Dict			)       ->	List[str]:





				"""simple docstring"""


				requires_backends(self      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	Tuple      ,*SCREAMING_SNAKE_CASE_  :	Dict      ,**SCREAMING_SNAKE_CASE_  :	Optional[Any]			)       ->	List[Any]:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	Tuple      ,*SCREAMING_SNAKE_CASE_  :	Tuple      ,**SCREAMING_SNAKE_CASE_  :	Tuple			)       ->	Union[str, Any]:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)





class 			lowercase					( metaclass=lowercase__		):
			lowercase        =     ['''flax''', '''transformers''']






			def __init__(self  :	Optional[Any]      ,*SCREAMING_SNAKE_CASE_  :	Any      ,**SCREAMING_SNAKE_CASE_  :	str			)       ->	Union[str, Any]:





				"""simple docstring"""


				requires_backends(self      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	List[Any]      ,*SCREAMING_SNAKE_CASE_  :	Optional[Any]      ,**SCREAMING_SNAKE_CASE_  :	Optional[int]			)       ->	Union[str, Any]:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)






			@classmethod
			def 					UpperCAmelCase							(cls  :	List[Any]      ,*SCREAMING_SNAKE_CASE_  :	List[Any]      ,**SCREAMING_SNAKE_CASE_  :	List[Any]			)       ->	Optional[Any]:





				"""simple docstring"""


				requires_backends(cls      ,['''flax''', '''transformers''']			)


