


def 	A (		A__		,		A__			):
     UpperCAmelCase    :					Dict			=      sorted(lowerCamelCase_		,		key=lambda A__			: edge[2]			)

     UpperCAmelCase    :					List[str]			=      list(range(lowerCamelCase_			)			)

     def find_parent(A__			):
          if i != parent[i]:
               UpperCAmelCase    :					int			=      find_parent(parent[i]			)
          return parent[i]

     UpperCAmelCase    :					List[str]			=      0
     UpperCAmelCase    :					Union[str, Any]			=      []

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

     return minimum_spanning_tree


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

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

      kruskal(num_nodes, edges)




'''simple docstring'''


import io
import json
import subprocess


snake_case__	:     Any      =    [
    ['''en''', '''ru'''],
    ['''ru''', '''en'''],
    ['''en''', '''de'''],
    ['''de''', '''en'''],
]

snake_case__	:     Tuple      =    8


def    _lowerCamelCase       ( lowerCamelCase_   :				Tuple      ,	lowerCamelCase_   :				Union[str, Any]  ):



     """simple docstring"""





     UpperCAmelCase_				:  List[Any]  = {}
     for src, tgt in pairs:
          UpperCAmelCase_				:  str  = F'''{src}-{tgt}'''
          UpperCAmelCase_				:  List[str]  = F'''sacrebleu -t wmt19 -l {pair} --echo src'''.split()
          UpperCAmelCase_				:  Any  = subprocess.run(lowerCamelCase_      ,	stdout=subprocess.PIPE  ).stdout.decode('utf-8'  ).splitlines()
          UpperCAmelCase_				:  Any  = F'''sacrebleu -t wmt19 -l {pair} --echo ref'''.split()
          UpperCAmelCase_				:  List[str]  = subprocess.run(lowerCamelCase_      ,	stdout=subprocess.PIPE  ).stdout.decode('utf-8'  ).splitlines()
          UpperCAmelCase_				:  str  = {'src': src_lines[:n_objs], 'tgt': tgt_lines[:n_objs]}
     return text


snake_case__	:     Union[str, Any]      =    get_all_data(pairs, n_objs)
snake_case__	:     Dict      =    '''./fsmt_val_data.json'''
with io.open(filename, '''w''', encoding='''utf-8''') as f:
 snake_case__	:     List[str]      =    json.dump(text, f, indent=2, ensure_ascii=False)






