


from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt
def      UpperCAmelCase__		(UpperCamelCase_							):



     """simple docstring"""






     snake_case											=							int(number**0.5							)
     return number == sq * sq
def      UpperCAmelCase__		(UpperCamelCase_				,UpperCamelCase_				,UpperCamelCase_				,UpperCamelCase_				,UpperCamelCase_				,UpperCamelCase_							):



     """simple docstring"""






     snake_case											=							x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
     snake_case											=							x_den * y_den * z_den
     snake_case											=							gcd(UpperCamelCase_				,UpperCamelCase_							)
     top //= hcf
     bottom //= hcf
     return top, bottom
def      UpperCAmelCase__		(UpperCamelCase_ = 35							):



     """simple docstring"""






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

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

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

                         # n=2
                         snake_case											=							x_num * x_num * y_num * y_num
                         snake_case											=							(
                             x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
                         )
                         if is_sq(UpperCamelCase_							) and is_sq(UpperCamelCase_							):
                              snake_case											=							int(sqrt(UpperCamelCase_							)							)
                              snake_case											=							int(sqrt(UpperCamelCase_							)							)
                              snake_case											=							gcd(UpperCamelCase_				,UpperCamelCase_							)
                              z_num //= hcf
                              z_den //= hcf
                              if 0 < z_num < z_den <= order:
                                   snake_case											=							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() = }''')








from functools import lru_cache
def      UpperCAmelCase__		(UpperCamelCase_							):



     """simple docstring"""






     snake_case											=							2
     snake_case											=							set()
     while i * i <= n:
          if n % i:
               i += 1
          else:
               n //= i
               factors.add(UpperCamelCase_							)
     if n > 1:
          factors.add(UpperCamelCase_							)
     return factors
@lru_cache
def      UpperCAmelCase__		(UpperCamelCase_							):



     """simple docstring"""






     return len(unique_prime_factors(UpperCamelCase_							)							)
def      UpperCAmelCase__		(UpperCamelCase_							):



     """simple docstring"""






     return len(set(UpperCamelCase_							)							) in (0, 1)
def      UpperCAmelCase__		(UpperCamelCase_							):



     """simple docstring"""






     snake_case											=							2

     while True:
          # Increment each value of a generated range
          snake_case											=							[base + i for i in range(UpperCamelCase_							)]

          # Run elements through out unique_prime_factors function
          # Append our target number to the end.
          snake_case											=							[upf_len(UpperCamelCase_							) for x in group]
          checker.append(UpperCamelCase_							)

          # If all numbers in the list are equal, return the group variable.
          if equality(UpperCamelCase_							):
               return group

          # Increment our base variable by 1
          base += 1
def      UpperCAmelCase__		(UpperCamelCase_ = 4							):



     """simple docstring"""






     snake_case											=							run(UpperCamelCase_							)
     return results[0] if len(UpperCamelCase_							) else None


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




