






def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase      )			->     List[Any]:
     UpperCamelCase__      :       Optional[int]	    =  ""
     for i in table:
          res += inp[i - 1]
     return res







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase      )			->     Optional[Any]:
     return data[1:] + data[0]







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase      )			->     List[str]:
     UpperCamelCase__      :       Dict	    =  ""
     for i in range(len(__lowerCAmelCase      )      ):
          if a[i] == b[i]:
               res += "0"
          else:
               res += "1"
     return res







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase      )			->     Dict:
     UpperCamelCase__      :       List[str]	    =  int("0b" + data[0] + data[-1] ,   2      )
     UpperCamelCase__      :       Dict	    =  int("0b" + data[1:3] ,   2      )
     return bin(s[row][col]      )[2:]







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )			->     Any:
     UpperCamelCase__      :       Union[str, Any]	    =  message[:4]
     UpperCamelCase__      :       Tuple	    =  message[4:]
     UpperCamelCase__      :       List[Any]	    =  apply_table(__lowerCAmelCase ,   __lowerCAmelCase      )
     UpperCamelCase__      :       Dict	    =  xor(__lowerCAmelCase ,   __lowerCAmelCase      )
     UpperCamelCase__      :       str	    =  apply_sbox(__lowerCAmelCase ,   temp[:4]      )  # noqa: E741
     UpperCamelCase__      :       Tuple	    =  apply_sbox(__lowerCAmelCase ,   temp[4:]      )
     UpperCamelCase__      :       str	    =  "0" * (2 - len(__lowerCAmelCase      )) + l  # noqa: E741
     UpperCamelCase__      :       Dict	    =  "0" * (2 - len(__lowerCAmelCase      )) + r
     UpperCamelCase__      :       Any	    =  apply_table(l + r ,   __lowerCAmelCase      )
     UpperCamelCase__      :       List[str]	    =  xor(__lowerCAmelCase ,   __lowerCAmelCase      )
     return temp + right


if __name__ == "__main__":
 lowerCamelCase     :							int    =input('''Enter 10 bit key: ''')
 lowerCamelCase     :							Dict    =input('''Enter 8 bit message: ''')

 lowerCamelCase     :							Union[str, Any]    =[6, 3, 7, 4, 8, 5, 10, 9]
 lowerCamelCase     :							Dict    =[3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
 lowerCamelCase     :							Optional[int]    =[2, 4, 3, 1]
 lowerCamelCase     :							List[Any]    =[2, 6, 3, 1, 4, 8, 5, 7]
 lowerCamelCase     :							List[Any]    =[4, 1, 3, 5, 7, 2, 8, 6]
 lowerCamelCase     :							Union[str, Any]    =[4, 1, 2, 3, 2, 3, 4, 1]
 lowerCamelCase     :							Any    =[[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
 lowerCamelCase     :							Union[str, Any]    =[[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

 # key generation
 lowerCamelCase     :							Union[str, Any]    =apply_table(key, paa_table)
 lowerCamelCase     :							int    =temp[:5]
 lowerCamelCase     :							List[Any]    =temp[5:]
 lowerCamelCase     :							Optional[int]    =left_shift(left)
 lowerCamelCase     :							int    =left_shift(right)
 lowerCamelCase     :							List[str]    =apply_table(left + right, pa_table)
 lowerCamelCase     :							Tuple    =left_shift(left)
 lowerCamelCase     :							int    =left_shift(right)
 lowerCamelCase     :							List[str]    =left_shift(left)
 lowerCamelCase     :							Optional[int]    =left_shift(right)
 lowerCamelCase     :							int    =apply_table(left + right, pa_table)

 # encryption
 lowerCamelCase     :							Tuple    =apply_table(message, IP)
 lowerCamelCase     :							List[str]    =function(expansion, sa, sa, keya, temp)
 lowerCamelCase     :							Optional[int]    =temp[4:] + temp[:4]
 lowerCamelCase     :							Optional[int]    =function(expansion, sa, sa, keya, temp)
 lowerCamelCase     :							str    =apply_table(temp, IP_inv)
 print('''Cipher text is:''', CT)

 # decryption
 lowerCamelCase     :							int    =apply_table(CT, IP)
 lowerCamelCase     :							Union[str, Any]    =function(expansion, sa, sa, keya, temp)
 lowerCamelCase     :							str    =temp[4:] + temp[:4]
 lowerCamelCase     :							List[str]    =function(expansion, sa, sa, keya, temp)
 lowerCamelCase     :							Dict    =apply_table(temp, IP_inv)
 print('''Plain text after decypting is:''', PT)







from __future__ import annotations







def 		SCREAMING_SNAKE_CASE							( __lowerCAmelCase ,   __lowerCAmelCase = None ,   __lowerCAmelCase = None      )			->     None:
     if start is None:
          UpperCamelCase__      :       Union[str, Any]	    =  0

     if end is None:
          UpperCamelCase__      :       List[Any]	    =  len(__lowerCAmelCase      ) - 1

     if start >= end:
          return

     UpperCamelCase__      :       Union[str, Any]	    =  (start + end) // 2

     slowsort(__lowerCAmelCase ,   __lowerCAmelCase ,   __lowerCAmelCase      )
     slowsort(__lowerCAmelCase ,   mid + 1 ,   __lowerCAmelCase      )

     if sequence[end] < sequence[mid]:
          UpperCamelCase__    ,					UpperCamelCase__      :       Optional[int]	    =  sequence[mid], sequence[end]

     slowsort(__lowerCAmelCase ,   __lowerCAmelCase ,   end - 1      )


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

 testmod()