"""simple docstring"""


from __future__ import annotations

from collections import deque






class    a__    :


   def __init__(     self,				_UpperCAmelCase  ):
        '''simple docstring'''



        lowercase__				 =							[]
        self.adlist.append(
            {"value": "", "next_states": [], "fail_state": 0, "output": []}  )

        for keyword in keywords:
             self.add_keyword(_UpperCAmelCase  )
        self.set_fail_transitions()


   def 	snake_case__	(     self,				_UpperCAmelCase,				_UpperCAmelCase  ):
        '''simple docstring'''



        for state in self.adlist[current_state]["next_states"]:
             if char == self.adlist[state]["value"]:
                  return state
        return None


   def 	snake_case__	(     self,				_UpperCAmelCase  ):
        '''simple docstring'''



        lowercase__				 =							0
        for character in keyword:
             lowercase__				 =							self.find_next_state(_UpperCAmelCase,				_UpperCAmelCase  )
             if next_state is None:
                  self.adlist.append(
                      {
                          "value": character,
                          "next_states": [],
                          "fail_state": 0,
                          "output": [],
                      }  )
                  self.adlist[current_state]["next_states"].append(len(self.adlist  ) - 1  )
                  lowercase__				 =							len(self.adlist  ) - 1
             else:
                  lowercase__				 =							next_state
        self.adlist[current_state]["output"].append(_UpperCAmelCase  )


   def 	snake_case__	(     self  ):
        '''simple docstring'''



        lowercase__				 =							deque()
        for node in self.adlist[0]["next_states"]:
             q.append(_UpperCAmelCase  )
             lowercase__				 =							0
        while q:
             lowercase__				 =							q.popleft()
             for child in self.adlist[r]["next_states"]:
                  q.append(_UpperCAmelCase  )
                  lowercase__				 =							self.adlist[r]["fail_state"]
                  while (
                      self.find_next_state(_UpperCAmelCase,				self.adlist[child]["value"]  ) is None
                      and state != 0
                  ):
                       lowercase__				 =							self.adlist[state]["fail_state"]
                  lowercase__				 =							self.find_next_state(
                      _UpperCAmelCase,				self.adlist[child]["value"]  )
                  if self.adlist[child]["fail_state"] is None:
                       lowercase__				 =							0
                  lowercase__				 =							(
                      self.adlist[child]["output"]
                      + self.adlist[self.adlist[child]["fail_state"]]["output"]
                  )


   def 	snake_case__	(     self,				_UpperCAmelCase  ):
        '''simple docstring'''



        lowercase__				 =							{}  # returns a dict with keywords and list of its occurrences
        lowercase__				 =							0
        for i in range(len(_UpperCAmelCase  )  ):
             while (
                 self.find_next_state(_UpperCAmelCase,				string[i]  ) is None
                 and current_state != 0
             ):
                  lowercase__				 =							self.adlist[current_state]["fail_state"]
             lowercase__				 =							self.find_next_state(_UpperCAmelCase,				string[i]  )
             if next_state is None:
                  lowercase__				 =							0
             else:
                  lowercase__				 =							next_state
                  for key in self.adlist[current_state]["output"]:
                       if key not in result:
                            lowercase__				 =							[]
                       result[key].append(i - len(_UpperCAmelCase  ) + 1  )
        return result


if __name__ == "__main__":
 import doctest

 doctest.testmod()
"""simple docstring"""


import itertools
import math







def 					__a   (		A      ):






     '''simple docstring'''



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







def 					__a   (		):






     '''simple docstring'''



     lowercase__				 =							2
     while True:
          if is_prime(A      ):
               yield num
          num += 1







def 					__a   (		A = 1_00_01      ):






     '''simple docstring'''



     return next(itertools.islice(prime_generator()    ,				nth - 1    ,				A      )      )


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




