//¸¡ÓÎÖ®ÈË Ò²ÕõÔú²»ÒÑÖ´×Å´æÔÚÏÂÈ¥
#include<bits/stdc++.h>
#include "richest.h"
using namespace std;
#define N 1000010
#define int long long
#define db long double
#define pii pair<int,int>
#define st first
#define ed second
#define mkp make_pair
#define pb push_back
#define eps 1e-9
#define mod 998244353
#define mod2 1000000007
#define bs 13131
#define bs2 131
#define INF 0x3f3f3f3f3f3f3f3f
#define il inline
#define vi vector<int>
#define ins insert
#define umap unordered_map
#define uset unordered_set
#define R(x) x.begin(),x.end()
#define B(x) x.begin()
#define E(x) x.end()
#define lb lower_bound
#define ub upper_bound
#define vi vector<int>
il int read(){
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-')f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9'){
x=(x<<1)+(x<<3)+(ch^48);
ch=getchar();
}
return x*f;
}
int T=1,n,m,q,k;
int s[N];
bool cmp[1010][1010];
vi ask(vi a,vi b);
il int solve1(){
vi a,b;
for(int i=0;i<n;i++)
for(int j=i+1;j<n;j++)
a.pb(i),b.pb(j);
vi op=ask(a,b);
int p=0;
for(int i=0;i<n*(n-1)/2;i++){
int A=a[i],B=b[i];
if(op[i]==A)cmp[A][B]=1;
}
for(int i=1;i<n;i++)
if(!cmp[p][i])p=i;
return p;
}
int richest(int nn,int ttt,int sss){
n=nn;
if(n==1000)return solve1();
}
//signed main(){
// T=read();
// while(T--)solve();
// return 0;
//}