#include<bits/stdc++.h>
#define pb push_back
using namespace std;
#define G getchar()
int read()
{
	int x=0; bool flg=false; char ch=G;
	for (;!isdigit(ch);ch=G) if (ch=='-') flg=true;
	for (;isdigit(ch);ch=G) x=(x<<3)+(x<<1)+(ch^48);
	return flg?-x:x;
}
#undef G
#define fi first
#define se second
typedef long long ll;
/*const int mod=;
inline int upd(const int &x){return x+(x>>31&mod);}
inline void add(int &x,const int &y){x=upd(x+y-mod);}
inline void iadd(int &x,const int &y){x=upd(x-y);}
int qpow(int x,int y){
	int res=1;
	for (;y;y>>=1,x=1LL*x*x%mod)
		if (y&1) res=1LL*res*x%mod;
	return res;
}*/
#define rep(i,l,r) for (int i(l);i<=(r);i++)
#define per(i,l,r) for (int i(r);i>=(l);i--)

int n;
void solve(){
	n=read();
	rep(i,0,n-1){
		int x=i*2%n,y=(x+1)%n;
		printf("%d %d\n",x+1,y+1);
	}
}
int main()
{
	for (int T=1;T--;) solve();
}


using namespace std;
#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
#define w(x) int x;cin>>x;while(x--)
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define lld long double
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define int long long int
int mod = 1e9 + 7;

void abc()
{
	FIO;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
}



int gcd(int a, int b) {
	if (b == 0) {
		return a;
	}

	return gcd(b, a % b);
}


int po(int a, int b) {
	int res = 1;
	for (int i = 0; i < 32; i++) {
		if (b >> i & 1) {
			res = (res * a) % mod;
		}
		a = (a * a) % mod;
	}
	return res;
}


int fun(int n) {
	int res = 0;
	while (n) {
		res += n % 10;
		n /= 10;
	}
	return res;
}



void solve() {

	int a, b;
	cin >> a >> b;
	int res = max(fun(a), fun(b));
	cout << res;



}



signed main()
{
	abc();
	int tt   ;
	//cin >> tt;
	tt = 1;
	while (tt--) {
		solve();
	}
}