

"""simple docstring"""




import random



def 	UpperCAmelCase__   (				A__	,    A__	,    A__   )      ->      List[Any]:




   """simple docstring"""
   lowerCamelCase__						=			a[left_index]
   lowerCamelCase__						=			left_index + 1
   for j in range(left_index + 1	,    A__   ):
      if a[j] < pivot:
         lowerCamelCase__					,       lowerCamelCase__						=			a[i], a[j]
         i += 1
   lowerCamelCase__					,       lowerCamelCase__						=			a[i - 1], a[left_index]
   return i - 1



def 	UpperCAmelCase__   (				A__	,    A__	,    A__   )      ->      Optional[int]:




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



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




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

   quick_sort_random(A__	,    0	,    len(A__   )   )

   print(A__   )


if __name__ == "__main__":
     main()







"""simple docstring"""




def 	UpperCAmelCase__   (				A__   )      ->      list[int]:




   """simple docstring"""

   if num <= 0:
      raise ValueError("Input must be a positive integer"   )

   lowerCamelCase__						=			[True] * (num + 1)

   lowerCamelCase__						=			2
   while p * p <= num:
      if primes[p]:
         for i in range(p * p	,    num + 1	,    A__   ):
            lowerCamelCase__						=			False
      p += 1

   return [prime for prime in range(2	,    num + 1   ) if primes[prime]]


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     SCREAMING_SNAKE_CASE_     :			Optional[Any]	  =			int(input('''Enter a positive integer: ''').strip())
     print(prime_sieve_eratosthenes(user_num))




