




'''simple docstring'''





def 				_a       (				lowerCAmelCase						,	lowerCAmelCase						,	lowerCAmelCase   )->  Dict:
		if right <= left:
				return
		SCREAMING_SNAKE_CASE_							=       SCREAMING_SNAKE_CASE_							=       left
		SCREAMING_SNAKE_CASE_							=       right
		SCREAMING_SNAKE_CASE_							=       sorting[left]
		while i <= b:
				if sorting[i] < pivot:
						SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       sorting[i], sorting[a]
						a += 1
						i += 1
				elif sorting[i] > pivot:
						SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       sorting[i], sorting[b]
						b -= 1
				else:
						i += 1
		quick_sort_apartition(lowerCAmelCase						,	lowerCAmelCase						,	a - 1   )
		quick_sort_apartition(lowerCAmelCase						,	b + 1						,	lowerCAmelCase   )


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase						,	lowerCAmelCase   )->  Tuple:
		if left < right:
				SCREAMING_SNAKE_CASE_							=       lomuto_partition(lowerCAmelCase						,	lowerCAmelCase						,	lowerCAmelCase   )
				quick_sort_lomuto_partition(lowerCAmelCase						,	lowerCAmelCase						,	pivot_index - 1   )
				quick_sort_lomuto_partition(lowerCAmelCase						,	pivot_index + 1						,	lowerCAmelCase   )


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase						,	lowerCAmelCase   )->  List[Any]:
		SCREAMING_SNAKE_CASE_							=       sorting[right]
		SCREAMING_SNAKE_CASE_							=       left
		for i in range(lowerCAmelCase						,	lowerCAmelCase   ):
				if sorting[i] < pivot:
						SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       sorting[i], sorting[store_index]
						store_index += 1
		SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       sorting[store_index], sorting[right]
		return store_index


def 				_a       (				lowerCAmelCase   )->  Union[str, Any]:
		if len(lowerCAmelCase   ) <= 1:
				return sorting
		return (
		    three_way_radix_quicksort([i for i in sorting if i < sorting[0]]   )
		    + [i for i in sorting if i == sorting[0]]
		    + three_way_radix_quicksort([i for i in sorting if i > sorting[0]]   )
		)


if __name__ == "__main__":
						import doctest

						doctest.testmod(verbose=True)

						SCREAMING_SNAKE_CASE:    Any											=   input('''Enter numbers separated by a comma:\n''').strip()
						SCREAMING_SNAKE_CASE:    Union[str, Any]											=   [int(item) for item in user_input.split(''',''')]
						quick_sort_apartition(unsorted, 0, len(unsorted) - 1)
						print(unsorted)





from __future__ import annotations


def 				_a       (				lowerCAmelCase						,	lowerCAmelCase   )->  int:
		SCREAMING_SNAKE_CASE_			,							SCREAMING_SNAKE_CASE_							=       0, len(lowerCAmelCase   ) - 1
		while start_ind <= end_ind:
				if array[start_ind] == search_item:
						return start_ind
				elif array[end_ind] == search_item:
						return end_ind
				else:
						start_ind += 1
						end_ind -= 1
    # returns -1 if search_item is not found in array
		return -1


if __name__ == "__main__":
						print(double_linear_search(list(range(1_0_0)), 4_0))