"""simple docstring"""






import random


def 			UpperCAmelCase__       (				lowerCAmelCase__     :Any					,		lowerCAmelCase__     :Optional[int]					,		lowerCAmelCase__     :Any		) ->    int:
      '''simple docstring'''


      lowercase														=	a[left_index]
      lowercase														=	left_index + 1
      for j in range(left_index + 1					,		SCREAMING_SNAKE_CASE_		):
            if a[j] < pivot:
                  lowercase														=	a[i], a[j]
                  i += 1
      lowercase														=	a[i - 1], a[left_index]
      return i - 1


def 			UpperCAmelCase__       (				lowerCAmelCase__     :List[Any]					,		lowerCAmelCase__     :Dict					,		lowerCAmelCase__     :Optional[int]		) ->    Optional[int]:
      '''simple docstring'''


      if left < right:
            lowercase														=	random.randint(SCREAMING_SNAKE_CASE_					,		right - 1		)
            lowercase														=	(
                a[left],
                a[pivot],
            )  # switches the pivot with the left most bound
            lowercase														=	partition(SCREAMING_SNAKE_CASE_					,		SCREAMING_SNAKE_CASE_					,		SCREAMING_SNAKE_CASE_		)
            quick_sort_random(
                SCREAMING_SNAKE_CASE_					,		SCREAMING_SNAKE_CASE_					,		SCREAMING_SNAKE_CASE_		)  # recursive quicksort to the left of the pivot point
            quick_sort_random(
                SCREAMING_SNAKE_CASE_					,		pivot_index + 1					,		SCREAMING_SNAKE_CASE_		)  # recursive quicksort to the right of the pivot point


def 			UpperCAmelCase__       (				) ->    Union[str, Any]:
      '''simple docstring'''


      lowercase														=	input("""Enter numbers separated by a comma:\n"""		).strip()
      lowercase														=	[int(SCREAMING_SNAKE_CASE_		) for item in user_input.split(""","""		)]

      quick_sort_random(SCREAMING_SNAKE_CASE_					,		0					,		len(SCREAMING_SNAKE_CASE_		)		)

      print(SCREAMING_SNAKE_CASE_		)


if __name__ == "__main__":
       main()





class      A__							:






				def __init__(						self					:      Optional[Any]    ,     a					:      list   ):






							'''simple docstring'''







							lowerCAmelCase__      :      Dict         =		set_counts
							lowerCAmelCase__      :      str         =		max(a   )
							lowerCAmelCase__      :      Any         =		len(a   )
							lowerCAmelCase__      :      List[str]         =		[1] * num_sets
							lowerCAmelCase__      :      Dict         =		list(range(a   )   )






				def 							_lowerCamelCase		(						self					:      Dict    ,     a					:      int    ,     a					:      int   ):






							'''simple docstring'''







							lowerCAmelCase__      :      Optional[Any]         =		self.get_parent(a   )
							lowerCAmelCase__      :      Tuple         =		self.get_parent(a   )

							if src_parent == dst_parent:
										return False

							if self.ranks[dst_parent] >= self.ranks[src_parent]:
										self.set_counts[dst_parent] += self.set_counts[src_parent]
										lowerCAmelCase__      :      Tuple         =		0
										lowerCAmelCase__      :      str         =		dst_parent
										if self.ranks[dst_parent] == self.ranks[src_parent]:
													self.ranks[dst_parent] += 1
										lowerCAmelCase__      :      List[Any]         =		self.set_counts[dst_parent]
							else:
										self.set_counts[src_parent] += self.set_counts[dst_parent]
										lowerCAmelCase__      :      Optional[int]         =		0
										lowerCAmelCase__      :      Tuple         =		src_parent
										lowerCAmelCase__      :      Optional[int]         =		self.set_counts[src_parent]

							lowerCAmelCase__      :      Optional[Any]         =		max(self.max_set    ,     a   )
							return True






				def 							_lowerCamelCase		(						self					:      Any    ,     a					:      int   ):






							'''simple docstring'''







							if self.parents[disj_set] == disj_set:
										return disj_set
							lowerCAmelCase__      :      Tuple         =		self.get_parent(self.parents[disj_set]   )
							return self.parents[disj_set]