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

using namespace std;

vector<pair<int, int> > tacke;
vector<pair<int, int> > ZapisiTacke(int N) {
	tacke.resize(N+1);
	for(int i = 1; i <= N; i++)
		cin >> tacke[i].first;
	for(int i = 1; i <= N; i++)
		cin >> tacke[i].second;
	return tacke;
}

int pitaj(int i, int j, int k) {
	int Ax = tacke[i].first, Ay = tacke[i].second;
	int Bx = tacke[i+1].first, By = tacke[i+1].second;
	int Cx = tacke[i+2].first, Cy = tacke[i+2].second;
	long long vektorskiProizvod = 1ll * (Bx - Ax) * (Cy - Ay) - 1ll * (By - Ay) * (Cx - Ax);
	if(vektorskiProizvod > 0) return 1;
	if(vektorskiProizvod < 0) return -1;
	return 0;
}

vector<int> Resi(int N, int Q) {
	vector<int> resenje(N+1);
	for(int i = 1; i <= N; i++)
		resenje[i] = i;
	
	for(int i = 1; i <= N - 2; i++) {
		if(pitaj(i, i+1, i+2) != Pitaj(i, i+1, i+2)) {
			for(int j = 1; j <= N; j++)
				resenje[i] = N - j + 1;
			break;
		}
	}
	
	return resenje;
}