


'''simple docstring'''
from __future__ import annotations

import sys




def      __snake_case       (       lowerCamelCase_ :				int	,  lowerCamelCase_ :				int						):
				'''simple docstring'''




				if abs(lowerCamelCase_						) == 1:
								return a, 0
				elif abs(lowerCamelCase_						) == 1:
								return 0, b

				__magic_name__  ,      __magic_name__	  = a, b
				__magic_name__  ,      __magic_name__	  = 1, 0
				__magic_name__  ,      __magic_name__	  = 0, 1

				while remainder != 0:
								__magic_name__	  = old_remainder // remainder
								__magic_name__  ,      __magic_name__	  = remainder, old_remainder - quotient * remainder
								__magic_name__  ,      __magic_name__	  = coeff_a, old_coeff_a - quotient * coeff_a
								__magic_name__  ,      __magic_name__	  = coeff_b, old_coeff_b - quotient * coeff_b

				# sign correction for negative numbers
				if a < 0:
								__magic_name__	  = -old_coeff_a
				if b < 0:
								__magic_name__	  = -old_coeff_b

				return old_coeff_a, old_coeff_b




def      __snake_case       (       ):
				'''simple docstring'''




				if len(sys.argv						) < 3:
								print("2 integer arguments required"						)
								return 1
				__magic_name__	  = int(sys.argv[1]						)
				__magic_name__	  = int(sys.argv[2]						)
				print(extended_euclidean_algorithm(lowerCamelCase_	,  lowerCamelCase_						)						)
				return 0


if __name__ == "__main__":
						raise SystemExit(main())







'''simple docstring'''
import random
import sys

__magic_name__   :   Optional[Any]  							='ABCDEFGHIJKLMNOPQRSTUVWXYZ'




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = input("Enter message: "						)
				__magic_name__	  = "LFWOAYUISVKMNXPBDCRJTQEGHZ"
				__magic_name__	  = input("Encrypt/Decrypt [e/d]: "						)

				check_valid_key(lowerCamelCase_						)

				if resp.lower().startswith("e"						):
								__magic_name__	  = "encrypt"
								__magic_name__	  = encrypt_message(lowerCamelCase_	,  lowerCamelCase_						)
				elif resp.lower().startswith("d"						):
								__magic_name__	  = "decrypt"
								__magic_name__	  = decrypt_message(lowerCamelCase_	,  lowerCamelCase_						)

				print(F'\n{mode.title()}ion: \n{translated}'						)




def      __snake_case       (       lowerCamelCase_ :				str						):
				'''simple docstring'''




				__magic_name__	  = list(lowerCamelCase_						)
				__magic_name__	  = list(lowerCamelCase_						)
				key_list.sort()
				letters_list.sort()

				if key_list != letters_list:
								sys.exit("Error in the key or symbol set."						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				return translate_message(lowerCamelCase_	,  lowerCamelCase_	,  "encrypt"						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				return translate_message(lowerCamelCase_	,  lowerCamelCase_	,  "decrypt"						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				__magic_name__	  = ""
				__magic_name__	  = LETTERS
				__magic_name__	  = key

				if mode == "decrypt":
								__magic_name__  ,      __magic_name__	  = chars_b, chars_a

				for symbol in message:
								if symbol.upper() in chars_a:
												__magic_name__	  = chars_a.find(symbol.upper()						)
												if symbol.isupper():
																translated += chars_b[sym_index].upper()
												else:
																translated += chars_b[sym_index].lower()
								else:
												translated += symbol

				return translated




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = list(lowerCamelCase_						)
				random.shuffle(lowerCamelCase_						)
				return "".join(lowerCamelCase_						)


if __name__ == "__main__":
						main()



