


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




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




				__magic_name__	  = 0
				__magic_name__	  = len(lowerCamelCase_						) - 1
				while left <= right:
								__magic_name__	  = (left + right) // 2
								if left == right:
												if sorted_list[middle] < item:
																__magic_name__	  = middle + 1
												break
								elif sorted_list[middle] < item:
												__magic_name__	  = middle + 1
								else:
												__magic_name__	  = middle - 1
				sorted_list.insert(lowerCamelCase_	,  lowerCamelCase_						)
				return sorted_list




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




				__magic_name__	  = []
				while left and right:
								if left[0][0] < right[0][0]:
												result.append(left.pop(0						)						)
								else:
												result.append(right.pop(0						)						)
				return result + left + right




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




				__magic_name__	  = len(lowerCamelCase_						)
				if length <= 1:
								return list_ad
				__magic_name__	  = length // 2
				return merge(sortlist_ad(list_ad[:middle]						)	,  sortlist_ad(list_ad[middle:]						)						)




def      __snake_case       (       lowerCamelCase_ :				list[int]						):
				'''simple docstring'''




				if len(lowerCamelCase_						) <= 1:
								return collection
				__magic_name__	  = []
				__magic_name__	  = False
				for i in range(0	,  len(lowerCamelCase_						)	,  2						):
								if i == len(lowerCamelCase_						) - 1:
												__magic_name__	  = True
								else:
												if collection[i] < collection[i + 1]:
																two_paired_list.append([collection[i], collection[i + 1]]						)
												else:
																two_paired_list.append([collection[i + 1], collection[i]]						)
				__magic_name__	  = sortlist_ad(lowerCamelCase_						)
				__magic_name__	  = [i[0] for i in sorted_list_ad]
				result.append(sorted_list_ad[-1][1]						)
				if has_last_odd_item:
								__magic_name__	  = collection[-1]
								__magic_name__	  = binary_search_insertion(lowerCamelCase_	,  lowerCamelCase_						)
				__magic_name__	  = False
				for i in range(len(lowerCamelCase_						) - 1						):
								if result[i] == collection[-1] and has_last_odd_item:
												__magic_name__	  = True
								__magic_name__	  = sorted_list_ad[i][1]
								# If last_odd_item is inserted before the item's index,
								# you should forward index one more.
								if is_last_odd_item_inserted_before_this_index:
												__magic_name__	  = result[: i + 2] + binary_search_insertion(result[i + 2 :]	,  lowerCamelCase_						)
								else:
												__magic_name__	  = result[: i + 1] + binary_search_insertion(result[i + 1 :]	,  lowerCamelCase_						)

				return result


if __name__ == "__main__":
						__magic_name__   :   Any  							=input('Enter numbers separated by a comma:\n').strip()
						__magic_name__   :   List[str]  							=[int(item) for item in user_input.split(',')]
						print(merge_insertion_sort(unsorted))







'''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()



