'''simple docstring'''

def  _lowerCAmelCase				(				__a			,      __a      )  ->      str:
     '''simple docstring'''







     if not isinstance(__a			,      __a      ):
          raise TypeError("""plaintext must be a string"""      )
     if not isinstance(__a			,      __a      ):
          raise TypeError("""key must be a string"""      )

     if not plaintext:
          raise ValueError("""plaintext is empty"""      )
     if not key:
          raise ValueError("""key is empty"""      )

     key += plaintext
     _UpperCamelCase  :Optional[Any]       =plaintext.lower()
     _UpperCamelCase  :List[str]       =key.lower()
     _UpperCamelCase  :Union[str, Any]       =0
     _UpperCamelCase  :Dict       =0
     _UpperCamelCase  :Any       =""""""
     while plaintext_iterator < len(__a      ):
          if (
              ord(plaintext[plaintext_iterator]      ) < 97
              or ord(plaintext[plaintext_iterator]      ) > 1_22
          ):
               ciphertext += plaintext[plaintext_iterator]
               plaintext_iterator += 1
          elif ord(key[key_iterator]      ) < 97 or ord(key[key_iterator]      ) > 1_22:
               key_iterator += 1
          else:
               ciphertext += chr(
                   (
                       (ord(plaintext[plaintext_iterator]      ) - 97 + ord(key[key_iterator]      ))
                       - 97
                   )
                   % 26
                   + 97      )
               key_iterator += 1
               plaintext_iterator += 1
     return ciphertext



def  _lowerCAmelCase				(				__a			,      __a      )  ->      str:
     '''simple docstring'''







     if not isinstance(__a			,      __a      ):
          raise TypeError("""ciphertext must be a string"""      )
     if not isinstance(__a			,      __a      ):
          raise TypeError("""key must be a string"""      )

     if not ciphertext:
          raise ValueError("""ciphertext is empty"""      )
     if not key:
          raise ValueError("""key is empty"""      )

     _UpperCamelCase  :Tuple       =key.lower()
     _UpperCamelCase  :List[Any]       =0
     _UpperCamelCase  :List[str]       =0
     _UpperCamelCase  :Tuple       =""""""
     while ciphertext_iterator < len(__a      ):
          if (
              ord(ciphertext[ciphertext_iterator]      ) < 97
              or ord(ciphertext[ciphertext_iterator]      ) > 1_22
          ):
               plaintext += ciphertext[ciphertext_iterator]
          else:
               plaintext += chr(
                   (ord(ciphertext[ciphertext_iterator]      ) - ord(key[key_iterator]      )) % 26
                   + 97      )
               key += chr(
                   (ord(ciphertext[ciphertext_iterator]      ) - ord(key[key_iterator]      )) % 26
                   + 97      )
               key_iterator += 1
          ciphertext_iterator += 1
     return plaintext


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      _lowerCamelCase :				Union[str, Any]														= int(input("""Type 1 to encrypt or 2 to decrypt:"""))
      if operation == 1:
            _lowerCamelCase :				Any														= input("""Typeplaintext to be encrypted:\n""")
            _lowerCamelCase :				int														= input("""Type the key:\n""")
            print(encrypt(plaintext, key))
      elif operation == 2:
            _lowerCamelCase :				List[str]														= input("""Type the ciphertext to be decrypted:\n""")
            _lowerCamelCase :				Union[str, Any]														= input("""Type the key:\n""")
            print(decrypt(ciphertext, key))
      decrypt("""jsqqs avvwo""", """coffee""")

"""simple docstring"""

import math
from itertools import permutations






def 				A		(							snake_case :int						) ->      bool:

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






def 				A		(							snake_case :int							,   snake_case :list						) ->      bool:
 __UpperCamelCase    ,      __UpperCamelCase							    =			0, len(snake_case						) - 1
 while left <= right:
  __UpperCamelCase							    =			(left + right) // 2
  if prime_list[middle] == target:
   return True
  elif prime_list[middle] < target:
   __UpperCamelCase							    =			middle + 1
  else:
   __UpperCamelCase							    =			middle - 1

 return False






def 				A		(							) ->      int:
 __UpperCamelCase							    =			[n for n in range(1_0_0_1							,   1_0_0_0_0							,   2						) if is_prime(snake_case						)]
 __UpperCamelCase							    =			[]

 for number in prime_list:
  __UpperCamelCase							    =			[]

  for prime_member in permutations(list(str(snake_case						)						)						):
   __UpperCamelCase							    =			int(''.join(snake_case						)						)

   if prime % 2 == 0:
    continue

   if search(snake_case							,   snake_case						):
    tmp_numbers.append(snake_case						)

  tmp_numbers.sort()
  if len(snake_case						) >= 3:
   candidates.append(snake_case						)

 __UpperCamelCase							    =			[]
 for candidate in candidates:
  __UpperCamelCase							    =			len(snake_case						)
  __UpperCamelCase							    =			False

  for i in range(snake_case						):
   for j in range(i + 1							,   snake_case						):
    for k in range(j + 1							,   snake_case						):
     if (
         abs(candidate[i] - candidate[j]						)
         == abs(candidate[j] - candidate[k]						)
         and len({candidate[i], candidate[j], candidate[k]}						) == 3
     ):
      passed.append(
          sorted([candidate[i], candidate[j], candidate[k]]						)						)
      __UpperCamelCase							    =			True

     if found:
      break
    if found:
     break
   if found:
    break

 __UpperCamelCase							    =			set()
 for seq in passed:
  answer.add(''.join([str(snake_case						) for i in seq]						)						)

 return max(int(snake_case						) for x in answer						)


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



