#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
//#include "richest.h"
using namespace std;
#define sz(x) (int) (x).size()
#define i64 int64_t
#define all(x) (x).begin(), (x).end()
vector<int> a,b;
vector<int> c;
/*
vector<int> ask(vector<int> a, vector<int> b) {
vector<int> res;
for (int i=0; i<sz(a); i++) {
if (a[i]>b[i]) res.push_back(a[i]);
else res.push_back(b[i]);
}
return res;
}
*/
int subtask_1(int N) {
for (int i=1; i<=N; i++) {
for (int j=i+1; j<=N; j++) {
a.push_back(i);
b.push_back(j);
}
}
assert(sz(a)<=499500);
c = ask(a,b);
set<int> ok;
for (int i=1; i<=N; i++) {
ok.insert(i);
}
for (int i=0; i<sz(c); i++) {
if (a[i]==c[i]) {
if (ok.count(b[i])) ok.erase(b[i]);
} else {
if (ok.count(a[i])) ok.erase(a[i]);
}
}
assert(sz(ok)==1);
return *(ok.begin());
}
int richest(int N, int T=1, int S=1) {
assert(T==1);
return subtask_1(N);
}
/*
signed main() {
cout<<richest(10);
return 0;
}
*/