




import torch

from transformers import AutoTokenizer




class 					_snake_case						(						A__				):
					def __init__(  self:				Union[str, Any]	,  __lowerCamelCase:				Dict     )    ->				Any:
												__UpperCAmelCase						:			int         =   AutoTokenizer.from_pretrained(_lowerCAmelCase     )
					def    _lowerCamelCase (  self:				str	,  __lowerCamelCase:				Union[str, Any]     )    ->				Union[str, Any]:

												if isinstance(_lowerCAmelCase	,  _lowerCAmelCase     ) and all(isinstance(_x	,  _lowerCAmelCase     ) for _x in x     ):
																			__UpperCAmelCase						:			Any         =   None
																			for l in x:
																										__UpperCAmelCase						:			Any         =   self.tokenizer(
																										    _lowerCAmelCase	,  padding="max_length"	,  max_length=3_84	,  truncation=_lowerCAmelCase	,  return_tensors="pt"	,  )
																										__UpperCAmelCase						:			str         =   torch.tensor([len(_lowerCAmelCase     )]     )
																										if d is not None:
																																	for k in d.keys():
																																								__UpperCAmelCase						:			List[Any]         =   torch.cat((d[k], t[k])	,  0     )
																										else:
																																	__UpperCAmelCase						:			Any         =   t

																			__UpperCAmelCase						:			Union[str, Any]         =   torch.tensor(self.tokenizer.convert_tokens_to_ids("[E]"     )     )
																			__UpperCAmelCase						:			Tuple         =   torch.tensor(self.tokenizer.convert_tokens_to_ids("[/E]"     )     )

												elif isinstance(_lowerCAmelCase	,  _lowerCAmelCase     ) and all(isinstance(_x	,  _lowerCAmelCase     ) for _x in x     ):
																			__UpperCAmelCase						:			List[Any]         =   self.tokenizer(
																			    _lowerCAmelCase	,  padding="max_length"	,  max_length=3_84	,  truncation=_lowerCAmelCase	,  return_tensors="pt"	,  )

												else:
																			raise Exception(
																			    "Type of parameter x was not recognized! Only `list of strings` for query or `list of lists of"
																			    " strings` for supports are supported."     )

												return d





					def    _lowerCamelCase (  self:				Optional[int]	,  __lowerCamelCase:				Tuple	,  __lowerCamelCase:				Dict	,  __lowerCamelCase:				Optional[int]	,  __lowerCamelCase:				Dict	,  __lowerCamelCase:				Dict=0.70     )    ->				List[str]:
												__UpperCAmelCase						:			str         =   []
												for idx in range(len(W_query["input_ids"]     )     ):
																			__UpperCAmelCase						:			Union[str, Any]         =   range(p_start.shape[1]     )

																			__UpperCAmelCase						:			Dict         =   []
																			for start_id in start_indexes:
																										for end_id in end_indexes:
																																	if start_id < end_id:
																																								output.append(
																																								    (
																																								        start_id,
																																								        end_id,
																																								        p_start[idx][start_id].item(),
																																								        p_end[idx][end_id].item(),
																																								    )     )

																			output.sort(key=lambda __lowerCamelCase     : (tup[2] * tup[3])	,  reverse=_lowerCAmelCase     )
																			__UpperCAmelCase						:			Union[str, Any]         =   []
																			for k in range(len(_lowerCAmelCase     )     ):
																										if output[k][2] * output[k][3] >= thresh:
																																	__UpperCAmelCase    ,	__UpperCAmelCase						:			Dict         =   output[k][0], output[k][1]
																																	__UpperCAmelCase						:			Tuple         =   self.tokenizer.decode(W_query["input_ids"][idx][c_start_pos:c_end_pos]     )
																																	temp.append((decoded, output[k][2] * output[k][3])     )

																			final_outputs.append(_lowerCAmelCase     )

												return final_outputs





def   _UpperCamelCase   (			snake_case__							)						->   list:
							__UpperCAmelCase						:			Optional[int]         =   1.3
							__UpperCAmelCase						:			Any         =   len(snake_case__							)
							__UpperCAmelCase						:			Optional[Any]         =   False

							while not completed:
														# Update the gap value for a next comb
														__UpperCAmelCase						:			List[str]         =   int(gap / shrink_factor							)
														if gap <= 1:
																					__UpperCAmelCase						:			Dict         =   True

														__UpperCAmelCase						:			List[Any]         =   0
														while index + gap < len(snake_case__							):
																					if data[index] > data[index + gap]:
																												# Swap values
																												__UpperCAmelCase    ,	__UpperCAmelCase						:			Tuple         =   data[index + gap], data[index]
																												__UpperCAmelCase						:			List[str]         =   False
																					index += 1

							return data


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	_snake_case			=						input('''Enter numbers separated by a comma:\n''').strip()
	_snake_case			=						[int(item) for item in user_input.split(''',''')]
	print(comb_sort(unsorted))




