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

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

#define MAXQ 1000000

int       N, Q, i;
int       X[MAXQ], Y[MAXQ];
long long ans[MAXQ];

int main() {
    // uncomment the two following lines if you want to read/write from files
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    assert(2 == scanf("%d%d", &N, &Q));

    for (i = 0; i < Q; ++i)
        assert(2 == scanf("%d%d", &X[i], &Y[i]));



    // INSERT YOUR CODE HERE


    for (i = 0; i < Q; ++i)
        printf("%lld ", ans[i]);
    printf("\n");

    return 0;
}
