


from __future__ import annotations

from collections import deque

class     a		:




							"""simple docstring"""


							def __init__(							self	:  Union[str, Any]   ,     lowerCamelCase	:  list[str]    )     ->   Union[str, Any]:
														__snake_case		:      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    __snake_case (							self	:  str   ,     lowerCamelCase	:  int   ,     lowerCamelCase	:  str    )     ->   int | None:
														for state in self.adlist[current_state]["next_states"]:
																					if char == self.adlist[state]["value"]:
																												return state
														return None

							def    __snake_case (							self	:  Tuple   ,     lowerCamelCase	:  str    )     ->   None:
														__snake_case		:      List[str]										=       0
														for character in keyword:
																					__snake_case		:      Any										=       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    )
																												__snake_case		:      Optional[int]										=       len(self.adlist    ) - 1
																					else:
																												__snake_case		:      List[str]										=       next_state
														self.adlist[current_state]["output"].append(__a    )

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






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


if __name__ == "__main__":
			import doctest

			doctest.testmod()





from __future__ import annotations

from functools import lru_cache
from math import ceil

_snake_case					:		Tuple      =    100

_snake_case					:		int      =    set(range(3, NUM_PRIMES, 2))
primes.add(2)
_snake_case					:		int

for prime in range(3, ceil(NUM_PRIMES**0.5), 2):
			if prime not in primes:
						continue
			primes.difference_update(set(range(prime * prime, NUM_PRIMES, prime)))







@lru_cache(maxsize=1_0_0     )
def     lowerCAmelCase_					( __lowerCamelCase     ):
							if number_to_partition < 0:
														return set()
							elif number_to_partition == 0:
														return {1}

							__snake_case		:      set[int]										=       set()
							__snake_case		:      int
							__snake_case		:      int

							for prime in primes:
														if prime > number_to_partition:
																					continue
														for sub in partition(number_to_partition - prime     ):
																					ret.add(sub * prime     )

							return ret







def     lowerCAmelCase_					( __lowerCamelCase = 5_0_0_0     ):
							for number_to_partition in range(1							,     __lowerCamelCase     ):
														if len(partition(__lowerCamelCase     )     ) > number_unique_partitions:
																					return number_to_partition
							return None


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

