



"""simple docstring"""






from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt






def      snake_case__   (		__lowerCamelCase				:    int	):
			"""simple docstring"""
			lowerCamelCase__		:		Tuple			=int(number**0.5	)
			return number == sq * sq






def      snake_case__   (		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int	):
			"""simple docstring"""
			lowerCamelCase__		:		Union[str, Any]			=x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
			lowerCamelCase__		:		Optional[Any]			=x_den * y_den * z_den
			lowerCamelCase__		:		Tuple			=gcd(__lowerCAmelCase							,		__lowerCAmelCase	)
			top //= hcf
			bottom //= hcf
			return top, bottom






def      snake_case__   (		__lowerCamelCase				:    int = 35	):
			"""simple docstring"""
			lowerCamelCase__		:		Optional[Any]			=set()
			lowerCamelCase__		:		Optional[int]			=42
			lowerCamelCase__		:		List[Any]			=Fraction(0	)
			lowerCamelCase__		:		List[str]			=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__		:		Optional[int]			=x_num * y_den + x_den * y_num
															lowerCamelCase__		:		Union[str, Any]			=x_den * y_den
															lowerCamelCase__		:		List[str]			=gcd(__lowerCAmelCase							,		__lowerCAmelCase	)
															z_num //= hcf
															z_den //= hcf
															if 0 < z_num < z_den <= order:
																		lowerCamelCase__		:		str			=add_three(
																		    __lowerCAmelCase							,		__lowerCAmelCase							,		__lowerCAmelCase							,		__lowerCAmelCase							,		__lowerCAmelCase							,		__lowerCAmelCase	)
																		unique_s.add(__lowerCAmelCase	)

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

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

															# n=2
															lowerCamelCase__		:		List[Any]			=x_num * x_num * y_num * y_num
															lowerCamelCase__		:		Any			=(
															    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__		:		Optional[Any]			=int(sqrt(__lowerCAmelCase	)	)
																		lowerCamelCase__		:		List[Any]			=int(sqrt(__lowerCAmelCase	)	)
																		lowerCamelCase__		:		Optional[Any]			=gcd(__lowerCAmelCase							,		__lowerCAmelCase	)
																		z_num //= hcf
																		z_den //= hcf
																		if 0 < z_num < z_den <= order:
																					lowerCamelCase__		:		Union[str, Any]			=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() = }')






from maths.is_square_free import is_square_free
from maths.prime_factors import prime_factors




def  __magic_name__ (   __lowerCAmelCase	:						int							)			->   int:
				__lowerCamelCase    					=	prime_factors(__lowerCAmelCase							)
				if is_square_free(__lowerCAmelCase							):
								return -1 if len(__lowerCAmelCase							) % 2 else 1
				return 0


if __name__ == "__main__":
					import doctest

					doctest.testmod()



