// NOTE: it is recommended to use this even if you don't understand the following code.

#include <fstream>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    // uncomment the two following lines if you want to read/write from files
    // ifstream cin("input.txt");
    // ofstream cout("output.txt");

    int N, M;
    cin >> N >> M;

    vector<int> x(M), y(M), w(M);
    for (int i = 0; i < M; ++i)
        cin >> x[i] >> y[i] >> w[i];

    int L = 0, K = 0;


    // INSERT YOUR CODE HERE


    cout << L << " " << K << endl;

    return 0;
}
