


'''simple docstring'''
def      __snake_case       (       lowerCamelCase_ :				int	,  lowerCamelCase_ :				list[tuple[int, int, int]]						):
				'''simple docstring'''




				__magic_name__	  = sorted(lowerCamelCase_	,  key=lambda lowerCamelCase_						: edge[2]						)

				__magic_name__	  = list(range(lowerCamelCase_						)						)

				def find_parent(lowerCamelCase_ :				Tuple						):
								if i != parent[i]:
												__magic_name__	  = find_parent(parent[i]						)
								return parent[i]

				__magic_name__	  = 0
				__magic_name__	  = []

				for edge in edges:
								__magic_name__	  = find_parent(edge[0]						)
								__magic_name__	  = find_parent(edge[1]						)
								if parent_a != parent_b:
												minimum_spanning_tree_cost += edge[2]
												minimum_spanning_tree.append(lowerCamelCase_						)
												__magic_name__	  = parent_b

				return minimum_spanning_tree


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

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

						kruskal(num_nodes, edges)







'''simple docstring'''
import random
import sys

__magic_name__   :   Optional[Any]  							='ABCDEFGHIJKLMNOPQRSTUVWXYZ'




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = input("Enter message: "						)
				__magic_name__	  = "LFWOAYUISVKMNXPBDCRJTQEGHZ"
				__magic_name__	  = input("Encrypt/Decrypt [e/d]: "						)

				check_valid_key(lowerCamelCase_						)

				if resp.lower().startswith("e"						):
								__magic_name__	  = "encrypt"
								__magic_name__	  = encrypt_message(lowerCamelCase_	,  lowerCamelCase_						)
				elif resp.lower().startswith("d"						):
								__magic_name__	  = "decrypt"
								__magic_name__	  = decrypt_message(lowerCamelCase_	,  lowerCamelCase_						)

				print(F'\n{mode.title()}ion: \n{translated}'						)




def      __snake_case       (       lowerCamelCase_ :				str						):
				'''simple docstring'''




				__magic_name__	  = list(lowerCamelCase_						)
				__magic_name__	  = list(lowerCamelCase_						)
				key_list.sort()
				letters_list.sort()

				if key_list != letters_list:
								sys.exit("Error in the key or symbol set."						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				return translate_message(lowerCamelCase_	,  lowerCamelCase_	,  "encrypt"						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				return translate_message(lowerCamelCase_	,  lowerCamelCase_	,  "decrypt"						)




def      __snake_case       (       lowerCamelCase_ :				str	,  lowerCamelCase_ :				str	,  lowerCamelCase_ :				str						):
				'''simple docstring'''




				__magic_name__	  = ""
				__magic_name__	  = LETTERS
				__magic_name__	  = key

				if mode == "decrypt":
								__magic_name__  ,      __magic_name__	  = chars_b, chars_a

				for symbol in message:
								if symbol.upper() in chars_a:
												__magic_name__	  = chars_a.find(symbol.upper()						)
												if symbol.isupper():
																translated += chars_b[sym_index].upper()
												else:
																translated += chars_b[sym_index].lower()
								else:
												translated += symbol

				return translated




def      __snake_case       (       ):
				'''simple docstring'''




				__magic_name__	  = list(lowerCamelCase_						)
				random.shuffle(lowerCamelCase_						)
				return "".join(lowerCamelCase_						)


if __name__ == "__main__":
						main()



