#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	int l = 5;
	int n = (1 << l);
	cout << l << "\n";
	for(int i = 1; i < n-1; i += 2){
		cout << i << " " << i + 1 << "\n";
	}
	cout << n - 1 << " " << 0 << "\n";
	return 0;
}