#include <iostream>
#include <vector>

using namespace std;

struct Taxi;

std::vector<int> incrocia(int N, int M, std::vector<Taxi> V, std::vector<Taxi> H) {
    return vector<int>(N, 42);
}

// GRADER DI ESEMPIO, NON MODIFICARE

#ifndef EVAL

struct Taxi {
    int t0, x0, y0, x1, y1;
    Taxi() {}
};

int main() {
    int N;
    int M;
    cin >> N;
    cin >> M;

    std::vector<Taxi> V(M), H(M);

    for (Taxi &taxi: V) {
        cin >> taxi.t0;
        cin >> taxi.x0;
        cin >> taxi.y0;
        cin >> taxi.x1;
        cin >> taxi.y1;
    }

    for (Taxi &taxi: H) {
        cin >> taxi.t0;
        cin >> taxi.x0;
        cin >> taxi.y0;
        cin >> taxi.x1;
        cin >> taxi.y1;
    }

    vector<int> ans = incrocia(N, M, V, H);

    for (int x: ans) {
        cout << x << '\n';
    }
}
#endif
