#include <bits/stdc++.h>
#define ll long long

using namespace std;

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

vector<int> Resi(int N, int Q){
    vector<int> resenje(N+1);
    vector <bool> pos(N + 1);
    for(int i = 1; i <= N - 1; i += 2)
    {
        int j = i + 1;
        if(j > N) break;
        int ispod = 0;
        for(int k = 1; k <= N; k++)
        {
            if(k == i || k == j) continue;
            int x = Pitaj(i, j, k);
            if(x > 0) ispod++;
        }
        resenje[i] = ispod + 1;
        resenje[i + 1] = ispod + 2;
        pos[ispod + 1] = true;
        pos[ispod + 2] = true;
    }
    for(int i = 1; i <= N; i++) {if(!pos[i]) resenje[N] = i;}
    return resenje;
}