#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;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nIGludAojZGVmaW5lIGVuZGwgIlxuIgoKc3RydWN0IEVkZ2UKewogICAgbGwgbm9kZSA9IC0xOwogICAgbGwgY29zdCA9IExMT05HX01BWDsKICAgIEVkZ2UobGwgdSwgbGwgdiwgbGwgY29zdCkgOiB1KHUpLCB2KHYpLCBjb3N0KGNvc3QpIHt9CiAgICBib29sIG9wZXJhdG9yPChjb25zdCBFZGdlICZlKSBjb25zdCB7IHJldHVybiBjb3N0IDwgZS5jb3N0OyB9Cn07CgppbnQgbWFpbigpCnsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwogICAgY2luLnRpZShudWxscHRyKTsKICAgIGludCB0ID0gMTsKICAgIGxsIE4sIE0sIEE7CiAgICAvLyBjaW4gPj4gdDsKICAgIHdoaWxlICh0LS0pCiAgICB7CiAgICAgICAgY2luID4+IE4gPj4gTTsKICAgICAgICB2ZWN0b3I8RWRnZT4gZ3JhcGhbTiArIDFdOwogICAgICAgIAogICAgICAgIGZvciAoaW50IGl7fTsgaSA8IE07IGkrKykKICAgICAgICB7CiAgICAgICAgICAgIGxsIHUsIHYsIGM7CiAgICAgICAgICAgIGNpbiA+PiB1ID4+IHYgPj4gYzsKICAgICAgICAgICAgZ3JhcGhbdV0ucHVzaF9iYWNrKHt2LCBjfSk7CiAgICAgICAgICAgIGdyYXBoW3ZdLnB1c2hfYmFjayh7dSwgY30pOwogICAgICAgICAgICAKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gMDsKfQ==