#include <iostream>
#include <vector>
#include <algorithm>

struct Knap
{
    unsigned int a;
    unsigned int b;
};

int main()
{
    unsigned size, pyramids, vertex, sum = 0;
    Knap temp;
    std::cin >> size;
    ++size;
    std::cin >> pyramids;
    std::vector<std::vector<int> > board;
    board.resize(size, std::vector<int>(size, false));
    for (int i = 0; i < pyramids; ++i)
    {
        std::cin >> temp.a;
        std::cin >> temp.b;
        std::cin >> vertex;
        board[temp.a][temp.b] = vertex + 1;
    }
    return 0;
}
