


'''simple docstring'''
def    a__			(   lowerCAmelCase__    ,   lowerCAmelCase__		)       ->      List[str]:
    UpperCAmelCase__     :						int						=							''''''
    for i in table:
        res += inp[i - 1]
    return res





def    a__			(   lowerCAmelCase__		)       ->      str:
    return data[1:] + data[0]





def    a__			(   lowerCAmelCase__    ,   lowerCAmelCase__		)       ->      str:
    UpperCAmelCase__     :						str						=							''''''
    for i in range(len(lowerCAmelCase__		)		):
        if a[i] == b[i]:
            res += "0"
        else:
            res += "1"
    return res





def    a__			(   lowerCAmelCase__    ,   lowerCAmelCase__		)       ->      Any:
    UpperCAmelCase__     :						Tuple						=							int('''0b''' + data[0] + data[-1]    ,   2		)
    UpperCAmelCase__     :						Tuple						=							int('''0b''' + data[1:3]    ,   2		)
    return bin(s[row][col]		)[2:]





def    a__			(   lowerCAmelCase__    ,   lowerCAmelCase__    ,   lowerCAmelCase__    ,   lowerCAmelCase__    ,   lowerCAmelCase__		)       ->      str:
    UpperCAmelCase__     :						Any						=							message[:4]
    UpperCAmelCase__     :						Dict						=							message[4:]
    UpperCAmelCase__     :						int						=							apply_table(lowerCAmelCase__    ,   lowerCAmelCase__		)
    UpperCAmelCase__     :						Optional[Any]						=							xor(lowerCAmelCase__    ,   lowerCAmelCase__		)
    UpperCAmelCase__     :						int						=							apply_sbox(lowerCAmelCase__    ,   temp[:4]		)  # noqa: E741
    UpperCAmelCase__     :						Any						=							apply_sbox(lowerCAmelCase__    ,   temp[4:]		)
    UpperCAmelCase__     :						int						=							'''0''' * (2 - len(lowerCAmelCase__		)) + l  # noqa: E741
    UpperCAmelCase__     :						Tuple						=							'''0''' * (2 - len(lowerCAmelCase__		)) + r
    UpperCAmelCase__     :						Tuple						=							apply_table(l + r    ,   lowerCAmelCase__		)
    UpperCAmelCase__     :						str						=							xor(lowerCAmelCase__    ,   lowerCAmelCase__		)
    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, 1_0, 9]
  UpperCamelCase__          = [3, 5, 2, 7, 4, 1_0, 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)






"""simple docstring"""






from __future__ import annotations







def 	_snake_case     (							lowercase__						):  # This function is recursive
				_lowerCamelCase	:     Optional[Any]       =       len(lowercase__						)
				# If the array contains only one element, we return it (it's the stop condition of
				# recursion)
				if array_length <= 1:
								return array
								# Else
				_lowerCamelCase	:     Optional[Any]       =       array[0]
				_lowerCamelCase	:     Optional[int]       =       False
				_lowerCamelCase	:     List[str]       =       1
				_lowerCamelCase	:     list[int]       =       []
				while not is_found and i < array_length:
								if array[i] < pivot:
												_lowerCamelCase	:     Union[str, Any]       =       True
												_lowerCamelCase	:     str       =       [element for element in array[i:] if element >= array[i]]
												_lowerCamelCase	:     str       =       longest_subsequence(lowercase__						)
												if len(lowercase__						) > len(lowercase__						):
																_lowerCamelCase	:     Any       =       temp_array
								else:
												i += 1

				_lowerCamelCase	:     Optional[Any]       =       [element for element in array[1:] if element >= pivot]
				_lowerCamelCase	:     Dict       =       [pivot, *longest_subsequence(lowercase__						)]
				if len(lowercase__						) > len(lowercase__						):
								return temp_array
				else:
								return longest_subseq


if __name__ == "__main__":
			import doctest

			doctest.testmod()