



def 		_UpperCAmelCase				(      snake_case	,						snake_case			):





					"""simple docstring"""

					_lowerCAmelCase						=    [1]
					for i in range(2	,						snake_case			):
										factorials.append(factorials[-1] * i			)
					assert 0 <= k < factorials[-1] * n, "k out of bounds"

					_lowerCAmelCase						=    []
					_lowerCAmelCase						=    list(range(snake_case			)			)

					# Find permutation
					while factorials:
										_lowerCAmelCase						=    factorials.pop()
										_lowerCAmelCase	,	_lowerCAmelCase						=    divmod(snake_case	,						snake_case			)
										permutation.append(elements[number]			)
										elements.remove(elements[number]			)
					permutation.append(elements[0]			)

					return permutation


if __name__ == "__main__":
	import doctest

	doctest.testmod()









"""simple docstring"""


def 					UpperCAmelCase__       (snake_case__							:					list    ):
  """simple docstring"""

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

  _snake_case							:		List[Any]								=  []

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

    generate(k - 1		,   snake_case__    )

    for i in range(k - 1    ):
      if k % 2 == 0:  # k is even
        _snake_case		,					_snake_case							:		Optional[Any]								=  arr[k - 1], arr[i]
      else:  # k is odd
        _snake_case		,					_snake_case							:		List[str]								=  arr[k - 1], arr[0]
      generate(k - 1		,   snake_case__    )

  generate(len(snake_case__    )		,   snake_case__    )
  return res


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


