


snake_case       :					List[Any]        =  {
    '''A''': ('''ABCDEFGHIJKLM''', '''NOPQRSTUVWXYZ'''),
    '''B''': ('''ABCDEFGHIJKLM''', '''NOPQRSTUVWXYZ'''),
    '''C''': ('''ABCDEFGHIJKLM''', '''ZNOPQRSTUVWXY'''),
    '''D''': ('''ABCDEFGHIJKLM''', '''ZNOPQRSTUVWXY'''),
    '''E''': ('''ABCDEFGHIJKLM''', '''YZNOPQRSTUVWX'''),
    '''F''': ('''ABCDEFGHIJKLM''', '''YZNOPQRSTUVWX'''),
    '''G''': ('''ABCDEFGHIJKLM''', '''XYZNOPQRSTUVW'''),
    '''H''': ('''ABCDEFGHIJKLM''', '''XYZNOPQRSTUVW'''),
    '''I''': ('''ABCDEFGHIJKLM''', '''WXYZNOPQRSTUV'''),
    '''J''': ('''ABCDEFGHIJKLM''', '''WXYZNOPQRSTUV'''),
    '''K''': ('''ABCDEFGHIJKLM''', '''VWXYZNOPQRSTU'''),
    '''L''': ('''ABCDEFGHIJKLM''', '''VWXYZNOPQRSTU'''),
    '''M''': ('''ABCDEFGHIJKLM''', '''UVWXYZNOPQRST'''),
    '''N''': ('''ABCDEFGHIJKLM''', '''UVWXYZNOPQRST'''),
    '''O''': ('''ABCDEFGHIJKLM''', '''TUVWXYZNOPQRS'''),
    '''P''': ('''ABCDEFGHIJKLM''', '''TUVWXYZNOPQRS'''),
    '''Q''': ('''ABCDEFGHIJKLM''', '''STUVWXYZNOPQR'''),
    '''R''': ('''ABCDEFGHIJKLM''', '''STUVWXYZNOPQR'''),
    '''S''': ('''ABCDEFGHIJKLM''', '''RSTUVWXYZNOPQ'''),
    '''T''': ('''ABCDEFGHIJKLM''', '''RSTUVWXYZNOPQ'''),
    '''U''': ('''ABCDEFGHIJKLM''', '''QRSTUVWXYZNOP'''),
    '''V''': ('''ABCDEFGHIJKLM''', '''QRSTUVWXYZNOP'''),
    '''W''': ('''ABCDEFGHIJKLM''', '''PQRSTUVWXYZNO'''),
    '''X''': ('''ABCDEFGHIJKLM''', '''PQRSTUVWXYZNO'''),
    '''Y''': ('''ABCDEFGHIJKLM''', '''OPQRSTUVWXYZN'''),
    '''Z''': ('''ABCDEFGHIJKLM''', '''OPQRSTUVWXYZN'''),
}
def        __lowerCamelCase		(				UpperCAmelCase_		):




      """simple docstring"""





      return [alphabet[char] for char in key.upper()]
def        __lowerCamelCase		(				UpperCAmelCase_				,						UpperCAmelCase_		):




      """simple docstring"""





      a		:Optional[Any]											= ''''''
      a		:Tuple											= 0
      a		:Optional[int]											= generate_table(__snake_case		)
      for char in words.upper():
            cipher += get_opponent(table[count]				,						__snake_case		)
            a		:Union[str, Any]											= (count + 1) % len(__snake_case		)
      return cipher
def        __lowerCamelCase		(				UpperCAmelCase_				,						UpperCAmelCase_		):




      """simple docstring"""





      return encrypt(__snake_case				,						__snake_case		)
def        __lowerCamelCase		(				UpperCAmelCase_				,						UpperCAmelCase_		):




      """simple docstring"""





      a		:Any											= 0 if char in table[0] else 1
      a		:str											= table[row].index(__snake_case		)
      return row, col
def        __lowerCamelCase		(				UpperCAmelCase_				,						UpperCAmelCase_		):




      """simple docstring"""





      a							,       a		:int											= get_position(__snake_case				,						char.upper()		)
      if row == 1:
            return table[0][col]
      else:
            return table[1][col] if row == 0 else char


if __name__ == "__main__":
     import doctest

     doctest.testmod()  # Fist ensure that all our tests are passing...
     snake_case       :					str        =  input('''Enter key: ''').strip()
     snake_case       :					List[Any]        =  input('''Enter text to encrypt: ''').strip()
     snake_case       :					Tuple        =  encrypt(key, text)

     print(F"""Encrypted: {cipher_text}""")
     print(F"""Decrypted with key: {decrypt(key, cipher_text)}""")









import numpy as np
def        __lowerCamelCase		(				UpperCAmelCase_		:	Optional[Any]		):




      """simple docstring"""





      a							,       a		:Union[str, Any]											= a.shape
      a		:Any											= min(UpperCAmelCase_				,						UpperCAmelCase_		)
      a		:Tuple											= np.eye(UpperCAmelCase_		)
      a		:Any											= a.copy()

      for k in range(t - 1		):
            # select a column of modified matrix A':
            a		:List[str]											= r[k:, [k]]
            # construct first basis vector
            a		:List[str]											= np.zeros_like(UpperCAmelCase_		)
            a		:List[Any]											= 1.0
            # determine scaling factor
            a		:Union[str, Any]											= np.linalg.norm(UpperCAmelCase_		)
            # construct vector v for Householder reflection
            a		:List[str]											= x + np.sign(x[0]		) * alpha * ea
            v /= np.linalg.norm(UpperCAmelCase_		)

            # construct the Householder matrix
            a		:Union[str, Any]											= np.eye(m - k		) - 2.0 * v @ v.T
            # pad with ones and zeros as necessary
            a		:Tuple											= np.block([[np.eye(UpperCAmelCase_		), np.zeros((k, m - k)		)], [np.zeros((m - k, k)		), q_k]]		)

            a		:List[Any]											= q @ q_k.T
            a		:int											= q_k @ r

      return q, r


if __name__ == "__main__":
     import doctest

     doctest.testmod()





