"""simple docstring"""







from __future__ import annotations



class  _lowerCamelCase			:







				def __init__( self    :       Tuple			,					lowerCamelCase_    :       int = 0						):

					"""simple docstring"""






					_lowercase :    int							=							key







				def 							__UpperCAmelCase					( self    :       Optional[Any]			,					lowerCamelCase_    :       str			,					lowerCamelCase_    :       int						):

					"""simple docstring"""






					assert isinstance(lowerCamelCase_			,					lowerCamelCase_						) and isinstance(lowerCamelCase_			,					lowerCamelCase_						)

					_lowercase :    Optional[Any]							=							key or self.__key or 1

					# make sure key is an appropriate size
					key %= 2_5_5

					return [chr(ord(lowerCamelCase_						) ^ key						) for ch in content]







				def 							__UpperCAmelCase					( self    :       Optional[int]			,					lowerCamelCase_    :       str			,					lowerCamelCase_    :       int						):

					"""simple docstring"""






					assert isinstance(lowerCamelCase_			,					lowerCamelCase_						) and isinstance(lowerCamelCase_			,					lowerCamelCase_						)

					_lowercase :    str							=							key or self.__key or 1

					# make sure key is an appropriate size
					key %= 2_5_5

					return [chr(ord(lowerCamelCase_						) ^ key						) for ch in content]







				def 							__UpperCAmelCase					( self    :       Optional[Any]			,					lowerCamelCase_    :       str			,					lowerCamelCase_    :       int = 0						):

					"""simple docstring"""






					assert isinstance(lowerCamelCase_			,					lowerCamelCase_						) and isinstance(lowerCamelCase_			,					lowerCamelCase_						)

					_lowercase :    Union[str, Any]							=							key or self.__key or 1

					# make sure key can be any size
					while key > 2_5_5:
						key -= 2_5_5

					# This will be returned
					_lowercase :    str							=							''

					for ch in content:
						ans += chr(ord(lowerCamelCase_						) ^ key						)

					return ans







				def 							__UpperCAmelCase					( self    :       List[str]			,					lowerCamelCase_    :       str			,					lowerCamelCase_    :       int = 0						):

					"""simple docstring"""






					assert isinstance(lowerCamelCase_			,					lowerCamelCase_						) and isinstance(lowerCamelCase_			,					lowerCamelCase_						)

					_lowercase :    Dict							=							key or self.__key or 1

					# make sure key can be any size
					while key > 2_5_5:
						key -= 2_5_5

					# This will be returned
					_lowercase :    List[Any]							=							''

					for ch in content:
						ans += chr(ord(lowerCamelCase_						) ^ key						)

					return ans







				def 							__UpperCAmelCase					( self    :       List[Any]			,					lowerCamelCase_    :       str			,					lowerCamelCase_    :       int = 0						):

					"""simple docstring"""






					assert isinstance(lowerCamelCase_			,					lowerCamelCase_						) and isinstance(lowerCamelCase_			,					lowerCamelCase_						)

					try:
						with open(lowerCamelCase_						) as fin, open('encrypt.out'			,					'w+'						) as fout:
							# actual encrypt-process
							for line in fin:
								fout.write(self.encrypt_string(lowerCamelCase_			,					lowerCamelCase_						)						)

					except OSError:
						return False

					return True







				def 							__UpperCAmelCase					( self    :       Optional[int]			,					lowerCamelCase_    :       str			,					lowerCamelCase_    :       int						):

					"""simple docstring"""






					assert isinstance(lowerCamelCase_			,					lowerCamelCase_						) and isinstance(lowerCamelCase_			,					lowerCamelCase_						)

					try:
						with open(lowerCamelCase_						) as fin, open('decrypt.out'			,					'w+'						) as fout:
							# actual encrypt-process
							for line in fin:
								fout.write(self.decrypt_string(lowerCamelCase_			,					lowerCamelCase_						)						)

					except OSError:
						return False

					return True


# Tests
# crypt = XORCipher()
# key = 67

# # test encrypt
# print(crypt.encrypt("hallo welt",key))
# # test decrypt
# print(crypt.decrypt(crypt.encrypt("hallo welt",key), key))

# # test encrypt_string
# print(crypt.encrypt_string("hallo welt",key))

# # test decrypt_string
# print(crypt.decrypt_string(crypt.encrypt_string("hallo welt",key),key))

# if (crypt.encrypt_file("test.txt",key)):
#       print("encrypt successful")
# else:
#       print("encrypt unsuccessful")

# if (crypt.decrypt_file("encrypt.out",key)):
#       print("decrypt successful")
# else:
#       print("decrypt unsuccessful")




"""simple docstring"""







from __future__ import annotations


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





	_lowercase :    Any							=							[True] * limit
	_lowercase :    Union[str, Any]							=							False
	_lowercase :    Any							=							False
	_lowercase :    List[Any]							=							True

	for i in range(3     ,int(limit**0.5 + 1			)     ,2			):
		_lowercase :    Optional[Any]							=							i * 2
		while index < limit:
			_lowercase :    int							=							False
			_lowercase :    Tuple							=							index + i

	_lowercase :    Optional[Any]							=							[2]

	for i in range(3     ,__UpperCAmelCase     ,2			):
		if is_prime[i]:
			primes.append(__UpperCAmelCase			)

	return primes


def      __lowerCAmelCase(		__UpperCAmelCase = 1_000_000			):






	"""simple docstring"""





	_lowercase :    Optional[Any]							=							prime_sieve(__UpperCAmelCase			)
	_lowercase :    int							=							0
	_lowercase :    List[Any]							=							0

	for i in range(len(__UpperCAmelCase			)			):
		for j in range(i + length     ,len(__UpperCAmelCase			)			):
			_lowercase :    List[Any]							=							sum(primes[i:j]			)
			if sol >= ceiling:
				break

			if sol in primes:
				_lowercase :    Optional[int]							=							j - i
				_lowercase :    Tuple							=							sol

	return largest


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



