code: 
  
  
  
  """simple docstring"""
  
  
  
  
  def 					A_			(		snake_case_     :       str						,snake_case_     :       str    ):
  
  
  
  
  
  
  
      '''simple docstring'''
      if not isinstance(snake_case_						,snake_case_    ):
          raise TypeError("""plaintext must be a string"""    )
      if not isinstance(snake_case_						,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				:   Union[str, Any]          =							plaintext.lower()
      UpperCamelCase				:   Any          =							key.lower()
      UpperCamelCase				:   Union[str, Any]          =							0
      UpperCamelCase				:   int          =							0
      UpperCamelCase				:   Optional[Any]          =							""""""
      while plaintext_iterator < len(snake_case_    ):
          if (
              ord(plaintext[plaintext_iterator]    ) < 9_7
              or ord(plaintext[plaintext_iterator]    ) > 1_2_2
          ):
              ciphertext += plaintext[plaintext_iterator]
              plaintext_iterator += 1
          elif ord(key[key_iterator]    ) < 9_7 or ord(key[key_iterator]    ) > 1_2_2:
              key_iterator += 1
          else:
              ciphertext += chr(
                  (
                      (ord(plaintext[plaintext_iterator]    ) - 9_7 + ord(key[key_iterator]    ))
                      - 9_7
                  )
                  % 2_6
                  + 9_7    )
              key_iterator += 1
              plaintext_iterator += 1
      return ciphertext
  def 					A_			(		snake_case_     :       str						,snake_case_     :       str    ):
  
  
  
  
  
  
  
      '''simple docstring'''
      if not isinstance(snake_case_						,snake_case_    ):
          raise TypeError("""ciphertext must be a string"""    )
      if not isinstance(snake_case_						,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				:   Optional[Any]          =							key.lower()
      UpperCamelCase				:   List[str]          =							0
      UpperCamelCase				:   Tuple          =							0
      UpperCamelCase				:   Any          =							""""""
      while ciphertext_iterator < len(snake_case_    ):
          if (
              ord(ciphertext[ciphertext_iterator]    ) < 9_7
              or ord(ciphertext[ciphertext_iterator]    ) > 1_2_2
          ):
              plaintext += ciphertext[ciphertext_iterator]
          else:
              plaintext += chr(
                  (ord(ciphertext[ciphertext_iterator]    ) - ord(key[key_iterator]    )) % 2_6
                  + 9_7    )
              key += chr(
                  (ord(ciphertext[ciphertext_iterator]    ) - ord(key[key_iterator]    )) % 2_6
                  + 9_7    )
              key_iterator += 1
          ciphertext_iterator += 1
      return plaintext
  
  
  if __name__ == "__main__":
    import doctest
  
    doctest.testmod()
    __A :		int      							=    int(input('''Type 1 to encrypt or 2 to decrypt:'''))
    if operation == 1:
      __A :		str      							=    input('''Typeplaintext to be encrypted:\n''')
      __A :		Tuple      							=    input('''Type the key:\n''')
      print(encrypt(plaintext, key))
    elif operation == 2:
      __A :		Tuple      							=    input('''Type the ciphertext to be decrypted:\n''')
      __A :		List[Any]      							=    input('''Type the key:\n''')
      print(decrypt(ciphertext, key))
    decrypt('''jsqqs avvwo''', '''coffee''')
  
  
  
  
  
style_context: 
  
  
  
  
  """simple docstring"""
  
  
  
  
  def 					A_			(		snake_case_     :       Tuple						,snake_case_     :       Optional[Any]						,snake_case_     :       Optional[Any]    ):
  
  
  
  
  
  
  
      '''simple docstring'''
      assert b != 0, "This cannot accept modulo that is == 0"
      if n == 0:
          return 1
  
      if n % 2 == 1:
          return (bin_exp_mod(snake_case_						,n - 1						,snake_case_    ) * a) % b
  
      UpperCamelCase				:   List[Any]          =							bin_exp_mod(snake_case_						,n / 2						,snake_case_    )
      return (r * r) % b
  
  
  if __name__ == "__main__":
    try:
      __A :		Any      							=    int(input('''Enter Base : ''').strip())
      __A :		Any      							=    int(input('''Enter Power : ''').strip())
      __A :		List[Any]      							=    int(input('''Enter Modulo : ''').strip())
    except ValueError:
      print('''Invalid literal for integer''')
  
    print(bin_exp_mod(BASE, POWER, MODULO))
  
  
  
  
  