#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    int n;
    cin >> n;

    for (int i = 0; i < n; i++) {
        int a = (i * 2 + 0) % n;
        int b = (i * 2 + 1) % n;
        cout << a + 1 << ' ' << b + 1 << '\n';
    }

    return 0;
}
#include<bits/stdc++.h>
using namespace std;

#define fastio() ios::sync_with_stdio(false);cin.tie(0); cout.tie(0)
#define ll long long int
#define loop(i,k,n) for(i=k; i<n; i++)
#define rloop(i,n,k) for(i = n-1; i >= k; i--)
#define trv(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define between(v,x,y) v.begin()+x,v.begin()+y 
#define pb push_back
#define mp make_pair
#define sz(x) x.size()
#define clr(x) memset(x,0,sizeof(x))
#define oparr(v) for(auto x:v) cout << x << " " ; cout << '\n'
#define f first
#define s second

template<class T> void inp(T& x) {
	cin >> x;
}
template<class H, class... T> void inp(H& h, T&... t) {
	inp(h);
	inp(t...);
}
template<class A> void inp(vector<A>& x) {
	trv(a, x)
		inp(a);
}
void deb_out() { cerr << endl; }
template<typename Head, typename... Tail> void deb_out(Head H, Tail... T) { cerr << ' ' << H; deb_out(T...); }
#define deb(...) cerr << "(" << #__VA_ARGS__ << "):", deb_out(__VA_ARGS__)

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<ll> vll;

const ll mod = 1e9 + 7;
const char nl = '\n';
const int N = 1e6;
const ll lim = 2e7 + 1;

#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/__gcd(a,b) 
#define msb(n) __builtin_clz(n)

void solve(){
	int i,j;
	int a,b,c;
	inp(a,b,c);
	if(a == b) cout << c;
	else if(b == c) cout << a;
	else if(a == c) cout << b;
	else cout << 0;
}

int main(){

	fastio();
	int t = 1;
    //inp(t);
	int x = t;
    while(t--){
		//cout << "Case #" << x-t << ": ";
		solve();
	}
 return 0;
}
