#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
	int n, m = 0; cin >> n;
	for(; m < n; m=m*2+1);
	rep(i,n){
		int t = i*2, u = t+1;
		while(t >= n) t -= 1 << (31 - __builtin_clz(t));
		while(u >= n) u -= 1 << (31 - __builtin_clz(u));
		cout << t+1 << " " << u+1 << "\n";
	}
}
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    auto f = [&n](int x) {
      return (x - 1) % n + 1;
    };
    cout << f(i * 2) << " " << f(i * 2 + 1) << endl;
  }
}