





# Algorithm for the pigeonhole sorting



def     a_       (					lowerCAmelCase_ :     Optional[Any]      ):
   __lowerCAmelCase				      =      min(lowerCAmelCase_      )  # min() finds the minimum value
   __lowerCAmelCase				      =      max(lowerCAmelCase_      )  # max() finds the maximum value

   __lowerCAmelCase				      =      max_val - min_val + 1  # size is difference of max and min values plus one

   # list of pigeonholes of size equal to the variable size
   __lowerCAmelCase				      =      [0] * size

   # Populate the pigeonholes.
   for x in a:
      assert isinstance(lowerCAmelCase_,      lowerCAmelCase_      ), "integers only please"
      holes[x - min_val] += 1

   # Putting the elements back into the array in an order.
   __lowerCAmelCase				      =      0
   for count in range(lowerCAmelCase_      ):
      while holes[count] > 0:
         holes[count] -= 1
         __lowerCAmelCase				      =      count + min_val
         i += 1

def     a_       (					):
   __lowerCAmelCase				      =      [8, 3, 2, 7, 4, 6, 8]
   pigeonhole_sort(lowerCAmelCase_      )
   print('Sorted order is:',      ' '.join(lowerCAmelCase_      )      )


if __name__ == "__main__":
     main()








import itertools
import math


def       UpperCamelCase__(			UpperCamelCase__     :			int    )->bool:

       if 1 < number < 4:
              # 2 and 3 are primes
              return True
       elif number < 2 or number % 2 == 0 or number % 3 == 0:
              # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
              return False

       # All primes number are in format of 6k +/- 1
       for i in range(5					,	int(math.sqrt(UpperCamelCase__    ) + 1    )					,	6    ):
              if number % i == 0 or number % (i + 2) == 0:
                     return False
       return True


def       UpperCamelCase__(			)->Tuple:
       A__		   =		2
       while True:
              if is_prime(UpperCamelCase__    ):
                     yield num
              num += 1


def       UpperCamelCase__(			UpperCamelCase__     :			int = 1_00_01    )->int:
       return next(itertools.islice(prime_generator()					,	nth - 1					,	UpperCamelCase__    )    )


if __name__ == "__main__":
       print(F"{solution() = }")





