






def 				__lowerCamelCase     (							__lowerCAmelCase							:					list							)     ->  list:

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

   __UpperCamelCase	:			Dict					=					[]

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

      generate(k - 1					,							__lowerCAmelCase							)

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

   generate(len(__lowerCAmelCase							)					,							__lowerCAmelCase							)
   return res


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











from collections.abc import Iterable
from typing import Generic, TypeVar

UpperCamelCase    							=      TypeVar('_T')







class 		_A						( Generic[_T] ):

  def __init__(    self						:	int   ,				lowerCamelCase__						:	Iterable[_T] | None = None			):
     """simple docstring"""

     __UpperCamelCase	:			list[_T]					=					list(iterable or []			)
     __UpperCamelCase	:			list[_T]					=					[]

  def __len__(    self						:	str			):
     """simple docstring"""

     return len(self._stacka			) + len(self._stacka			)

  def __repr__(    self						:	Dict			):
     """simple docstring"""

     return f'Queue({tuple(self._stacka[::-1] + self._stacka			)})'

  def    a					(    self						:	Union[str, Any]   ,				lowerCamelCase__						:	_T			):
     """simple docstring"""

     self._stacka.append(lowerCamelCase__			)

  def    a					(    self						:	Union[str, Any]			):
     """simple docstring"""

     __UpperCamelCase	:			Any					=					self._stacka.pop
     __UpperCamelCase	:			int					=					self._stacka.append

     if not self._stacka:
        while self._stacka:
           stacka_append(stacka_pop()			)

     if not self._stacka:
        raise IndexError("""Queue is empty"""			)
     return self._stacka.pop()


if __name__ == "__main__":
       from doctest import testmod

       testmod()



