"""simple docstring"""




from __future__ import annotations

from collections.abc import Iterator
class     UpperCamelCase__:





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






class     UpperCamelCase__:





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





						def 				snake_case__	(       self		,__UpperCAmelCase     )					->				int:
													if node is None:
																				return 0
													return node.value + (
													    self.depth_first_search(node.left     ) + self.depth_first_search(node.right     )
													)





						def __iter__(       self     )					->				Iterator[int]:
													yield self.depth_first_search(self.tree     )


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))





