




from __future__ import annotations

from collections.abc import Generator


def 					_a							(					)->	Generator[int, None, None]:
		SCREAMING_SNAKE_CASE_					      =							{}
		SCREAMING_SNAKE_CASE_					      =							2
		while True:
				SCREAMING_SNAKE_CASE_					      =							factor_map.pop(lowerCAmelCase    ,						lowerCAmelCase )
				if factor:
						SCREAMING_SNAKE_CASE_					      =							factor + prime
						while x in factor_map:
								x += factor
						SCREAMING_SNAKE_CASE_					      =							factor
				else:
						SCREAMING_SNAKE_CASE_					      =							prime
						yield prime
				prime += 1


def 					_a							(					lowerCAmelCase = 1E1_0 )->	int:
		SCREAMING_SNAKE_CASE_					      =							sieve()

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


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





def 					_a							(					lowerCAmelCase    ,						lowerCAmelCase )->	List[str]:
		SCREAMING_SNAKE_CASE_					      =							[1]
		for i in range(2    ,						lowerCAmelCase ):
				factorials.append(factorials[-1] * i )
		assert 0 <= k < factorials[-1] * n, "k out of bounds"

		SCREAMING_SNAKE_CASE_					      =							[]
		SCREAMING_SNAKE_CASE_					      =							list(range(lowerCAmelCase ) )

		# Find permutation
		while factorials:
				SCREAMING_SNAKE_CASE_					      =							factorials.pop()
				SCREAMING_SNAKE_CASE_      ,				SCREAMING_SNAKE_CASE_					      =							divmod(lowerCAmelCase    ,						lowerCAmelCase )
				permutation.append(elements[number] )
				elements.remove(elements[number] )
		permutation.append(elements[0] )

		return permutation


if __name__ == "__main__":
						import doctest

						doctest.testmod()