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

namespace {
    static vector<pair<int, int>> points;
    static vector<int> p;
    static int n;
    static int q;
    static int qt;
}
vector<pair<int, int>> ZapisiTacke(int n){
    vector<pair<int , int>> tacke(n+1);
    tacke[1] = {-2 , 0};
    tacke[2] = {-1 , 0};
    tacke[3] = {0 , 0};
    for(int i = 4; i<n+1; i++){
        tacke[i] = {i-3 , (i-1)*(i-2)/2};
    }
    return tacke;
}
vector<int> Resi(int n, int q){
    vector<int> resenje(n+1);
    bool linija = true;
    int br = Pitaj(1 , 2 , 3);
    if(br == 0){
        for(int i = 2; i<n+1 - 2; i++){
            if(Pitaj(i , i+1 , i+2) != -1) continue;
            else{
                linija = false;
                break;
            }
        }
        if(linija){
                //1 2 3...N
            for(int i = 1; i<n+1; i++){
                resenje[i] = i;
            }
            return resenje;
        }
    }
    br = Pitaj(n , n - 1 , n - 2);
    if(br == 0){
        for(int i = 1; i<n+1 - 2; i++){
            if(Pitaj(i , i+1 , i+2) != 1) continue;
            else{
                linija = false;
                break;
            }
        }
        if (linija){
            for(int i = 1; i<n+1; i++){
                resenje[i] = n+1-i;
            }
            return resenje;
        }
    }

}