





'''simple docstring'''




lowercase__   :				Optional[int]      =   {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

lowercase__   :				Tuple      =   {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}






def 	_lowerCAmelCase      (  __snake_case  :			dict[int, list[int]]			,							__snake_case  :			int			,							__snake_case  :			list[bool]      )					->					list[int]:
     __A						:			int								=	True
     __A						:			Dict								=	[]

     for neighbour in graph[vert]:
          if not visited[neighbour]:
               order += topology_sort(__snake_case			,							__snake_case			,							__snake_case      )

     order.append(__snake_case      )

     return order






def 	_lowerCAmelCase      (  __snake_case  :			dict[int, list[int]]			,							__snake_case  :			int			,							__snake_case  :			list[bool]      )					->					list[int]:
     __A						:			Union[str, Any]								=	True
     __A						:			Tuple								=	[vert]

     for neighbour in reversed_graph[vert]:
          if not visited[neighbour]:
               component += find_components(__snake_case			,							__snake_case			,							__snake_case      )

     return component







def 	_lowerCAmelCase      (  __snake_case  :			dict[int, list[int]]      )					->					list[list[int]]:
     __A						:			Optional[int]								=	len(__snake_case      ) * [False]
     __A						:			dict[int, list[int]]								=	{vert: [] for vert in range(len(__snake_case      )      )}

     for vert, neighbours in graph.items():
          for neighbour in neighbours:
               reversed_graph[neighbour].append(__snake_case      )

     __A						:			int								=	[]
     for i, was_visited in enumerate(__snake_case      ):
          if not was_visited:
               order += topology_sort(__snake_case			,							__snake_case			,							__snake_case      )

     __A						:			Optional[int]								=	[]
     __A						:			Tuple								=	len(__snake_case      ) * [False]

     for i in range(len(__snake_case      )      ):
          __A						:			int								=	order[len(__snake_case      ) - i - 1]
          if not visited[vert]:
               __A						:			int								=	find_components(__snake_case			,							__snake_case			,							__snake_case      )
               components_list.append(__snake_case      )

     return components_list






'''simple docstring'''




import itertools
import math






def 	_lowerCAmelCase      (  __snake_case  :			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(__snake_case      ) + 1      )			,							6      ):
          if number % i == 0 or number % (i + 2) == 0:
               return False
     return True






def 	_lowerCAmelCase      (  )					->					List[Any]:
     __A						:			Optional[Any]								=	2
     while True:
          if is_prime(__snake_case      ):
               yield num
          num += 1






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


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