
def 						__magic_name__			(   __a      :	List[Any]	,		__a      :	int						):



     '''simple docstring'''




     UpperCamelCase__				=    """"""
     for i in table:
          res += inp[i - 1]
     return res






def 						__magic_name__			(   __a      :	str						):



     '''simple docstring'''




     return data[1:] + data[0]






def 						__magic_name__			(   __a      :	Optional[Any]	,		__a      :	List[Any]						):



     '''simple docstring'''




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






def 						__magic_name__			(   __a      :	Optional[Any]	,		__a      :	List[Any]						):



     '''simple docstring'''




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






def 						__magic_name__			(   __a      :	Union[str, Any]	,		__a      :	int	,		__a      :	Optional[int]	,		__a      :	Any	,		__a      :	int						):



     '''simple docstring'''




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


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

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

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

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

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







from __future__ import annotations






def 						__magic_name__			(   __a      :	list[list[int]]						):



     '''simple docstring'''




     for i in range(1	,		len(matrix[0]						)						):
          matrix[0][i] += matrix[0][i - 1]

     # preprocessing the first column
     for i in range(1	,		len(__a						)						):
          matrix[i][0] += matrix[i - 1][0]

     # updating the path cost for current position
     for i in range(1	,		len(__a						)						):
          for j in range(1	,		len(matrix[0]						)						):
               matrix[i][j] += min(matrix[i - 1][j]	,		matrix[i][j - 1]						)

     return matrix[-1][-1]


if __name__ == "__main__":
    import doctest

    doctest.testmod()





