def 			A__      (	snake_case_ :		list      ):

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

 SCREAMING_SNAKE_CASE__:   List[str]=      []

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

 generate(len(snake_case_      )       ,				snake_case_      )
 return res


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


from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase_     :   Dict 				=				{
    'configuration_autoformer': [
        'AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'AutoformerConfig',
    ],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_     :   str 				=				[
          'AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
          'AutoformerForPrediction',
          'AutoformerModel',
          'AutoformerPreTrainedModel',
      ]


if TYPE_CHECKING:
      from .configuration_autoformer import (
          AUTOFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
          AutoformerConfig,
      )

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_autoformer import (
                AUTOFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                AutoformerForPrediction,
                AutoformerModel,
                AutoformerPreTrainedModel,
            )

else:
      import sys

      lowercase_     :   Tuple 				=				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

