



'''simple docstring'''
from __future__ import annotations

from string import ascii_letters






def A__					(  UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_ = None							):
						_UpperCamelCase      :	Union[str, Any]				       =     alphabet or ascii_letters

						# The final result string
						_UpperCamelCase      :	str				       =     ''

						for character in input_string:
												if character not in alpha:
																		# Append without encryption if character is not in the alphabet
																		result += character
												else:
																		# Get the index of the new key and make sure it isn't too large
																		_UpperCamelCase      :	Union[str, Any]				       =     (alpha.index(UpperCAmelCase_							) + key) % len(UpperCAmelCase_							)

																		# Append the encoded character to the alphabet
																		result += alpha[new_key]

						return result






def A__					(  UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_ = None							):
						key *= -1

						return encrypt(UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_							)






def A__					(  UpperCAmelCase_						,						UpperCAmelCase_ = None							):
						_UpperCamelCase      :	Union[str, Any]				       =     alphabet or ascii_letters

						# To store data on all the combinations
						_UpperCamelCase      :	Optional[int]				       =     {}

						# Cycle through each combination
						for key in range(1						,						len(UpperCAmelCase_							) + 1							):
												# Decrypt the message and store the result in the data
												_UpperCamelCase      :	Any				       =     decrypt(UpperCAmelCase_						,						UpperCAmelCase_						,						UpperCAmelCase_							)

						return brute_force_data


if __name__ == "__main__":
					while True:
										print(F"""\n{'-' * 10}\n Menu\n{'-' * 10}""")
										print(*['1.Encrypt', '2.Decrypt', '3.BruteForce', '4.Quit'], sep='\n')

										# get user input
										snake_case_				:			Tuple        =						input('\nWhat would you like to do?: ').strip() or '4'

										# run functions based on what the user chose
										if choice not in ("1", "2", "3", "4"):
															print('Invalid choice, please enter a valid choice')
										elif choice == "1":
															snake_case_				:			List[str]        =						input('Please enter the string to be encrypted: ')
															snake_case_				:			Any        =						int(input('Please enter off-set: ').strip())

															print(encrypt(input_string, key))
										elif choice == "2":
															snake_case_				:			int        =						input('Please enter the string to be decrypted: ')
															snake_case_				:			Dict        =						int(input('Please enter off-set: ').strip())

															print(decrypt(input_string, key))
										elif choice == "3":
															snake_case_				:			Optional[int]        =						input('Please enter the string to be decrypted: ')
															snake_case_				:			str        =						brute_force(input_string)

															for key, value in brute_force_data.items():
																				print(F"""Key: {key} | Message: {value}""")

										elif choice == "4":
															print('Goodbye.')
															break







'''simple docstring'''
import math






def A__					(  UpperCAmelCase_							):

						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or number % 2 == 0 or number % 3 == 0:
												# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
												return False

						# All primes number are in format of 6k +/- 1
						for i in range(5						,						int(math.sqrt(UpperCAmelCase_							) + 1							)						,						6							):
												if number % i == 0 or number % (i + 2) == 0:
																		return False
						return True






def A__					(  UpperCAmelCase_ = 1_0_0_0						,						UpperCAmelCase_ = 1_0_0_0							):
						_UpperCamelCase      :	str				       =     [0, 0, 0]  # length, a, b
						for a in range((a_limit * -1) + 1						,						UpperCAmelCase_							):
												for b in range(2						,						UpperCAmelCase_							):
																		if is_prime(UpperCAmelCase_							):
																								_UpperCamelCase      :	List[str]				       =     0
																								_UpperCamelCase      :	Union[str, Any]				       =     0
																								while is_prime((n**2) + (a * n) + b							):
																														count += 1
																														n += 1
																								if count > longest[0]:
																														_UpperCamelCase      :	Any				       =     [count, a, b]
						_UpperCamelCase      :	Dict				       =     longest[1] * longest[2]
						return ans


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


