


'''simple docstring'''




_lowerCAmelCase	:		List[str]		  =						{
    'A': ('ABCDEFGHIJKLM', 'NOPQRSTUVWXYZ'),
    'B': ('ABCDEFGHIJKLM', 'NOPQRSTUVWXYZ'),
    'C': ('ABCDEFGHIJKLM', 'ZNOPQRSTUVWXY'),
    'D': ('ABCDEFGHIJKLM', 'ZNOPQRSTUVWXY'),
    'E': ('ABCDEFGHIJKLM', 'YZNOPQRSTUVWX'),
    'F': ('ABCDEFGHIJKLM', 'YZNOPQRSTUVWX'),
    'G': ('ABCDEFGHIJKLM', 'XYZNOPQRSTUVW'),
    'H': ('ABCDEFGHIJKLM', 'XYZNOPQRSTUVW'),
    'I': ('ABCDEFGHIJKLM', 'WXYZNOPQRSTUV'),
    'J': ('ABCDEFGHIJKLM', 'WXYZNOPQRSTUV'),
    'K': ('ABCDEFGHIJKLM', 'VWXYZNOPQRSTU'),
    'L': ('ABCDEFGHIJKLM', 'VWXYZNOPQRSTU'),
    'M': ('ABCDEFGHIJKLM', 'UVWXYZNOPQRST'),
    'N': ('ABCDEFGHIJKLM', 'UVWXYZNOPQRST'),
    'O': ('ABCDEFGHIJKLM', 'TUVWXYZNOPQRS'),
    'P': ('ABCDEFGHIJKLM', 'TUVWXYZNOPQRS'),
    'Q': ('ABCDEFGHIJKLM', 'STUVWXYZNOPQR'),
    'R': ('ABCDEFGHIJKLM', 'STUVWXYZNOPQR'),
    'S': ('ABCDEFGHIJKLM', 'RSTUVWXYZNOPQ'),
    'T': ('ABCDEFGHIJKLM', 'RSTUVWXYZNOPQ'),
    'U': ('ABCDEFGHIJKLM', 'QRSTUVWXYZNOP'),
    'V': ('ABCDEFGHIJKLM', 'QRSTUVWXYZNOP'),
    'W': ('ABCDEFGHIJKLM', 'PQRSTUVWXYZNO'),
    'X': ('ABCDEFGHIJKLM', 'PQRSTUVWXYZNO'),
    'Y': ('ABCDEFGHIJKLM', 'OPQRSTUVWXYZN'),
    'Z': ('ABCDEFGHIJKLM', 'OPQRSTUVWXYZN'),
}

def       __UpperCamelCase     (     _A     :					Tuple					)     ->   list[tuple[str, str]]:




	"""simple docstring"""





	return [alphabet[char] for char in key.upper()]

def       __UpperCamelCase     (     _A     :					Tuple       , _A     :					List[Any]					)     ->   str:




	"""simple docstring"""





	lowerCAmelCase       :     List[str]   				=			""
	lowerCAmelCase       :     List[str]   				=			0
	lowerCAmelCase       :     Optional[Any]   				=			generate_table(A_					)
	for char in words.upper():
		cipher += get_opponent(table[count]       , A_					)
		lowerCAmelCase       :     Any   				=			(count + 1) % len(A_					)
	return cipher

def       __UpperCamelCase     (     _A     :					Union[str, Any]       , _A     :					int					)     ->   str:




	"""simple docstring"""





	return encrypt(A_       , A_					)

def       __UpperCamelCase     (     _A     :					List[str]       , _A     :					Any					)     ->   tuple[int, int]:




	"""simple docstring"""





	lowerCAmelCase       :     Optional[int]   				=			0 if char in table[0] else 1
	lowerCAmelCase       :     Tuple   				=			table[row].index(A_					)
	return row, col

def       __UpperCamelCase     (     _A     :					Tuple       , _A     :					str					)     ->   str:




	"""simple docstring"""





	lowerCAmelCase       :     Dict   				=			get_position(A_       , char.upper()					)
	if row == 1:
		return table[0][col]
	else:
		return table[1][col] if row == 0 else char


if __name__ == "__main__":
				import doctest

				doctest.testmod()  # Fist ensure that all our tests are passing...
				_lowerCAmelCase	:		Optional[Any]		  =						input('Enter key: ').strip()
				_lowerCAmelCase	:		List[Any]		  =						input('Enter text to encrypt: ').strip()
				_lowerCAmelCase	:		Optional[int]		  =						encrypt(key, text)

				print(f"""Encrypted: {cipher_text}""")
				print(f"""Decrypted with key: {decrypt(key, cipher_text)}""")




"""simple docstring"""







def 	lowercase     (							A_    ,  A_			)-> list[tuple[int, int, int]]:
  '''simple docstring'''







  a		:						Union[str, Any] 				=     sorted(A_    ,  key=lambda A_			: edge[2]			)

  a		:						List[Any] 				=     list(range(A_			)			)

  def find_parent(A_			):
    if i != parent[i]:
      a		:						Dict 				=     find_parent(parent[i]			)
    return parent[i]

  a		:						Optional[Any] 				=     0
  a		:						Optional[int] 				=     []

  for edge in edges:
    a		:						List[str] 				=     find_parent(edge[0]			)
    a		:						int 				=     find_parent(edge[1]			)
    if parent_a != parent_b:
      minimum_spanning_tree_cost += edge[2]
      minimum_spanning_tree.append(A_			)
      a		:						Tuple 				=     parent_b

  return minimum_spanning_tree


if __name__ == "__main__":  # pragma: no cover
 __lowercase   ,				__lowercase          = list(map(int, input().strip().split()))
 __lowercase          = []

 for _ in range(num_edges):
  __lowercase   ,				__lowercase   ,				__lowercase          = (int(x) for x in input().strip().split())
  edges.append((nodea, nodea, cost))

 kruskal(num_nodes, edges)






