





'''simple docstring'''



from __future__ import annotations




def       _lowerCAmelCase  ( lowerCamelCase_	:     str ):
			__lowercase   =							42
			__lowercase   =							list(lowerCamelCase_ )
			__lowercase  ,						__lowercase   =							_vector[:-1], int(_vector[-1] )
			__lowercase   =							[int(lowerCamelCase_ ) for digit in __vector]

			vector.reverse()
			for i, digit in enumerate(lowerCamelCase_ ):
						if i & 1 == 0:
									__lowercase   =							digit * 2
									if doubled > 9:
												doubled -= 9
									check_digit += doubled
						else:
									check_digit += digit

			return check_digit % 1_0 == 0


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	assert is_luhn('''79927398713''')
	assert not is_luhn('''79927398714''')












"""simple docstring"""




UpperCamelCase_           ={
    """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        a_				(							_lowercase   ):
						return [alphabet[char] for char in key.upper()]





def        a_				(							_lowercase       ,						_lowercase   ):
						_UpperCamelCase			:					Optional[Any]     =    ''''''
						_UpperCamelCase			:					Tuple     =    0
						_UpperCamelCase			:					Optional[int]     =    generate_table(_lowercase   )
						for char in words.upper():
												cipher += get_opponent(table[count]       ,						_lowercase   )
												_UpperCamelCase			:					Optional[int]     =    (count + 1) % len(_lowercase   )
						return cipher





def        a_				(							_lowercase       ,						_lowercase   ):
						return encrypt(_lowercase       ,						_lowercase   )





def        a_				(							_lowercase       ,						_lowercase   ):
						_UpperCamelCase			:					Dict     =    0 if char in table[0] else 1
						_UpperCamelCase			:					str     =    table[row].index(_lowercase   )
						return row, col





def        a_				(							_lowercase       ,						_lowercase   ):
						_UpperCamelCase   ,							_UpperCamelCase			:					Union[str, Any]     =    get_position(_lowercase       ,						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...
						UpperCamelCase_           =input("""Enter key: """).strip()
						UpperCamelCase_           =input("""Enter text to encrypt: """).strip()
						UpperCamelCase_           =encrypt(key, text)

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



