#include <iostream>
#include <vector>
#include "code.h"

using namespace std;

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

vector<int> Resi(int N, int Q){
    vector<int> resenje(N+1);
    if(N<=200){
        int x=Pitaj(1,2,3);
        if(x==0)
            for(int i=1;i<=N;i++)resenje[i]=N-i+1;
        else for(int i=1;i<=N;i++)resenje[i]=i;
        return resenje;
    }
    return resenje;
    resenje[1]=1;
    for(int i=2;i<=N;i++){
        int cntL=0,cntD=0;
        for(int j=2;j<=N;j++){
            if(i==j)continue;
            int res=Pitaj(1,i,j);
            if(res==1)cntL++;
            else cntD++;
        }
        resenje[cntL+2]=i;
    }
    return resenje;
}