"""simple docstring"""


def   __UpperCAmelCase     (	_snake_case		:       list       ):

   for insert_index, insert_value in enumerate(collection[1:]       ):
      _lowercase							     =       insert_index
      while insert_index >= 0 and insert_value < collection[insert_index]:
         _lowercase							     =       collection[insert_index]
         insert_index -= 1
      if insert_index != temp_index:
         _lowercase							     =       insert_value
   return collection


if __name__ == "__main__":
  from doctest import testmod

  testmod()

  __UpperCamelCase       :    int         =		input("Enter numbers separated by a comma:\n").strip()
  __UpperCamelCase       :    Optional[Any]         =		[int(item) for item in user_input.split(",")]
  print(f'''{insertion_sort(unsorted) = }''')
"""simple docstring"""


from typing import Literal

__UpperCamelCase       :    int         =		"ABCDEFGHIJKLMNOPQRSTUVWXYZ"


def   __UpperCAmelCase     (	_snake_case		:       str,				_snake_case		:       str,				_snake_case		:       Literal["encrypt", "decrypt"]       ):
   _lowercase							     =       LETTERS if mode == "decrypt" else key
   _lowercase							     =       key if mode == "decrypt" else LETTERS
   _lowercase							     =       ""
   # loop through each symbol in the message
   for symbol in message:
      if symbol.upper() in chars_a:
         # encrypt/decrypt the symbol
         _lowercase							     =       chars_a.find(symbol.upper()       )
         if symbol.isupper():
            translated += chars_b[sym_index].upper()
         else:
            translated += chars_b[sym_index].lower()
      else:
         # symbol is not in LETTERS, just add it
         translated += symbol
   return translated


def   __UpperCAmelCase     (	_snake_case		:       str,				_snake_case		:       str       ):
   return translate_message(_snake_case,				_snake_case,				"encrypt"       )


def   __UpperCAmelCase     (	_snake_case		:       str,				_snake_case		:       str       ):
   return translate_message(_snake_case,				_snake_case,				"decrypt"       )


def   __UpperCAmelCase     (	):
   _lowercase							     =       "Hello World"
   _lowercase							     =       "QWERTYUIOPASDFGHJKLZXCVBNM"
   _lowercase							     =       "decrypt"  # set to 'encrypt' or 'decrypt'

   if mode == "encrypt":
      _lowercase							     =       encrypt_message(_snake_case,				_snake_case       )
   elif mode == "decrypt":
      _lowercase							     =       decrypt_message(_snake_case,				_snake_case       )
   print(f"""Using the key {key}, the {mode}ed message is: {translated}"""       )


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()