#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"

struct Edge
{
    ll node = -1;
    ll cost = LLONG_MAX;
    Edge(ll u, ll v, ll cost) : u(u), v(v), cost(cost) {}
    bool operator<(const Edge &e) const { return cost < e.cost; }
};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    ll N, M, A;
    // cin >> t;
    while (t--)
    {
        cin >> N >> M;
        vector<Edge> graph[N + 1];
        
        for (int i{}; i < M; i++)
        {
            ll u, v, c;
            cin >> u >> v >> c;
            graph[u].push_back({v, c});
            graph[v].push_back({u, c});
            
        }
    }
    return 0;
}