

import math
from collections.abc import Generator

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				Generator[int, None, None]:
				_UpperCAmelCase				:						Generator       						=			(i for i in range(1     ,					(max_n + 1)       ))
				for i in (n for n in numbers if n > 1):
								for j in range(2     ,					lowerCAmelCase       ):
												if (i % j) == 0:
																break
								else:
												yield i

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				Generator[int, None, None]:
				_UpperCAmelCase				:						Generator       						=			(i for i in range(1     ,					(max_n + 1)       ))
				for i in (n for n in numbers if n > 1):
								# only need to check for factors up to sqrt(i)
								_UpperCAmelCase				:						Union[str, Any]       						=			int(math.sqrt(lowerCAmelCase       )       ) + 1
								for j in range(2     ,					lowerCAmelCase       ):
												if (i % j) == 0:
																break
								else:
												yield i

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				Generator[int, None, None]:
				_UpperCAmelCase				:						Generator       						=			(i for i in range(1     ,					(max_n + 1)     ,					2       ))
				# It's useless to test even numbers as they will not be prime
				if max_n > 2:
								yield 2  # Because 2 will not be tested, it's necessary to yield it now
				for i in (n for n in numbers if n > 1):
								_UpperCAmelCase				:						Optional[Any]       						=			int(math.sqrt(lowerCAmelCase       )       ) + 1
								for j in range(3     ,					lowerCAmelCase     ,					2       ):
												# As we removed the even numbers, we don't need them now
												if (i % j) == 0:
																break
								else:
												yield i

def 							__SCREAMING_SNAKE_CASE							( )      ->				Optional[int]:
				from timeit import timeit

				_UpperCAmelCase				:						Optional[Any]       						=			"from __main__ import slow_primes, primes, fast_primes"
				print(timeit("slow_primes(1_000_000_000_000)"     ,					setup=lowerCAmelCase     ,					number=100_0000       )       )
				print(timeit("primes(1_000_000_000_000)"     ,					setup=lowerCAmelCase     ,					number=100_0000       )       )
				print(timeit("fast_primes(1_000_000_000_000)"     ,					setup=lowerCAmelCase     ,					number=100_0000       )       )


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE_						=					int(input('Calculate primes up to:\n>> ').strip())
					for ret in primes(number):
										print(ret)
					benchmark()





from hashlib import mda, shaaaa

SCREAMING_SNAKE_CASE_						=					(shaaaa, mda)

class  a     :


						def __init__(				self  ,    A_ = 8		):







										'''simple docstring'''


										_UpperCAmelCase				:						Any       						=			0B0
										_UpperCAmelCase				:						Optional[Any]       						=			size


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Optional[Any]       						=			self.hash_(A_		)
										self.bitarray |= h


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						int       						=			self.hash_(A_		)
										return (h & self.bitarray) == h


						def __contains__(				self  ,    A_		):







										'''simple docstring'''


										return self.exists(A_		)


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Optional[int]       						=			bin(A_		)[2:]
										return res.zfill(self.size		)


						@property
						def 				_UpperCAmelCase (				self		):







										'''simple docstring'''


										return self.format_bin(self.bitarray		)


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										_UpperCAmelCase				:						Union[str, Any]       						=			0B0
										for func in HASH_FUNCTIONS:
														_UpperCAmelCase				:						str       						=			(
														    int.from_bytes(func(value.encode()		).digest()  ,    "little"		) % self.size
														)
														res |= 2**position
										return res


						def 				_UpperCAmelCase (				self  ,    A_		):







										'''simple docstring'''


										return self.format_bin(self.hash_(A_		)		)





						@property
						def 				_UpperCAmelCase (				self		):







										'''simple docstring'''


										_UpperCAmelCase				:						Union[str, Any]       						=			bin(self.bitarray		).count("1"		)
										return (n_ones / self.size) ** len(A_		)


