#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;
}

bool cmp(int a, int b)
{
    return Pitaj(1, a, b) == 1;
}

vector<pair<int, int>> ZapisiTacke(int n)
{
    vector<pair<int, int>> V;
    for(int i = 0; i <= n; i++)
    {
        if(i == 1) V.push_back({0, 0});
        else V.push_back({1, i});
    }
    return V;
};
vector<int> Resi(int n, int q)
{
    vector<int> V;
    for(int i = 0; i <= n; i++) V.push_back(i);
    sort(V.begin() + 2, V.end(), cmp);
//    for(int x : V) cout << x << " ";
//    cout << "\n";
    return V;
};