
'''simple docstring'''
from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt






def      UpperCamelCase_				(      A__						):
	a_      				=						int(number**0.5						)
	return number == sq * sq






def      UpperCamelCase_				(      A__  ,      A__  ,      A__  ,      A__  ,      A__  ,      A__						):
	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(A__  ,      A__						)
	top //= hcf
	bottom //= hcf
	return top, bottom






def      UpperCamelCase_				(      A__ = 35						):
	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(A__  ,      A__						)
					z_num //= hcf
					z_den //= hcf
					if 0 < z_num < z_den <= order:
						a_      				=						add_three(
						    A__  ,      A__  ,      A__  ,      A__  ,      A__  ,      A__						)
						unique_s.add(A__						)

					# 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(A__						) and is_sq(A__						):
						a_      				=						int(sqrt(A__						)						)
						a_      				=						int(sqrt(A__						)						)
						a_      				=						gcd(A__  ,      A__						)
						z_num //= hcf
						z_den //= hcf
						if 0 < z_num < z_den <= order:
							a_      				=						add_three(
							    A__  ,      A__  ,      A__  ,      A__  ,      A__  ,      A__						)
							unique_s.add(A__						)

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

					# 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(A__						) and is_sq(A__						):
						a_      				=						int(sqrt(A__						)						)
						a_      				=						int(sqrt(A__						)						)
						a_      				=						gcd(A__  ,      A__						)
						z_num //= hcf
						z_den //= hcf
						if 0 < z_num < z_den <= order:
							a_      				=						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'''
import math






def      UpperCamelCase_				(      A__						):
	return math.sqrt(A__						) * math.sqrt(A__						) == num






def      UpperCamelCase_				(      A__						):
	a_      				=						0
	a_      				=						n
	while left <= right:
		a_      				=						(left + right) // 2
		if mid**2 == n:
			return True
		elif mid**2 > n:
			a_      				=						mid - 1
		else:
			a_      				=						mid + 1
	return False


if __name__ == "__main__":
		import doctest

		doctest.testmod()
