
"""simple docstring"""





from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt



def  lowerCamelCase__						(     __snake_case      )				->						bool:


					"""simple docstring"""





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



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


					"""simple docstring"""





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



def  lowerCamelCase__						(     __snake_case = 35      )				->						int:


					"""simple docstring"""





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

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

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

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

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

					return total.denominator + total.numerator


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












"""simple docstring"""




def        a__					(							snake_case__							)		->   list:

			if len(snake_case__							) <= 1:
						return [tuple(snake_case__							)]

			lowerCamelCase      =   []

			def generate(snake_case__			,					snake_case__							):
						lowerCamelCase      =   [0] * n
						res.append(tuple(snake_case__							)							)

						lowerCamelCase      =   0
						while i < n:
									if c[i] < i:
												if i % 2 == 0:
															lowerCamelCase ,  lowerCamelCase      =   arr[i], arr[0]
												else:
															lowerCamelCase ,  lowerCamelCase      =   arr[i], arr[c[i]]
												res.append(tuple(snake_case__							)							)
												c[i] += 1
												lowerCamelCase      =   0
									else:
												lowerCamelCase      =   0
												i += 1

			generate(len(snake_case__							)			,					snake_case__							)
			return res


if __name__ == "__main__":
					lowerCAmelCase				:     str					=				input("""Enter numbers separated by a comma:\n""").strip()
					lowerCAmelCase				:     List[Any]					=				[int(item) for item in user_input.split(""",""")]
					print(heaps(arr))



