'''simple docstring'''



from __future__ import annotations

from collections.abc import Generator


def 				lowerCamelCase__				(	):




						'''simple docstring'''






						UpperCAmelCase					    =     {}
						UpperCAmelCase					    =     2
						while True:
												UpperCAmelCase					    =     factor_map.pop(A				,       A					)
												if factor:
																		UpperCAmelCase					    =     factor + prime
																		while x in factor_map:
																								x += factor
																		UpperCAmelCase					    =     factor
												else:
																		UpperCAmelCase					    =     prime
																		yield prime
												prime += 1


def 				lowerCamelCase__				(	A       :      float = 1E10					):




						'''simple docstring'''






						UpperCAmelCase					    =     sieve()

						UpperCAmelCase					    =     1
						while True:
												UpperCAmelCase					    =     next(A					)
												if (2 * prime * n) > limit:
																		return n
												# Ignore the next prime as the reminder will be 2.
												next(A					)
												n += 2


if __name__ == "__main__":
	print(solution())









'''simple docstring'''



def 				lowerCamelCase__				(	A       :      int				,       A       :      int					):




						'''simple docstring'''






						while a != 0:
												UpperCAmelCase    ,    UpperCAmelCase					    =     b % a, a
						return b




def 				lowerCamelCase__				(	A       :      int				,       A       :      int					):




						'''simple docstring'''






						if gcd(A				,       A					) != 1:
												UpperCAmelCase					    =     f"""mod inverse of {a!r} and {m!r} does not exist"""
												raise ValueError(A					)
						UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     1, 0, a
						UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     0, 1, m
						while va != 0:
												UpperCAmelCase					    =     ua // va
												UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase    ,    UpperCAmelCase					    =     (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
						return ua % m





