vector<pair<int, int>> ZapisiTacke(int N){
    vector<pair<int, int>> tacke(N+1);
    tacke[1] = {0, 1};
    for (int i = 2; i <= N; i++)
        tacke[i] = {i, 0};
    return tacke;
}

vector<int> Resi(int N, int Q){
    vector<int> res(N+1);
    int f;
    for (int i = 1; i <= N; i++) {
        int a = 1, b = 2, c = 3, d = 4;
        if (a == i)
            a = 5;
        if (b == i)
            b = 5;
        if (c == i)
            c = 5;
        if (d == i)
            d = 5;
        if (Pitaj(i, a, b) != 0 and Pitaj(i, c, d) != 0) {
            res[i] = 1;
            f = i;
            break;
        }
    }
    //cout << f << endl;
    for (int i = 1; i <= N; i++) {
        if (i == f)
            continue;
        int C = 2;
        for (int j = 1; j <= N; j++) {
            if (j == i or j == f)
                continue;
            //cout << i << " " << j << " " << f << " " << Pitaj(i, j, f) << endl;
            if (Pitaj(i, j, f) == -1)
                C++;
            //cout << C << endl;
        }
        res[i] = C;
    }
    return res;
}