






def 						__UpperCAmelCase			(     a_							,     a_):
							snake_case_				=							''
							for i in table:
														res += inp[i - 1]
							return res





def 						__UpperCAmelCase			(     a_):
							return data[1:] + data[0]





def 						__UpperCAmelCase			(     a_							,     a_):
							snake_case_				=							''
							for i in range(len(a_)):
														if a[i] == b[i]:
																					res += "0"
														else:
																					res += "1"
							return res





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





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


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

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

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

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

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













class  UpperCamelCase_      :



	'''simple docstring'''




	def __init__(       self       ,			a					)       ->    None:
								snake_case_				=							set_counts
								snake_case_				=							max(a					)
								snake_case_				=							len(a					)
								snake_case_				=							[1] * num_sets
								snake_case_				=							list(range(a					)					)




	def 							_UpperCamelCase			(       self       ,			a       ,			a					)       ->    bool:
								snake_case_				=							self.get_parent(a					)
								snake_case_				=							self.get_parent(a					)

								if src_parent == dst_parent:
															return False

								if self.ranks[dst_parent] >= self.ranks[src_parent]:
															self.set_counts[dst_parent] += self.set_counts[src_parent]
															snake_case_				=							0
															snake_case_				=							dst_parent
															if self.ranks[dst_parent] == self.ranks[src_parent]:
																						self.ranks[dst_parent] += 1
															snake_case_				=							self.set_counts[dst_parent]
								else:
															self.set_counts[src_parent] += self.set_counts[dst_parent]
															snake_case_				=							0
															snake_case_				=							src_parent
															snake_case_				=							self.set_counts[src_parent]

								snake_case_				=							max(self.max_set       ,			a					)
								return True






	def 							_UpperCamelCase			(       self       ,			a					)       ->    int:
								if self.parents[disj_set] == disj_set:
															return disj_set
								snake_case_				=							self.get_parent(self.parents[disj_set]					)
								return self.parents[disj_set]





