#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "code.h"

#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define f first
#define s second

using namespace __gnu_pbds;
using namespace std;
mt19937 rng(time(NULL));
template<class T> using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class T1,class T2> ostream& operator<<(ostream& out,pair<T1,T2> a){out << "[" << a.f << "," << a.s << "]"; return out;}
template<class T> ostream& operator<<(ostream& out, vector<T> a){out << "{";for(auto p:a)out << p << ",";out << "}";return out;}

int ask(int i,int j)
{
    return Pitaj(i+1,j+1);
}
vector<int> Nadji(int n, int k)
{
	vector<vector<int> > polja(n,vector<int>(n));
	vector<pair<int,int> > q;
	for(int i=0;i<n;i++)
        for(int j=0;j<n;j++)
            q.pb({i,j});
    shuffle(all(q),rng);
	for(auto p:q)
    {
        int x=p.f,y=p.s;
        if(polja[x][y]==0)
            polja[x][y]=ask(x,y);
        vector<pair<pair<int,int>,int> > nepoznate;
        bool moze=true;
        for(int i=0;i<n;i++)
        {
            if(i==y)
                continue;
            if(polja[x][i]==0)
                nepoznate.pb({{x,i},0});
            else
            {
                if(polja[x][i]>=polja[x][y])
                {
                    moze=false;
                    break;
                }
            }
        }
        for(int i=0;i<n;i++)
        {
            if(i==x)
                continue;
            if(polja[i][y]==0)
                nepoznate.pb({{i,y},0});
            else
            {
                if(polja[i][y]<=polja[x][y])
                {
                    moze=false;
                    break;
                }
            }
        }
        if(!moze)
            continue;
        bool nasao=false;
        for(auto p:nepoznate)
        {
            int xx=p.f.f,yy=p.f.s;
            if(polja[xx][yy]==0)
                polja[xx][yy]=ask(xx,yy);
            if(p.s==0)
            {
                if(polja[xx][yy]>=polja[x][y])
                {
                    nasao=true;
                    break;
                }
            }
            else
            {
                if(polja[xx][yy]<=polja[x][y])
                {
                    nasao=true;
                    break;
                }
            }
        }
        if(nasao)
            continue;
        vector<int> out;
        out.pb(x+1);
        out.pb(y+1);
        return out;
    }
	vector<int> out={0,0};
	return out;
}