#include <bits/stdc++.h>
#include "code.h"
using namespace std;


vector<pair<int, int>> ZapisiTacke(int N){
    int n = N;
    vector<pair<int, int>> tacke(n + 1);
    for(int i = 0; i < n; i++){
        tacke[i + 1].first = i;
        tacke[i + 1].second = i * i;
    }
    return tacke;
}


            /*
            cout << "Pitaj: " << 1 << " " << resenje[i] << " " << resenje[j] << ": " << vr << endl;
            for(int i = 1; i <= n; i++){
                cout << resenje[i] << " ";
            }
            cout << endl;
            */

vector<int> Resi(int N, int Q){
    int n = N;
    int q = Q;
    vector<int> resenje(n + 1);
    vector<bool> upisan((n + 1), false);
    upisan[1] = 1;
    resenje[1] = 1;
    for(int tr = 2; tr <= n; tr++){
        for(int i = 2; i <= n; i++){
            if(!upisan[i]){
                bool jesteon = true;
                for(int j = 2; j <= n; j++){
                    if(!upisan[j] && (i != j)){
                        if(Pitaj(1, j, i) == 1){
                            jesteon = false;
                        }
                    }
                }
                if(jesteon){
                    resenje[i] = tr;
                    upisan[i] = true;
                    break;
                }
            }
        }
    }
    return resenje;
}