"""simple docstring"""




from copy import deepcopy
class     UpperCamelCase__:





						def __init__(       self		,__UpperCAmelCase = None		,__UpperCAmelCase = None     )					->				None:

													if arr is None and size is not None:
																				A__	     =							size
																				A__	     =							[0] * size
													elif arr is not None:
																				self.init(__UpperCAmelCase     )
													else:
																				raise ValueError('Either arr or size must be specified'     )





						def 				snake_case__	(       self		,__UpperCAmelCase     )					->				None:
													A__	     =							len(__UpperCAmelCase     )
													A__	     =							deepcopy(__UpperCAmelCase     )
													for i in range(1		,self.size     ):
																				A__	     =							self.next_(__UpperCAmelCase     )
																				if j < self.size:
																											self.tree[j] += self.tree[i]





						def 				snake_case__	(       self     )					->				list[int]:
													A__	     =							self.tree[:]
													for i in range(self.size - 1		,0		,-1     ):
																				A__	     =							self.next_(__UpperCAmelCase     )
																				if j < self.size:
																											arr[j] -= arr[i]
													return arr





						@staticmethod
						def 				snake_case__	(       __UpperCAmelCase     )					->				int:
													return index + (index & (-index))





						@staticmethod
						def 				snake_case__	(       __UpperCAmelCase     )					->				int:
													return index - (index & (-index))





						def 				snake_case__	(       self		,__UpperCAmelCase		,__UpperCAmelCase     )					->				None:
													if index == 0:
																				self.tree[0] += value
																				return
													while index < self.size:
																				self.tree[index] += value
																				A__	     =							self.next_(__UpperCAmelCase     )





						def 				snake_case__	(       self		,__UpperCAmelCase		,__UpperCAmelCase     )					->				None:
													self.add(__UpperCAmelCase		,value - self.get(__UpperCAmelCase     )     )





						def 				snake_case__	(       self		,__UpperCAmelCase     )					->				int:
													if right == 0:
																				return 0
													A__	     =							self.tree[0]
													right -= 1  # make right inclusive
													while right > 0:
																				result += self.tree[right]
																				A__	     =							self.prev(__UpperCAmelCase     )
													return result





						def 				snake_case__	(       self		,__UpperCAmelCase		,__UpperCAmelCase     )					->				int:
													return self.prefix(__UpperCAmelCase     ) - self.prefix(__UpperCAmelCase     )





						def 				snake_case__	(       self		,__UpperCAmelCase     )					->				int:
													return self.query(__UpperCAmelCase		,index + 1     )





						def 				snake_case__	(       self		,__UpperCAmelCase     )					->				int:
													value -= self.tree[0]
													if value < 0:
																				return -1

													A__	     =							1  # Largest power of 2 <= size
													while j * 2 < self.size:
																				j *= 2

													A__	     =							0

													while j > 0:
																				if i + j < self.size and self.tree[i + j] <= value:
																											value -= self.tree[i + j]
																											i += j
																				j //= 2
													return i


if __name__ == "__main__":
				import doctest

				doctest.testmod()






"""simple docstring"""




def   UpperCAmelCase					(	UpperCamelCase__				):






							"""simple docstring"""





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

							A__	     =							[]

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

														generate(k - 1       ,    UpperCamelCase__				)

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

							generate(len(UpperCamelCase__				)       ,    UpperCamelCase__				)
							return res


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





