






# using dfs for finding eulerian path traversal







def 			A__							(      _a  :					Optional[Any]		,  _a  :					List[str]		,  _a  :					Optional[int]		,  _a  :					Union[str, Any]=None	):





 '''simple docstring'''







 snake_case__  :    Tuple							       =(path or []) + [u]
 for v in graph[u]:
  if visited_edge[u][v] is False:
   snake_case__       ,   snake_case__  :    Tuple							       =True, True
   snake_case__  :    int							       =dfs(_a		,  _a		,  _a		,  _a	)
 return path







def 			A__							(      _a  :					int		,  _a  :					Optional[int]	):





 '''simple docstring'''







 snake_case__  :    Optional[int]							       =0
 snake_case__  :    Optional[Any]							       =-1
 for i in range(_a	):
  if i not in graph.keys():
   continue
  if len(graph[i]	) % 2 == 1:
   odd_degree_nodes += 1
   snake_case__  :    Union[str, Any]							       =i
 if odd_degree_nodes == 0:
  return 1, odd_node
 if odd_degree_nodes == 2:
  return 2, odd_node
 return 3, odd_node







def 			A__							(      _a  :					List[str]		,  _a  :					Dict	):





 '''simple docstring'''







 snake_case__  :    int							       =[[False for _ in range(max_node + 1	)] for _ in range(max_node + 1	)]
 snake_case__       ,   snake_case__  :    Dict							       =check_circuit_or_path(_a		,  _a	)
 if check == 3:
  print("""graph is not Eulerian"""	)
  print("""no path"""	)
  return
 snake_case__  :    Tuple							       =1
 if check == 2:
  snake_case__  :    Optional[Any]							       =odd_node
  print("""graph has a Euler path"""	)
 if check == 1:
  print("""graph has a Euler cycle"""	)
 snake_case__  :    str							       =dfs(_a		,  _a		,  _a	)
 print(_a	)







def 			A__							(      ):





 '''simple docstring'''







 snake_case__  :    Dict							       ={1: [2, 3, 4], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [4]}
 snake_case__  :    Optional[Any]							       ={1: [2, 3, 4, 5], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [1, 4]}
 snake_case__  :    Union[str, Any]							       ={1: [2, 3, 4], 2: [1, 3, 4], 3: [1, 2], 4: [1, 2, 5], 5: [4]}
 snake_case__  :    List[Any]							       ={1: [2, 3], 2: [1, 3], 3: [1, 2]}
 snake_case__  :    Any							       ={
     1: [],
     2: []
     # all degree is zero
 }
 snake_case__  :    str							       =10
 check_euler(_a		,  _a	)
 check_euler(_a		,  _a	)
 check_euler(_a		,  _a	)
 check_euler(_a		,  _a	)
 check_euler(_a		,  _a	)


if __name__ == "__main__":
       main()













def 			A__							(      _a  :					list	):





 '''simple docstring'''







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

 snake_case__  :    Optional[int]							       =[]

 def generate(_a  :					int		,  _a  :					list	):
  if k == 1:
   res.append(tuple(arr[:]	)	)
   return

  generate(k - 1		,  _a	)

  for i in range(k - 1	):
   if k % 2 == 0:  # k is even
    snake_case__       ,   snake_case__  :    Dict							       =arr[k - 1], arr[i]
   else:  # k is odd
    snake_case__       ,   snake_case__  :    int							       =arr[k - 1], arr[0]
   generate(k - 1		,  _a	)

 generate(len(_a	)		,  _a	)
 return res


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





