






def 							A     (       a_					)     ->						list:

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

					__UpperCamelCase      :					Dict       		=[]

					def generate(a_							,a_					):
										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
																				__UpperCamelCase		,				__UpperCamelCase      :					Union[str, Any]       		=arr[k - 1], arr[i]
															else:  # k is odd
																				__UpperCamelCase		,				__UpperCamelCase      :					int       		=arr[k - 1], arr[0]
															generate(k - 1							,a_					)

					generate(len(a_					)							,a_					)
					return res


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





import math







class 		_snake_case  :




 def __init__(		self					,  _lowerCamelCase=0    ):  # a graph with Node 0,1,...,N-1
       a						:Optional[int] 							=       n
       a						:Union[str, Any] 							=       [
           [math.inf for j in range(0					,  _lowerCamelCase    )] for i in range(0					,  _lowerCamelCase    )
       ]  # adjacency matrix for weight
       a						:List[Any] 							=       [
           [math.inf for j in range(0					,  _lowerCamelCase    )] for i in range(0					,  _lowerCamelCase    )
       ]  # dp[i][j] stores minimum distance from i to j




 def        SCREAMING_SNAKE_CASE__				(		self					,  _lowerCamelCase					,  _lowerCamelCase					,  _lowerCamelCase    ):
       a						:Tuple 							=       w




 def        SCREAMING_SNAKE_CASE__				(		self    ):
       for k in range(0					,  self.n    ):
             for i in range(0					,  self.n    ):
                   for j in range(0					,  self.n    ):
                         a						:Union[str, Any] 							=       min(self.dp[i][j]					,  self.dp[i][k] + self.dp[k][j]    )




 def        SCREAMING_SNAKE_CASE__				(		self					,  _lowerCamelCase					,  _lowerCamelCase    ):
       return self.dp[u][v]


if __name__ == "__main__":
     snake_case				:    str       				=     Graph(5)
     graph.add_edge(0, 2, 9)
     graph.add_edge(0, 4, 10)
     graph.add_edge(1, 3, 5)
     graph.add_edge(2, 3, 7)
     graph.add_edge(3, 0, 10)
     graph.add_edge(3, 1, 2)
     graph.add_edge(3, 2, 1)
     graph.add_edge(3, 4, 6)
     graph.add_edge(4, 1, 3)
     graph.add_edge(4, 2, 4)
     graph.add_edge(4, 3, 9)
     graph.floyd_warshall()
     graph.show_min(1, 4)
     graph.show_min(0, 3)





