





from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt

def     a_       (					lowerCAmelCase_ :     int      ):
   __lowerCAmelCase				      =      int(number**0.5      )
   return number == sq * sq

def     a_       (					lowerCAmelCase_ :     int,      lowerCAmelCase_ :     int,      lowerCAmelCase_ :     int,      lowerCAmelCase_ :     int,      lowerCAmelCase_ :     int,      lowerCAmelCase_ :     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     a_       (					lowerCAmelCase_ :     int = 35      ):
   __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'''






import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


__UpperCamelCase					    =	HUGGINGFACE_HUB_CACHE


__UpperCamelCase					    =	"config.json"
__UpperCamelCase					    =	"diffusion_pytorch_model.bin"
__UpperCamelCase					    =	"diffusion_flax_model.msgpack"
__UpperCamelCase					    =	"model.onnx"
__UpperCamelCase					    =	"diffusion_pytorch_model.safetensors"
__UpperCamelCase					    =	"weights.pb"
__UpperCamelCase					    =	"https://huggingface.co"
__UpperCamelCase					    =	default_cache_path
__UpperCamelCase					    =	"diffusers_modules"
__UpperCamelCase					    =	os.getenv("HF_MODULES_CACHE", os.path.join(hf_cache_home, "modules"))
__UpperCamelCase					    =	["fp16", "non-ema"]
__UpperCamelCase					    =	".self_attn"


