


"""simple docstring"""






from typing import List, Optional, Union

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType


class 			lowerCamelCase_		(			lowercase   ):





				"""simple docstring"""







				_lowerCAmelCase      :      Optional[Any]      							=					["image_processor", "tokenizer"]
				_lowerCAmelCase      :      List[str]      							=					"BridgeTowerImageProcessor"
				_lowerCAmelCase      :      str      							=					("RobertaTokenizer", "RobertaTokenizerFast")



				def __init__(						self       ,		UpperCAmelCase__       ,		UpperCAmelCase__     ):
								super().__init__(UpperCAmelCase__       ,		UpperCAmelCase__     )



				def __call__(						self       ,		UpperCAmelCase__       ,		UpperCAmelCase__ = None       ,		UpperCAmelCase__ = True       ,		UpperCAmelCase__ = False       ,		UpperCAmelCase__ = None       ,		UpperCAmelCase__ = None       ,		UpperCAmelCase__ = 0       ,		UpperCAmelCase__ = None       ,		UpperCAmelCase__ = None       ,		UpperCAmelCase__ = None       ,		UpperCAmelCase__ = False       ,		UpperCAmelCase__ = False       ,		UpperCAmelCase__ = False       ,		UpperCAmelCase__ = False       ,		UpperCAmelCase__ = True       ,		UpperCAmelCase__ = None       ,		**UpperCAmelCase__       ,		):
								SCREAMING_SNAKE_CASE__     							=				self.tokenizer(
								    text=UpperCAmelCase__       ,		add_special_tokens=UpperCAmelCase__       ,		padding=UpperCAmelCase__       ,		truncation=UpperCAmelCase__       ,		max_length=UpperCAmelCase__       ,		stride=UpperCAmelCase__       ,		pad_to_multiple_of=UpperCAmelCase__       ,		return_token_type_ids=UpperCAmelCase__       ,		return_attention_mask=UpperCAmelCase__       ,		return_overflowing_tokens=UpperCAmelCase__       ,		return_special_tokens_mask=UpperCAmelCase__       ,		return_offsets_mapping=UpperCAmelCase__       ,		return_length=UpperCAmelCase__       ,		verbose=UpperCAmelCase__       ,		return_tensors=UpperCAmelCase__       ,		**UpperCAmelCase__       ,		)
								# add pixel_values + pixel_mask
								SCREAMING_SNAKE_CASE__     							=				self.image_processor(
								    UpperCAmelCase__       ,		return_tensors=UpperCAmelCase__       ,		do_normalize=UpperCAmelCase__       ,		do_center_crop=UpperCAmelCase__       ,		**UpperCAmelCase__     )
								encoding.update(UpperCAmelCase__     )

								return encoding



				def   lowerCAmelCase__		(						self       ,		*UpperCAmelCase__       ,		**UpperCAmelCase__     ):
								return self.tokenizer.batch_decode(*UpperCAmelCase__       ,		**UpperCAmelCase__     )



				def   lowerCAmelCase__		(						self       ,		*UpperCAmelCase__       ,		**UpperCAmelCase__     ):
								return self.tokenizer.decode(*UpperCAmelCase__       ,		**UpperCAmelCase__     )






				@property
				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				self.tokenizer.model_input_names
								SCREAMING_SNAKE_CASE__     							=				self.image_processor.model_input_names
								return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names     )     )




"""simple docstring"""






from __future__ import annotations


def __lowercase     (      lowerCamelCase_  :      list						,					lowerCamelCase_  :      int						,					lowerCamelCase_  :      int						,					lowerCamelCase_  :      int  ):
				SCREAMING_SNAKE_CASE__     							=				[]
				SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     							=				input_list[low:mid], input_list[mid : high + 1]
				while left and right:
								result.append((left if left[0] <= right[0] else right).pop(0  )  )
				SCREAMING_SNAKE_CASE__     							=				result + left + right
				return input_list


def __lowercase     (      lowerCamelCase_  :      list  ):
				if len(lowerCamelCase_  ) <= 1:
								return input_list
				SCREAMING_SNAKE_CASE__     							=				list(lowerCamelCase_  )

				# iteration for two-way merging
				SCREAMING_SNAKE_CASE__     							=				2
				while p <= len(lowerCamelCase_  ):
								# getting low, high and middle value for merge-sort of single list
								for i in range(0						,					len(lowerCamelCase_  )						,					lowerCamelCase_  ):
												SCREAMING_SNAKE_CASE__     							=				i
												SCREAMING_SNAKE_CASE__     							=				i + p - 1
												SCREAMING_SNAKE_CASE__     							=				(low + high + 1) // 2
												SCREAMING_SNAKE_CASE__     							=				merge(lowerCamelCase_						,					lowerCamelCase_						,					lowerCamelCase_						,					lowerCamelCase_  )
								# final merge of last two parts
								if p * 2 >= len(lowerCamelCase_  ):
												SCREAMING_SNAKE_CASE__     							=				i
												SCREAMING_SNAKE_CASE__     							=				merge(lowerCamelCase_						,					0						,					lowerCamelCase_						,					len(lowerCamelCase_  ) - 1  )
												break
								p *= 2

				return input_list


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