






"""simple docstring"""






def  __lowerCamelCase					(					lowerCAmelCase__				):

				if len(lowerCAmelCase__				) < 2:
								return collection

				def circle_sort_util(lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				) -> bool:
								A__							 =       False

								if low == high:
												return swapped

								A__							 =       low
								A__							 =       high

								while left < right:
												if collection[left] > collection[right]:
																A__ ,			A__							 =       (
																    collection[right],
																    collection[left],
																)
																A__							 =       True

												left += 1
												right -= 1

								if left == right and collection[left] > collection[right + 1]:
												A__ ,			A__							 =       (
												    collection[right + 1],
												    collection[left],
												)

												A__							 =       True

								A__							 =       low + int((high - low) / 2				)
								A__							 =       circle_sort_util(lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				)
								A__							 =       circle_sort_util(lowerCAmelCase__       ,mid + 1       ,lowerCAmelCase__				)

								return swapped or left_swap or right_swap

				A__							 =       True

				while is_not_sorted is True:
								A__							 =       circle_sort_util(lowerCAmelCase__       ,0       ,len(lowerCAmelCase__				) - 1				)

				return collection


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE						:						str					   =       input('''Enter numbers separated by a comma:\n''').strip()
					SCREAMING_SNAKE_CASE						:						Optional[Any]					   =       [int(item) for item in user_input.split(''',''')]
					print(circle_sort(unsorted))










"""simple docstring"""






from math import ceil



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__				):
				A__							 =       list(range(0       ,lowerCAmelCase__				)				)

				A__							 =       [item for sublist in list(device_map.values()				) for item in sublist]

				# Duplicate check
				A__							 =       []
				for i in device_map_blocks:
								if device_map_blocks.count(lowerCAmelCase__				) > 1 and i not in duplicate_blocks:
												duplicate_blocks.append(lowerCAmelCase__				)
    # Missing blocks
				A__							 =       [i for i in blocks if i not in device_map_blocks]
				A__							 =       [i for i in device_map_blocks if i not in blocks]

				if len(lowerCAmelCase__				) != 0:
								raise ValueError(
								    'Duplicate attention blocks specified in device_map. Attention blocks must be specified to one device.'
								    ' These attention blocks were specified more than once: ' + str(lowerCAmelCase__				)				)
				if len(lowerCAmelCase__				) != 0:
								raise ValueError(
								    'There are attention blocks for this model that are not specified in the device_map. Add these attention '
								    'blocks to a device on the device_map: ' + str(lowerCAmelCase__				)				)
				if len(lowerCAmelCase__				) != 0:
								raise ValueError(
								    'The device_map contains more attention blocks than this model has. Remove these from the device_map:'
								    + str(lowerCAmelCase__				)				)







def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__				):
				A__							 =       list(range(lowerCAmelCase__				)				)
				A__							 =       int(ceil(n_layers / len(lowerCAmelCase__				)				)				)
				A__							 =       [layers[i : i + n_blocks] for i in range(0       ,lowerCAmelCase__       ,lowerCAmelCase__				)]

				return dict(zip(lowerCAmelCase__       ,lowerCAmelCase__				)				)


