// 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, Q;
    cin >> N >> Q;

    vector<int> X(Q), Y(Q);
    for (int i = 0; i < Q; ++i)
        cin >> X[i] >> Y[i];

    vector<long long> ans(Q);


    // INSERT YOUR CODE HERE


    for (int i = 0; i < Q; ++i)
        cout << ans[i] << " ";
    cout << endl;

    return 0;
}
