#include <iostream>
#include <vector>
using namespace std;

int const infinity = 0x3F3F3F3F;

int main () {
    int n, m;
    cin >> n >> m;
    vector <vector <int> > a (n,
        vector <int> (n, infinity));
    for (int j = 0; j < m; j++) {
        int u, v, w;
        cin >> u >> v >> w;
        u -= 1;
        v -= 1;
        a[u][v] = w;

    }
    return 0;
}
