'''simple docstring'''

def 			__UpperCamelCase       (   UpperCAmelCase     ):
 lowercase__				:    int  =					''''''
 for ch in key:
  if ch == " " or ch not in key_no_dups and ch.isalpha():
   key_no_dups += ch
 return key_no_dups
def 			__UpperCamelCase       (   UpperCAmelCase     ):
 lowercase__				:    Tuple  =					[chr(i + 65     ) for i in range(26     )]
 # Remove duplicate characters from key
 lowercase__				:    Any  =					remove_duplicates(key.upper()     )
 lowercase__				:    Tuple  =					len(UpperCAmelCase     )
 # First fill cipher with key characters
 lowercase__				:    str  =					{alphabet[i]: char for i, char in enumerate(UpperCAmelCase     )}
 # Then map remaining characters in alphabet to
 # the alphabet from the beginning
 for i in range(len(UpperCAmelCase     )		,     26     ):
  lowercase__				:    Any  =					alphabet[i - offset]
  # Ensure we are not mapping letters to letters previously mapped
  while char in key:
   offset -= 1
   lowercase__				:    Union[str, Any]  =					alphabet[i - offset]
  lowercase__				:    Optional[Any]  =					char
 return cipher_alphabet
def 			__UpperCamelCase       (   UpperCAmelCase		,     UpperCAmelCase     ):
 return "".join(cipher_map.get(UpperCAmelCase		,     UpperCAmelCase     ) for ch in message.upper()     )
def 			__UpperCamelCase       (   UpperCAmelCase		,     UpperCAmelCase     ):
 lowercase__				:    Any  =					{v: k for k, v in cipher_map.items()}
 return "".join(rev_cipher_map.get(UpperCAmelCase		,     UpperCAmelCase     ) for ch in message.upper()     )
def 			__UpperCamelCase       (   ):
 lowercase__				:    Dict  =					input('''Enter message to encode or decode: '''     ).strip()
 lowercase__				:    List[str]  =					input('''Enter keyword: '''     ).strip()
 lowercase__				:    Union[str, Any]  =					input('''Encipher or decipher? E/D:'''     ).strip()[0].lower()
 try:
  lowercase__				:    List[Any]  =					{'''e''': encipher, '''d''': decipher}[option]
 except KeyError:
  raise KeyError('''invalid input option'''     )
 lowercase__				:    Tuple  =					create_cipher_map(UpperCAmelCase     )
 print(func(UpperCAmelCase		,     UpperCAmelCase     )     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()


'''simple docstring'''

def 			__UpperCamelCase       (   UpperCAmelCase     ):
 lowercase__ ,							lowercase__				:    Optional[int]  =					[], []
 while len(UpperCAmelCase     ) > 1:
  lowercase__ ,							lowercase__				:    List[str]  =					min(UpperCAmelCase     ), max(UpperCAmelCase     )
  start.append(UpperCAmelCase     )
  end.append(UpperCAmelCase     )
  collection.remove(UpperCAmelCase     )
  collection.remove(UpperCAmelCase     )
 end.reverse()
 return start + collection + end


if __name__ == "__main__":
  __a: Optional[int]          =   input("""Enter numbers separated by a comma:\n""").strip()
  __a: Tuple          =   [int(item) for item in user_input.split(""",""")]
  print(*merge_sort(unsorted), sep=""",""")

