

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


lowerCAmelCase__								=		{
    """configuration_canine""": ["""CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """CanineConfig"""],
    """tokenization_canine""": ["""CanineTokenizer"""],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase__								=		[
							    """CANINE_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """CanineForMultipleChoice""",
							    """CanineForQuestionAnswering""",
							    """CanineForSequenceClassification""",
							    """CanineForTokenClassification""",
							    """CanineLayer""",
							    """CanineModel""",
							    """CaninePreTrainedModel""",
							    """load_tf_weights_in_canine""",
							]


if TYPE_CHECKING:
							from .configuration_canine import CANINE_PRETRAINED_CONFIG_ARCHIVE_MAP, CanineConfig
							from .tokenization_canine import CanineTokenizer

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_canine import (
														    CANINE_PRETRAINED_MODEL_ARCHIVE_LIST,
														    CanineForMultipleChoice,
														    CanineForQuestionAnswering,
														    CanineForSequenceClassification,
														    CanineForTokenClassification,
														    CanineLayer,
														    CanineModel,
														    CaninePreTrainedModel,
														    load_tf_weights_in_canine,
														)


else:
							import sys

							lowerCAmelCase__								=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)









def 					lowerCamelCase_     (							UpperCAmelCase_							:     list	)						->				list:




	'''simple docstring'''




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

	_UpperCamelCase   :		List[Any]			=						[]

	def generate(UpperCAmelCase_							:     int							,       UpperCAmelCase_							:     list	):
		_UpperCamelCase   :		Optional[int]			=						[0] * n
		res.append(tuple(UpperCAmelCase_	)	)

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

	generate(len(UpperCAmelCase_	)							,       UpperCAmelCase_	)
	return res


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




