





def     A__					(						SCREAMING_SNAKE_CASE_      :			str							,  SCREAMING_SNAKE_CASE_      :			str	)     ->     str:






   """simple docstring"""







   if not isinstance(SCREAMING_SNAKE_CASE_							,  SCREAMING_SNAKE_CASE_	):
      raise TypeError('''plaintext must be a string'''	)
   if not isinstance(SCREAMING_SNAKE_CASE_							,  SCREAMING_SNAKE_CASE_	):
      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											=      plaintext.lower()
   _UpperCAmelCase											=      key.lower()
   _UpperCAmelCase											=      0
   _UpperCAmelCase											=      0
   _UpperCAmelCase											=      ''''''
   while plaintext_iterator < len(SCREAMING_SNAKE_CASE_	):
      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     A__					(						SCREAMING_SNAKE_CASE_      :			str							,  SCREAMING_SNAKE_CASE_      :			str	)     ->     str:






   """simple docstring"""







   if not isinstance(SCREAMING_SNAKE_CASE_							,  SCREAMING_SNAKE_CASE_	):
      raise TypeError('''ciphertext must be a string'''	)
   if not isinstance(SCREAMING_SNAKE_CASE_							,  SCREAMING_SNAKE_CASE_	):
      raise TypeError('''key must be a string'''	)

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

   _UpperCAmelCase											=      key.lower()
   _UpperCAmelCase											=      0
   _UpperCAmelCase											=      0
   _UpperCAmelCase											=      ''''''
   while ciphertext_iterator < len(SCREAMING_SNAKE_CASE_	):
      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()
   UpperCAmelCase_											=  int(input("Type 1 to encrypt or 2 to decrypt:"))
   if operation == 1:
      UpperCAmelCase_											=  input("Typeplaintext to be encrypted:\n")
      UpperCAmelCase_											=  input("Type the key:\n")
      print(encrypt(plaintext, key))
   elif operation == 2:
      UpperCAmelCase_											=  input("Type the ciphertext to be decrypted:\n")
      UpperCAmelCase_											=  input("Type the key:\n")
      print(decrypt(ciphertext, key))
   decrypt("jsqqs avvwo", "coffee")






def     A__					(						SCREAMING_SNAKE_CASE_      :			List[Any]							,  SCREAMING_SNAKE_CASE_      :			Dict	)     ->     Any:






   """simple docstring"""







   if n == 0:
      return 1

   elif n % 2 == 1:
      return binary_exponentiation(SCREAMING_SNAKE_CASE_							,  n - 1	) * a

   else:
      _UpperCAmelCase											=      binary_exponentiation(SCREAMING_SNAKE_CASE_							,  n / 2	)
      return b * b


if __name__ == "__main__":
   try:
      UpperCAmelCase_											=  int(input("Enter Base : ").strip())
      UpperCAmelCase_											=  int(input("Enter Power : ").strip())
   except ValueError:
      print("Invalid literal for integer")

   UpperCAmelCase_											=  binary_exponentiation(BASE, POWER)
   print(f'''{BASE}^({POWER}) : {RESULT}''')