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

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

int partition(int tl, int tr) {
	int pivot = tl;
	tl++;
	while(tl <= tr) {
		if(Pitaj(1, res[pivot], res[tl]) < 0)
			tl++;
		else {
			swap(res[tl], res[tr]);
			tr--;
		}
	}
	swap(res[pivot], res[tr]);
	return tr;
}

// geometrijski pivot = 1
void quick(int l, int r) {
	if(l > r || l == r)
		return;
	int m = partition(l, r);
	quick(l, m-1);
	quick(m+1, r);
}

vector<int> Resi(int n, int q) {
	res.resize(n+1);
	vector<int> rezultat(n+1);
	for(int i = 1; i <= n; i++) {
		res[i] = i;
	}
	quick(2, n);
	for(int i = 1; i <= n; i++) {
		rezultat[res[i]] = i;
	}
	return rezultat;
}