


def 						a__			(				A__				):

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

			SCREAMING_SNAKE_CASE_		:     Tuple					=					[]

			def generate(A__,      A__				):
						SCREAMING_SNAKE_CASE_		:     Any					=					[0] * n
						res.append(tuple(_lowerCAmelCase				)				)

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

			generate(len(_lowerCAmelCase				),      _lowerCAmelCase				)
			return res


if __name__ == "__main__":
				lowerCAmelCase__			:      Any								=input('Enter numbers separated by a comma:\n').strip()
				lowerCAmelCase__			:      Optional[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_tf_available, is_torch_available


SCREAMING_SNAKE_CASE_					     =	{
    '''configuration_rag''': ['''RagConfig'''],
    '''retrieval_rag''': ['''RagRetriever'''],
    '''tokenization_rag''': ['''RagTokenizer'''],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			SCREAMING_SNAKE_CASE_					     =	[
			    '''RagModel''',
			    '''RagPreTrainedModel''',
			    '''RagSequenceForGeneration''',
			    '''RagTokenForGeneration''',
			]

try:
			if not is_tf_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			SCREAMING_SNAKE_CASE_					     =	[
			    '''TFRagModel''',
			    '''TFRagPreTrainedModel''',
			    '''TFRagSequenceForGeneration''',
			    '''TFRagTokenForGeneration''',
			]


if TYPE_CHECKING:
			from .configuration_rag import RagConfig
			from .retrieval_rag import RagRetriever
			from .tokenization_rag import RagTokenizer

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_rag import RagModel, RagPreTrainedModel, RagSequenceForGeneration, RagTokenForGeneration

			try:
						if not is_tf_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tf_rag import (
						    TFRagModel,
						    TFRagPreTrainedModel,
						    TFRagSequenceForGeneration,
						    TFRagTokenForGeneration,
						)

else:
			import sys

			SCREAMING_SNAKE_CASE_					     =	_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
