

def 							__SCREAMING_SNAKE_CASE     (   a__    :   list       )					->				list:

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

	__A :			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
				__A    ,				__A :			Any		    =			arr[k - 1], arr[i]
			else:  # k is odd
				__A    ,				__A :			Optional[Any]		    =			arr[k - 1], arr[0]
			generate(k - 1			,a__       )

	generate(len(a__       )			,a__       )
	return res


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








UpperCAmelCase_							:					dict[str, float]		 =   {
    "joule": 1.0,
    "kilojoule": 1_000,
    "megajoule": 1_000_000,
    "gigajoule": 1_000_000_000,
    "wattsecond": 1.0,
    "watthour": 3_600,
    "kilowatthour": 3_600_000,
    "newtonmeter": 1.0,
    "calorie_nutr": 4_186.8,
    "kilocalorie_nutr": 4_186_800.00,
    "electronvolt": 1.6_0217_6634e-19,
    "britishthermalunit_it": 1_055.05_585,
    "footpound": 1.35_5818,
}
def 							__SCREAMING_SNAKE_CASE     (   a__    :   str			,a__    :   str			,a__    :   float       )					->				float:
	if to_type not in ENERGY_CONVERSION or from_type not in ENERGY_CONVERSION:
		__A :			Optional[int]		    =			(
		    f"""Incorrect 'from_type' or 'to_type' value: {from_type!r}, {to_type!r}\n"""
		    f"""Valid values are: {", ".join(a__       )}"""
		)
		raise ValueError(a__       )
	return value * ENERGY_CONVERSION[from_type] / ENERGY_CONVERSION[to_type]


if __name__ == "__main__":
			import doctest

			doctest.testmod()





