#include <bits/stdc++.h>
#include "testlib.h"

using namespace std;

int main(int argc, char *argv[]) {
    registerValidation(argc, argv);

    int n = inf.readInt(1, 200'000, "n");
    inf.readSpace();
    int q = inf.readInt(1, 200'000, "q");
    inf.readEoln();
    for (int i = 0; i < n; i++) {
        int x = inf.readInt(-1'000'000'00, 1'000'000'00, "x");
        inf.readSpace();    
        int y = inf.readInt(-1'000'000'00, 1'000'000'00, "y");
        inf.readEoln();
    }
    for (int i = 0; i < q; i++) {
        int l = inf.readInt(1, n, "l");
        inf.readSpace();
        int r = inf.readInt(l, n, "r");
        inf.readSpace();
        int x = inf.readInt(-1'000'000'00, 1'000'000'00, "x");
        inf.readSpace();    
        int y = inf.readInt(-1'000'000'00, 1'000'000'00, "y");
        inf.readSpace();
        int a = inf.readInt(90, 270, "angle");
        ensuref(a == 90 || a == 180 || a == 270, "Angle must be 90, 180 or 270.");
        inf.readEoln();
    }
    inf.readEof();
}
