


'''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__							,    __magic_name__   :   Tuple  							=list(map(int, input().strip().split()))
						__magic_name__   :   Any  							=[]

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

						kruskal(num_nodes, edges)







'''simple docstring'''
import os
import sys
import time

from . import transposition_cipher as trans_cipher




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




				__magic_name__	  = "Prehistoric Men.txt"
				__magic_name__	  = "Output.txt"
				__magic_name__	  = int(input("Enter key: "						)						)
				__magic_name__	  = input("Encrypt/Decrypt [e/d]: "						)

				if not os.path.exists(lowerCamelCase_						):
								print(F'File {input_file} does not exist. Quitting...'						)
								sys.exit()
				if os.path.exists(lowerCamelCase_						):
								print(F'Overwrite {output_file}? [y/n]'						)
								__magic_name__	  = input("> "						)
								if not response.lower().startswith("y"						):
												sys.exit()

				__magic_name__	  = time.time()
				if mode.lower().startswith("e"						):
								with open(lowerCamelCase_						) as f:
												__magic_name__	  = f.read()
								__magic_name__	  = trans_cipher.encrypt_message(lowerCamelCase_	,  lowerCamelCase_						)
				elif mode.lower().startswith("d"						):
								with open(lowerCamelCase_						) as f:
												__magic_name__	  = f.read()
								__magic_name__	  = trans_cipher.decrypt_message(lowerCamelCase_	,  lowerCamelCase_						)

				with open(lowerCamelCase_	,  "w"						) as output_obj:
								output_obj.write(lowerCamelCase_						)

				__magic_name__	  = round(time.time() - start_time	,  2						)
				print(("Done (", total_time, "seconds )")						)


if __name__ == "__main__":
						main()



