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

using namespace std;
vector<pair<int, int>> ZapisiTacke(int n){

    vector<pair<int, int>> tacke(n+1);
    tacke[1] = {0,0};
    for(int i = 2; i <= n; i++){
        tacke[i] = {1,i};
    }
    //for(int i = 1; i <= n; i++){
    //    cout << tacke[i].first << "," << tacke[i].second << '\n';
    //}

    return tacke;
}
vector<int> Resi(int n, int q){
    vector<int> ans(n+1);
    ans[0] = 125;

    //ans.push_back(1);
    vector<int> lr(n+1);
    int l = 0, r = 0;
    int t;
    for(int i =3; i <= n; i++){
        int x = Pitaj(1,2,i);
        if(x!=0){
            l++;
            t = i;
        }
        if(l > 1)break;
    }
    if(l > 1){
        for(int i =1; i <= n; i++){
            if(i==3 || i== 4)continue;
            int x = Pitaj(3,4,i);
            if(x!=0){
                l++;
                t = i;
                break;
            }
        }

    }
    ans[t] = 1;

    for(int i = 1; i <= n; i++){
        if(i==t)continue;
        int l = 0;
        int r = 0;
        for(int j = i+1; j <= n; j++){
            if(j==t)continue;
            int x = Pitaj(t,i,j);
            //cout << i << " " << j << " <- i j\n";
            //cout << x << " <- x \n";

            if(x == 1){
                lr[i]++;

            }else{
                lr[j]++;
            }
        }
        //cout << lr[i] << " " << n-lr[i] << " <-=- l r \n";
        ans[i] = n-lr[i];

    }


    return ans;


}