#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

const int L=1000;

void verify(vector<int> A,vector<int> B){
  int N=A.size();
  vector<vector<int>> g(N);
  rep(i,N){
    A[i]--;B[i]--;
    g[i].push_back(A[i]);
    g[i].push_back(B[i]);
  }

  auto bfs = [&](){
    for(int i=0;i<N;i++){
      queue<int> Q;
      vector<int> dist(N,MOD);
      dist[i]=0;
      Q.push(i);
      while(!Q.empty()){
        int now=Q.front();
        Q.pop();

        if(dist[now]>10) return false;

        for(auto nex:g[now]){
          if(nex>=N){
            cout<<"INVALID"<<endl;
            return false;
          }
          if(dist[nex]==MOD){
            dist[nex]=dist[now]+1;
            Q.push(nex);
          }
        }
      }
    }
    return true;
  };

  if(bfs()) cout<<"OK"<<endl;
  else cout<<"NG"<<endl;
}

int MASK=(1<<10)-1;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin>>N;

  vector<int> A(N,-1),B(N,-1);
  for(int i=0;i<N;i++){
    int value=i;
    int targetValue=(value<<1)&MASK;
    A[i]=(value<<1)&MASK;
    for(int d=9;d>=0;d--){
      if(A[i]<N) break;
      if(A[i]&(1<<d)) A[i]^=(1<<d);
    }
    B[i]=targetValue+1;
    for(int d=9;d>=0;d--){
      if(B[i]<N) break;
      if(B[i]&(1<<d)) B[i]^=(1<<d);
    }
  }

  //verify(A,B);

  for(int i=0;i<N;i++) cout<<A[i]+1<<" "<<B[i]+1<<endl;

  return 0;
}

//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <array>
#include <unordered_map>
#include<unordered_set>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<complex>
#include<fstream>
#include<assert.h>

#include<stdio.h>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, double> pid;
typedef pair<double, int> pdi;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;

const double EPS = 1e-9;

signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;

	rep(i, 0, N)
	{
		cout << ((2 * i) % N) + 1 << " " << ((2 * i + 1) % N) + 1 << endl;
	}

	return 0;
}