#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;
}
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexedset;
//int randi = (mt19937(null));
int Pitaj(int i, int j, int k) {
    qt--;

    assert(1 <= i && i <= n);
    assert(1 <= j && j <= n);
    assert(1 <= k && k <= n);
    assert(i != j && i != k && j != k);
    assert(qt >= 0);
    int pi = p[i];
    int pj = p[j];
    int pk = p[k];
    cout << pi << " " << pj << " " << pk << endl;
    assert(1 <= pi && pi <= n);
    assert(1 <= pj && pj <= n);
    assert(1 <= pk && pk <= n);

    auto [ax, ay] = points[pi];
    auto [bx, by] = points[pj];
    auto [cx, cy] = points[pk];

    long long cross =
        1LL * (bx - ax) * (cy - ay) -
        1LL * (by - ay) * (cx - ax);

    if (cross > 0) return 1;
    if (cross < 0) return -1;
    return 0;
}
ll stepen(ll x){
    ll res = 1;
    while(x % 2 == 0){
        x /= 2;
        res++;
    }
    return res;
}
vector<pair<int, int>> ZapisiTacke(int n){
    vector<pair<int, int>>res(n + 1);
    for(int i = 1; i <= n; i++){
        res[i] = make_pair(i, 0);
    }
    res[n] = make_pair(n, 1);
    return res;
}
vector<int> Resi(int n, int Q){
    int odg = Pitaj(1, 2, 3);
    vector<int>res(n + 1);
    for(int i = 1; i <= n; i++){
        res[i] = i;
    }
    vector<int>res1(n + 1);
    for(int i = 1; i <= n; i++){
        res1[i] = n - i + 1;
    }
    if(odg == 0){
        return res;
    }
    return res1;
}