#include using namespace std; #define rep(i,j,n) for(int i=(j);i<(n);i++) #define erep(i,j,n) for(int i=(j);i<=(n);i++) #define all(i) i.begin(),i.end() #define rall(i) i.rbegin(),i.rend() #define INF 1e9 const int mod = 1e9+7; typedef vector vi; typedef vector vs; typedef vector vvi; typedef pair pi; typedef long long i64; struct edge { int x; int y; }; int main() { cin.tie(0); ios::sync_with_stdio(false); int k; cin >> k; vector vec; rep(i, 1, 32) rep(j, i + 1, 32) vec.push_back({i, j}); rep(bit, 0, 32) { if(k & (1 << bit)) vec.push_back({bit + 1, 32}); } cout << 32 << " " << vec.size() << endl; rep(i, 0, vec.size()) { cout << vec[i].x << " " << vec[i].y << endl; } }