#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;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGxsOwoKaW50IG1haW4oKXsKCWludCBsID0gNTsKCWludCBuID0gKDEgPDwgbCk7Cgljb3V0IDw8IGwgPDwgIlxuIjsKCWZvcihpbnQgaSA9IDE7IGkgPCBuLTE7IGkgKz0gMil7CgkJY291dCA8PCBpIDw8ICIgIiA8PCBpICsgMSA8PCAiXG4iOwoJfQoJY291dCA8PCBuIC0gMSA8PCAiICIgPDwgMCA8PCAiXG4iOwoJcmV0dXJuIDA7Cn0=