


"""simple docstring"""





import random
import sys

snake_case__		:  str     					=					'''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''


def   _snake_case    (    ):
      lowerCAmelCase       :						List[str]							= input('''Enter message: '''      )
      lowerCAmelCase       :						Dict							= '''LFWOAYUISVKMNXPBDCRJTQEGHZ'''
      lowerCAmelCase       :						int							= input('''Encrypt/Decrypt [e/d]: '''      )

      check_valid_key(_a      )

      if resp.lower().startswith('''e'''      ):
            lowerCAmelCase       :						Tuple							= '''encrypt'''
            lowerCAmelCase       :						List[Any]							= encrypt_message(_a			, _a      )
      elif resp.lower().startswith('''d'''      ):
            lowerCAmelCase       :						Any							= '''decrypt'''
            lowerCAmelCase       :						Union[str, Any]							= decrypt_message(_a			, _a      )

      print(f'''\n{mode.title()}ion: \n{translated}'''      )


def   _snake_case    (    _snake_case					:      Union[str, Any]      ):
      lowerCAmelCase       :						int							= list(_a      )
      lowerCAmelCase       :						Optional[int]							= list(_a      )
      key_list.sort()
      letters_list.sort()

      if key_list != letters_list:
            sys.exit('''Error in the key or symbol set.'''      )


def   _snake_case    (    _snake_case					:      int			, _snake_case					:      Dict      ):
      return translate_message(_a			, _a			, '''encrypt'''      )


def   _snake_case    (    _snake_case					:      int			, _snake_case					:      Union[str, Any]      ):
      return translate_message(_a			, _a			, '''decrypt'''      )


def   _snake_case    (    _snake_case					:      str			, _snake_case					:      Union[str, Any]			, _snake_case					:      Optional[Any]      ):
      lowerCAmelCase       :						Optional[int]							= ''''''
      lowerCAmelCase       :						Optional[int]							= LETTERS
      lowerCAmelCase       :						int							= key

      if mode == "decrypt":
            lowerCAmelCase       :						str							= chars_b, chars_a

      for symbol in message:
            if symbol.upper() in chars_a:
                  lowerCAmelCase       :						List[Any]							= chars_a.find(symbol.upper()      )
                  if symbol.isupper():
                        translated += chars_b[sym_index].upper()
                  else:
                        translated += chars_b[sym_index].lower()
            else:
                  translated += symbol

      return translated


def   _snake_case    (    ):
      lowerCAmelCase       :						List[Any]							= list(_a      )
      random.shuffle(_a      )
      return "".join(_a      )


if __name__ == "__main__":
 main()






import math






def 	lowerCamelCase_       (			_a			):




		"""simple docstring"""






		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(_a			) + 1			)      ,  6			):
				if number % i == 0 or number % (i + 2) == 0:
						return False
		return True






def 	lowerCamelCase_       (			_a = 1_000      ,  _a = 1_000			):




		"""simple docstring"""






		lowerCAmelCase__  :     Union[str, Any]       	=   [0, 0, 0]  # length, a, b
		for a in range((a_limit * -1) + 1      ,  _a			):
				for b in range(2      ,  _a			):
						if is_prime(_a			):
								lowerCAmelCase__  :     str       	=   0
								lowerCAmelCase__  :     int       	=   0
								while is_prime((n**2) + (a * n) + b			):
										count += 1
										n += 1
								if count > longest[0]:
										lowerCAmelCase__  :     Dict       	=   [count, a, b]
		lowerCAmelCase__  :     int       	=   longest[1] * longest[2]
		return ans


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




