#include using namespace std; using int64 = long long; using uint64 = unsigned long long; #define repeat(i, x) for (int64 i = 0; (i) < (x); (i)++) #define rev_repeat(i, x) for (int64 i = (x) - 1; (i) >= 0; (i)--) #define range(i, a, b) for (int64 i = (a); (i) < (b); (i)++) #define traverse(it, ctn) for (auto it = begin(ctn); (it) != end(ctn); (it)++) #define rev_traverse(it, ctn) for (auto it = rbegin(ctn); (it) != rend(ctn); (it)++) template ostream& operator<<(ostream& os, vector& vec) { os << "["; repeat (i, vec.size()) { os << (i == 0 ? "" : ", ") << vec[i]; } os << "]"; return os; } template ostream& operator<<(ostream& os, pair& p) { os << "(" << p.first << ", " << p.second << ")"; return os; } template ostream& operator<<(ostream& os, set& s) { os << "{"; traverse (it, s) { if (it != s.begin()) os << ", "; os << *it; } os << "}"; return os; } template ostream& operator<<(ostream& os, map& m) { os << "{"; traverse (it, m) { if (it != m.begin()) os << ", "; os << it->first << ": " << it->second; } os << "}"; return os; } // // _______ _____ _______ _____ _______ _______ _____ _______ _____ _ _ _______ // | | | | | | |_____] |______ | | | | \ / |______ // |_____ |_____| | | | | |______ | __|__ | __|__ \/ |______ // // _____ ______ _____ ______ ______ _______ _______ _______ _____ __ _ ______ / // |_____] |_____/ | | | ____ |_____/ |_____| | | | | | | | | \ | | ____ / // | | \_ |_____| |_____| | \_ | | | | | | | | __|__ | \_| |_____| . // using Arc = pair; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int K; cin >> K; bitset<30> binK(K); // 先に31頂点のネットワークを構築する const int N = 32; vector arcs; repeat (u, N - 1) { range (v, u + 1, N - 1) { arcs.emplace_back(u + 1, v + 1); } } range (u, 1, N - 1) { if (binK[u - 1]) { arcs.emplace_back(u + 1, N); } } cout << N << " " << arcs.size() << endl; for (auto& arc : arcs) { cout << arc.first << " " << arc.second << endl; } return 0; }