




def        __UpperCAmelCase						(							lowerCamelCase_ :     list  )       ->  list:







			"""simple docstring"""





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

			SCREAMING_SNAKE_CASE_   : Optional[int]					  =      []

			def generate(lowerCamelCase_ :     int  ,							lowerCamelCase_ :     list  ):
						SCREAMING_SNAKE_CASE_   : Any					  =      [0] * n
						res.append(tuple(lowerCamelCase_  )  )

						SCREAMING_SNAKE_CASE_   : Dict					  =      0
						while i < n:
									if c[i] < i:
												if i % 2 == 0:
															SCREAMING_SNAKE_CASE_  ,    SCREAMING_SNAKE_CASE_   : List[str]					  =      arr[i], arr[0]
												else:
															SCREAMING_SNAKE_CASE_  ,    SCREAMING_SNAKE_CASE_   : List[Any]					  =      arr[i], arr[c[i]]
												res.append(tuple(lowerCamelCase_  )  )
												c[i] += 1
												SCREAMING_SNAKE_CASE_   : int					  =      0
									else:
												SCREAMING_SNAKE_CASE_   : str					  =      0
												i += 1

			generate(len(lowerCamelCase_  )  ,							lowerCamelCase_  )
			return res


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




'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase__  :						str					=      {
    'configuration_git': ['GIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'GitConfig', 'GitVisionConfig'],
    'processing_git': ['GitProcessor'],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__  :						str					=      [
      'GIT_PRETRAINED_MODEL_ARCHIVE_LIST',
      'GitForCausalLM',
      'GitModel',
      'GitPreTrainedModel',
      'GitVisionModel',
  ]

if TYPE_CHECKING:
  from .configuration_git import GIT_PRETRAINED_CONFIG_ARCHIVE_MAP, GitConfig, GitVisionConfig
  from .processing_git import GitProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_git import (
        GIT_PRETRAINED_MODEL_ARCHIVE_LIST,
        GitForCausalLM,
        GitModel,
        GitPreTrainedModel,
        GitVisionModel,
    )

else:
  import sys

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




