


"""simple docstring"""
from __future__ import annotations

from collections import Counter






def 						lowercase				(	_snake_case		: int	)	->list[int]:
	"""simple docstring"""





	__snake_case      :		List[str]         =							[True] * n
	__snake_case      :		str         =							False
	__snake_case      :		int         =							False
	__snake_case      :		List[str]         =							True

	for i in range(3	,  int(n**0.5 + 1	)	,  2	):
		__snake_case      :		List[Any]         =							i * 2
		while index < n:
			__snake_case      :		int         =							False
			__snake_case      :		Any         =							index + i

	__snake_case      :		Dict         =							[2]

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

	return primes






def 						lowercase				(	_snake_case		: int	)	->list[list[int]]:
	"""simple docstring"""





	__snake_case      :		Optional[Any]         =							str(_snake_case	)
	__snake_case      :		str         =							[]
	__snake_case      :		List[Any]         =							['''0''', '''1''', '''2''', '''3''', '''4''', '''5''', '''6''', '''7''', '''8''', '''9''']

	for duplicate in Counter(_snake_case	) - Counter(set(_snake_case	)	):
		__snake_case      :		Union[str, Any]         =							[int(number_str.replace(_snake_case	,  _snake_case	)	) for digit in digits]
		replacements.append(_snake_case	)

	return replacements






def 						lowercase				(	_snake_case		: int = 8	)	->int:
	"""simple docstring"""





	__snake_case      :		Any         =							set()

	# Filter primes with less than 3 replaceable digits
	__snake_case      :		Dict         =							{
	    x for x in set(prime_sieve(1_000_000	)	) if len(str(_snake_case	)	) - len(set(str(_snake_case	)	)	) >= 3
	}

	for prime in primes:
		if prime in numbers_checked:
			continue

		__snake_case      :		Union[str, Any]         =							digit_replacements(_snake_case	)

		for family in replacements:
			numbers_checked.update(_snake_case	)
			__snake_case      :		Optional[Any]         =							primes.intersection(_snake_case	)

			if len(_snake_case	) != family_length:
				continue

			return min(_snake_case	)

	return -1


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







"""simple docstring"""





def       __a	(						__lowerCamelCase,						__lowerCamelCase    ):
   if not isinstance(__lowerCamelCase,						__lowerCamelCase    ):
      raise TypeError("plaintext must be a string"    )
   if not isinstance(__lowerCamelCase,						__lowerCamelCase    ):
      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[int]     	=       plaintext.lower()
   UpperCAmelCase_   :   Any     	=       key.lower()
   UpperCAmelCase_   :   Optional[int]     	=       0
   UpperCAmelCase_   :   List[str]     	=       0
   UpperCAmelCase_   :   Optional[int]     	=       ""
   while plaintext_iterator < len(__lowerCamelCase    ):
      if (
          ord(plaintext[plaintext_iterator]    ) < 97
          or ord(plaintext[plaintext_iterator]    ) > 122
      ):
         ciphertext += plaintext[plaintext_iterator]
         plaintext_iterator += 1
      elif ord(key[key_iterator]    ) < 97 or ord(key[key_iterator]    ) > 122:
         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       __a	(						__lowerCamelCase,						__lowerCamelCase    ):
   if not isinstance(__lowerCamelCase,						__lowerCamelCase    ):
      raise TypeError("ciphertext must be a string"    )
   if not isinstance(__lowerCamelCase,						__lowerCamelCase    ):
      raise TypeError("key must be a string"    )

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

   UpperCAmelCase_   :   List[str]     	=       key.lower()
   UpperCAmelCase_   :   Tuple     	=       0
   UpperCAmelCase_   :   Optional[int]     	=       0
   UpperCAmelCase_   :   Dict     	=       ""
   while ciphertext_iterator < len(__lowerCamelCase    ):
      if (
          ord(ciphertext[ciphertext_iterator]    ) < 97
          or ord(ciphertext[ciphertext_iterator]    ) > 122
      ):
         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()
    _a									=				int(input('Type 1 to encrypt or 2 to decrypt:'))
    if operation == 1:
        _a									=				input('Typeplaintext to be encrypted:\n')
        _a									=				input('Type the key:\n')
        print(encrypt(plaintext, key))
    elif operation == 2:
        _a									=				input('Type the ciphertext to be decrypted:\n')
        _a									=				input('Type the key:\n')
        print(decrypt(ciphertext, key))
    decrypt('jsqqs avvwo', 'coffee')


