

import random

def       a__					(		UpperCAmelCase							:      List[str]    ,			UpperCAmelCase							:      Optional[Any]    ,			UpperCAmelCase							:      str      )  ->						List[Any]:
  UpperCAmelCase	:							Dict						=			a[left_index]
  UpperCAmelCase	:							Union[str, Any]						=			left_index + 1
  for j in range(left_index + 1    ,			UpperCAmelCase      ):
    if a[j] < pivot:
      UpperCAmelCase			,						UpperCAmelCase	:							List[Any]						=			a[i], a[j]
      i += 1
  UpperCAmelCase			,						UpperCAmelCase	:							Optional[Any]						=			a[i - 1], a[left_index]
  return i - 1

def       a__					(		UpperCAmelCase							:      str    ,			UpperCAmelCase							:      Any    ,			UpperCAmelCase							:      Optional[Any]      )  ->						List[Any]:
  if left < right:
    UpperCAmelCase	:							List[Any]						=			random.randint(UpperCAmelCase    ,			right - 1      )
    UpperCAmelCase			,						UpperCAmelCase	:							Tuple						=			(
        a[left],
        a[pivot],
    )  # switches the pivot with the left most bound
    UpperCAmelCase	:							str						=			partition(UpperCAmelCase    ,			UpperCAmelCase    ,			UpperCAmelCase      )
    quick_sort_random(
        UpperCAmelCase    ,			UpperCAmelCase    ,			UpperCAmelCase      )  # recursive quicksort to the left of the pivot point
    quick_sort_random(
        UpperCAmelCase    ,			pivot_index + 1    ,			UpperCAmelCase      )  # recursive quicksort to the right of the pivot point

def       a__					(		)  ->						Optional[Any]:
  UpperCAmelCase	:							Union[str, Any]						=			input('''Enter numbers separated by a comma:\n'''      ).strip()
  UpperCAmelCase	:							Optional[int]						=			[int(UpperCAmelCase      ) for item in user_input.split(''','''      )]

  quick_sort_random(UpperCAmelCase    ,			0    ,			len(UpperCAmelCase      )      )

  print(UpperCAmelCase      )


if __name__ == "__main__":
     main()








def       a__					(		UpperCAmelCase							:      int      )  ->						bool:
  if not isinstance(UpperCAmelCase    ,			UpperCAmelCase      ):
    UpperCAmelCase	:							List[str]						=			f'''Input value of [number={number}] must be an integer'''
    raise TypeError(UpperCAmelCase      )
  if number < 0:
    return False
  UpperCAmelCase	:							List[str]						=			number * number
  while number > 0:
    if number % 10 != number_square % 10:
      return False
    number //= 10
    number_square //= 10
  return True


if __name__ == "__main__":
     import doctest

     doctest.testmod()





