"""simple docstring"""


import copy
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING


a				=logging.get_logger(__name__)

a				={
    'microsoft/conditional-detr-resnet-50': (
        'https://huggingface.co/microsoft/conditional-detr-resnet-50/resolve/main/config.json'
    ),
}






class   __UpperCAmelCase		(      __lowerCAmelCase      ):
				A__ :  List[str]    				=			'''conditional_detr'''
				A__ :  str    				=			['''past_key_values''']
				A__ :  str    				=			{
				    '''hidden_size''': '''d_model''',
				    '''num_attention_heads''': '''encoder_attention_heads''',
				}

				def __init__( self      ,					_lowerCamelCase=True      ,					_lowerCamelCase=None      ,					_lowerCamelCase=3      ,					_lowerCamelCase=300      ,					_lowerCamelCase=6      ,					_lowerCamelCase=2048      ,					_lowerCamelCase=8      ,					_lowerCamelCase=6      ,					_lowerCamelCase=2048      ,					_lowerCamelCase=8      ,					_lowerCamelCase=0.0      ,					_lowerCamelCase=0.0      ,					_lowerCamelCase=True      ,					_lowerCamelCase="relu"      ,					_lowerCamelCase=256      ,					_lowerCamelCase=0.1      ,					_lowerCamelCase=0.0      ,					_lowerCamelCase=0.0      ,					_lowerCamelCase=0.0_2      ,					_lowerCamelCase=1.0      ,					_lowerCamelCase=False      ,					_lowerCamelCase="sine"      ,					_lowerCamelCase="resnet50"      ,					_lowerCamelCase=True      ,					_lowerCamelCase=False      ,					_lowerCamelCase=2      ,					_lowerCamelCase=5      ,					_lowerCamelCase=2      ,					_lowerCamelCase=1      ,					_lowerCamelCase=1      ,					_lowerCamelCase=2      ,					_lowerCamelCase=5      ,					_lowerCamelCase=2      ,					_lowerCamelCase=0.2_5      ,					**_lowerCamelCase      ,					):
										if backbone_config is not None and use_timm_backbone:
																raise ValueError("You can't specify both `backbone_config` and `use_timm_backbone`." )

										if not use_timm_backbone:
																if backbone_config is None:
																						logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone." )
																						lowerCamelCase__   =CONFIG_MAPPING["resnet"](out_features=["stage4"] )
																elif isinstance(_lowerCamelCase      ,					_lowerCamelCase ):
																						lowerCamelCase__   =backbone_config.get("model_type" )
																						lowerCamelCase__   =CONFIG_MAPPING[backbone_model_type]
																						lowerCamelCase__   =config_class.from_dict(_lowerCamelCase )

										lowerCamelCase__   =use_timm_backbone
										lowerCamelCase__   =backbone_config
										lowerCamelCase__   =num_channels
										lowerCamelCase__   =num_queries
										lowerCamelCase__   =d_model
										lowerCamelCase__   =encoder_ffn_dim
										lowerCamelCase__   =encoder_layers
										lowerCamelCase__   =encoder_attention_heads
										lowerCamelCase__   =decoder_ffn_dim
										lowerCamelCase__   =decoder_layers
										lowerCamelCase__   =decoder_attention_heads
										lowerCamelCase__   =dropout
										lowerCamelCase__   =attention_dropout
										lowerCamelCase__   =activation_dropout
										lowerCamelCase__   =activation_function
										lowerCamelCase__   =init_std
										lowerCamelCase__   =init_xavier_std
										lowerCamelCase__   =encoder_layerdrop
										lowerCamelCase__   =decoder_layerdrop
										lowerCamelCase__   =encoder_layers
										lowerCamelCase__   =auxiliary_loss
										lowerCamelCase__   =position_embedding_type
										lowerCamelCase__   =backbone
										lowerCamelCase__   =use_pretrained_backbone
										lowerCamelCase__   =dilation
										# Hungarian matcher
										lowerCamelCase__   =class_cost
										lowerCamelCase__   =bbox_cost
										lowerCamelCase__   =giou_cost
										# Loss coefficients
										lowerCamelCase__   =mask_loss_coefficient
										lowerCamelCase__   =dice_loss_coefficient
										lowerCamelCase__   =cls_loss_coefficient
										lowerCamelCase__   =bbox_loss_coefficient
										lowerCamelCase__   =giou_loss_coefficient
										lowerCamelCase__   =focal_alpha
										super().__init__(is_encoder_decoder=_lowerCamelCase      ,					**_lowerCamelCase )

				@property
				def 						_a      ( self ):
										return self.encoder_attention_heads

				@property
				def 						_a      ( self ):
										return self.d_model






				def 						_a      ( self ):
										lowerCamelCase__   =copy.deepcopy(self.__dict__ )
										if self.backbone_config is not None:
																lowerCamelCase__   =self.backbone_config.to_dict()
										lowerCamelCase__   =self.__class__.model_type
										return output






class   __UpperCAmelCase		(      __lowerCAmelCase      ):
				A__ :  Any    				=			version.parse('''1.11'''      )

				@property
				def 						_a      ( self ):
										return OrderedDict(
										    [
										        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
										        ("pixel_mask", {0: "batch"}),
										    ] )

				@property
				def 						_a      ( self ):
										return 1E-5






				@property
				def 						_a      ( self ):
										return 12



"""simple docstring"""


def      lowerCamelCase_					(   __lowerCAmelCase							)				->   list:




						'''simple docstring'''



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

						lowerCamelCase__   =[]

						def generate(__lowerCAmelCase  ,       __lowerCAmelCase							):
												lowerCamelCase__   =[0] * n
												res.append(tuple(__lowerCAmelCase							)							)

												lowerCamelCase__   =0
												while i < n:
																		if c[i] < i:
																								if i % 2 == 0:
																														lowerCamelCase__   , lowerCamelCase__   =arr[i], arr[0]
																								else:
																														lowerCamelCase__   , lowerCamelCase__   =arr[i], arr[c[i]]
																								res.append(tuple(__lowerCAmelCase							)							)
																								c[i] += 1
																								lowerCamelCase__   =0
																		else:
																								lowerCamelCase__   =0
																								i += 1

						generate(len(__lowerCAmelCase							)  ,       __lowerCAmelCase							)
						return res


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


