#include #include #include #include using namespace std; using i64 = long long; using m32 = atcoder::static_modint<998244353>; #define rep(i,n) for(int i=0; i<(int)(n); i++) int D = 39; int main(){ i64 A; cin >> A; vector> ans; rep(s,2) rep(t,2) rep(i,D) ans.push_back({ 2+3*i+s, 2+3*(i+1)+t }); rep(s,2) ans.push_back({ 1, 2+s }); rep(i,D) ans.push_back({ 2+3*i+2, 2+3*(i+1)+2 }); int N = 1 + (D+1) * 3; rep(d,D+1) if((A>>(D-d)) & 1) ans.push_back({ 2+3*d+0, 2+3*d+2 }); cout << N << ' ' << ans.size() << '\n'; for(auto [u,v] : ans) cout << u << ' ' << v << '\n'; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } } ios_do_not_sync_instance;