





def 						lowerCamelCase__     (     UpperCamelCase__			:       Tuple       ,    UpperCamelCase__			:       Tuple						)			-> Union[str, Any]:



					'''simple docstring'''




					_snake_case									=				''
					for i in table:
										res += inp[i - 1]
					return res





def 						lowerCamelCase__     (     UpperCamelCase__			:       Optional[int]						)			-> int:



					'''simple docstring'''




					return data[1:] + data[0]





def 						lowerCamelCase__     (     UpperCamelCase__			:       Union[str, Any]       ,    UpperCamelCase__			:       Optional[Any]						)			-> Optional[int]:



					'''simple docstring'''




					_snake_case									=				''
					for i in range(len(UpperCamelCase__						)						):
										if a[i] == b[i]:
															res += "0"
										else:
															res += "1"
					return res





def 						lowerCamelCase__     (     UpperCamelCase__			:       Union[str, Any]       ,    UpperCamelCase__			:       List[Any]						)			-> str:



					'''simple docstring'''




					_snake_case									=				int('0b' + data[0] + data[-1]       ,    2						)
					_snake_case									=				int('0b' + data[1:3]       ,    2						)
					return bin(s[row][col]						)[2:]





def 						lowerCamelCase__     (     UpperCamelCase__			:       int       ,    UpperCamelCase__			:       Dict       ,    UpperCamelCase__			:       List[Any]       ,    UpperCamelCase__			:       Dict       ,    UpperCamelCase__			:       List[Any]						)			-> List[Any]:



					'''simple docstring'''




					_snake_case									=				message[:4]
					_snake_case									=				message[4:]
					_snake_case									=				apply_table(UpperCamelCase__       ,    UpperCamelCase__						)
					_snake_case									=				xor(UpperCamelCase__       ,    UpperCamelCase__						)
					_snake_case									=				apply_sbox(UpperCamelCase__       ,    temp[:4]						)  # noqa: E741
					_snake_case									=				apply_sbox(UpperCamelCase__       ,    temp[4:]						)
					_snake_case									=				'0' * (2 - len(UpperCamelCase__						)) + l  # noqa: E741
					_snake_case									=				'0' * (2 - len(UpperCamelCase__						)) + r
					_snake_case									=				apply_table(l + r       ,    UpperCamelCase__						)
					_snake_case									=				xor(UpperCamelCase__       ,    UpperCamelCase__						)
					return temp + right


if __name__ == "__main__":
					UpperCAmelCase_      							=     input("""Enter 10 bit key: """)
					UpperCAmelCase_      							=     input("""Enter 8 bit message: """)

					UpperCAmelCase_      							=     [6, 3, 7, 4, 8, 5, 10, 9]
					UpperCAmelCase_      							=     [3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
					UpperCAmelCase_      							=     [2, 4, 3, 1]
					UpperCAmelCase_      							=     [2, 6, 3, 1, 4, 8, 5, 7]
					UpperCAmelCase_      							=     [4, 1, 3, 5, 7, 2, 8, 6]
					UpperCAmelCase_      							=     [4, 1, 2, 3, 2, 3, 4, 1]
					UpperCAmelCase_      							=     [[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
					UpperCAmelCase_      							=     [[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

					# key generation
					UpperCAmelCase_      							=     apply_table(key, paa_table)
					UpperCAmelCase_      							=     temp[:5]
					UpperCAmelCase_      							=     temp[5:]
					UpperCAmelCase_      							=     left_shift(left)
					UpperCAmelCase_      							=     left_shift(right)
					UpperCAmelCase_      							=     apply_table(left + right, pa_table)
					UpperCAmelCase_      							=     left_shift(left)
					UpperCAmelCase_      							=     left_shift(right)
					UpperCAmelCase_      							=     left_shift(left)
					UpperCAmelCase_      							=     left_shift(right)
					UpperCAmelCase_      							=     apply_table(left + right, pa_table)

					# encryption
					UpperCAmelCase_      							=     apply_table(message, IP)
					UpperCAmelCase_      							=     function(expansion, sa, sa, keya, temp)
					UpperCAmelCase_      							=     temp[4:] + temp[:4]
					UpperCAmelCase_      							=     function(expansion, sa, sa, keya, temp)
					UpperCAmelCase_      							=     apply_table(temp, IP_inv)
					print("""Cipher text is:""", CT)

					# decryption
					UpperCAmelCase_      							=     apply_table(CT, IP)
					UpperCAmelCase_      							=     function(expansion, sa, sa, keya, temp)
					UpperCAmelCase_      							=     temp[4:] + temp[:4]
					UpperCAmelCase_      							=     function(expansion, sa, sa, keya, temp)
					UpperCAmelCase_      							=     apply_table(temp, IP_inv)
					print("""Plain text after decypting is:""", PT)










def 						lowerCamelCase__     (     UpperCamelCase__			:       list						)			-> list:



					'''simple docstring'''




					_snake_case									=				len(UpperCamelCase__						)
					for i in range(1       ,    UpperCamelCase__						):
										_snake_case									=				collection[i]
										_snake_case									=				0
										_snake_case									=				i - 1

										while low <= high:
															_snake_case									=				(low + high) // 2
															if val < collection[mid]:
																				_snake_case									=				mid - 1
															else:
																				_snake_case									=				mid + 1
										for j in range(UpperCamelCase__       ,    UpperCamelCase__       ,    -1						):
															_snake_case									=				collection[j - 1]
										_snake_case									=				val
					return collection


if __name__ == "__main__":
					UpperCAmelCase_      							=     input("""Enter numbers separated by a comma:\n""").strip()
					UpperCAmelCase_      							=     [int(item) for item in user_input.split(""",""")]
					print(binary_insertion_sort(unsorted))



