


"""simple docstring"""


from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt







def  __snake_case       (   UpperCamelCase__	)      ->		bool:







		"""simple docstring"""





		A					       = int(number**0.5	)
		return number == sq * sq







def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__ ,			UpperCamelCase__ ,			UpperCamelCase__ ,			UpperCamelCase__ ,			UpperCamelCase__	)      ->		tuple[int, int]:







		"""simple docstring"""





		A					       = x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
		A					       = x_den * y_den * z_den
		A					       = gcd(UpperCamelCase__ ,			UpperCamelCase__	)
		top //= hcf
		bottom //= hcf
		return top, bottom







def  __snake_case       (   UpperCamelCase__ = 35	)      ->		int:







		"""simple docstring"""





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

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

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

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

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

		return total.denominator + total.numerator


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









"""simple docstring"""


def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		while b:
				A       , A					       = b, a % b
		return a







def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		return a if b == 0 else euclidean_gcd_recursive(UpperCamelCase__ ,			a % b	)







def  __snake_case       (   )      ->		List[Any]:







		"""simple docstring"""





		print(f'euclidean_gcd(3, 5) = {euclidean_gcd(3 ,			5	)}'	)
		print(f'euclidean_gcd(5, 3) = {euclidean_gcd(5 ,			3	)}'	)
		print(f'euclidean_gcd(1, 3) = {euclidean_gcd(1 ,			3	)}'	)
		print(f'euclidean_gcd(3, 6) = {euclidean_gcd(3 ,			6	)}'	)
		print(f'euclidean_gcd(6, 3) = {euclidean_gcd(6 ,			3	)}'	)

		print(f'euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3 ,			5	)}'	)
		print(f'euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5 ,			3	)}'	)
		print(f'euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1 ,			3	)}'	)
		print(f'euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3 ,			6	)}'	)
		print(f'euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6 ,			3	)}'	)


if __name__ == "__main__":
	main()





