#include #include #include #include #include using namespace std; int main() { long long A; cin >> A; vector> V; if (A == 0) { cout << 2 << " " << 0 << endl; return 0; } else if (A == 1) { cout << 1 << " " << 0 << endl; return 0; } int u = 1, d = 1; while (A != 1) { int nu = u + 2, nd = u + 1; V.emplace_back(u, nu); V.emplace_back(u, nu); V.emplace_back(d, nd); if (A & 1) V.emplace_back(d, nu); A >>= 1; u = nu, d = nd; } cout << u << " " << V.size() << endl; for (auto [a, b] : V) cout << a << " " << b << endl; }