



from __future__ import annotations

from collections import deque




class 							lowerCAmelCase__  :







     def __init__(       self      :     Optional[Any]			,		_A      :     list[str]):
           A__	:							list[dict]						    = []
           self.adlist.append(
               {"value": "", "next_states": [], "fail_state": 0, "output": []})

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







     def  _lowercase			(       self      :     Dict			,		_A      :     int			,		_A      :     str):
           for state in self.adlist[current_state]["next_states"]:
                 if char == self.adlist[state]["value"]:
                       return state
           return None







     def  _lowercase			(       self      :     int			,		_A      :     str):
           A__	:							Optional[int]						    = 0
           for character in keyword:
                 A__	:							Optional[int]						    = self.find_next_state(_A			,		_A)
                 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)
                       A__	:							Tuple						    = len(self.adlist) - 1
                 else:
                       A__	:							int						    = next_state
           self.adlist[current_state]["output"].append(_A)







     def  _lowercase			(       self      :     int):
           A__	:							deque						    = deque()
           for node in self.adlist[0]["next_states"]:
                 q.append(_A)
                 A__	:							Optional[int]						    = 0
           while q:
                 A__	:							Dict						    = q.popleft()
                 for child in self.adlist[r]["next_states"]:
                       q.append(_A)
                       A__	:							str						    = self.adlist[r]["fail_state"]
                       while (
                           self.find_next_state(_A			,		self.adlist[child]["value"]) is None
                           and state != 0
                       ):
                             A__	:							int						    = self.adlist[state]["fail_state"]
                       A__	:							List[Any]						    = self.find_next_state(
                           _A			,		self.adlist[child]["value"])
                       if self.adlist[child]["fail_state"] is None:
                             A__	:							List[Any]						    = 0
                       A__	:							Tuple						    = (
                           self.adlist[child]["output"]
                           + self.adlist[self.adlist[child]["fail_state"]]["output"]
                       )







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


if __name__ == "__main__":
  import doctest

  doctest.testmod()




def 	snake_case__       (					__lowercase       )		->		int:







						"""simple docstring"""

						if divisor % 5 == 0 or divisor % 2 == 0:
												return 0
						A__	:							Tuple						    = 1
						A__	:							Union[str, Any]						    = 1
						while repunit:
												A__	:							Union[str, Any]						    = (1_0 * repunit + 1) % divisor
												repunit_index += 1
						return repunit_index
def 	snake_case__       (					__lowercase = 1_0_0_0_0_0_0       )		->		int:







						"""simple docstring"""

						A__	:							Dict						    = limit - 1
						if divisor % 2 == 0:
												divisor += 1
						while least_divisible_repunit(__lowercase       ) <= limit:
												divisor += 2
						return divisor


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