#include using namespace std; const long long N_MAX = 200000; int main(){ long long X; cin >> X; vector> P; if (X <= N_MAX){ P.push_back(make_tuple(X + 1, 0, X, -1, -1)); } for (int i = 1; i <= N_MAX; i++){ if (X % i == 0 and X / i + i + 2 <= N_MAX){ P.push_back(make_tuple(X / i + i + 2, 1, i, X / i, -1)); } } for (int i = 1; i <= N_MAX; i++){ if (X % i != 0){ continue; } for (int j = 1; j * i <= N_MAX; j++){ if (X / i % j == 0 and X / i / j + i + j + 3 <= N_MAX){ P.push_back(make_tuple(X / i / j + i + j + 2, 2, i, j, X / i / j)); } } } if (!P.empty()){ auto [_, f, i, j, k] = *min_element(P.begin(), P.end()); if (f == 0){ cout << i + 1 << endl; for (int l = 0; l < i; l++){ cout << 1 << ' ' << 2 + l << endl; } cout << "b"; for (int l = 0; l < i; l++){ cout << ' ' << 'g'; } cout << endl; } if (f == 1){ cout << i + j + 2 << endl; cout << 1 << ' ' << 2 << endl; for (int l = 0; l < i; l++){ cout << 1 << ' ' << 3 + l << endl; } for (int l = 0; l < j; l++){ cout << 2 << ' ' << 3 + i + l << endl; } cout << "b b"; for (int l = 0; l < i + j; l++){ cout << ' ' << 'g'; } cout << endl; } if (f == 2){ cout << i + j + k + 2 << endl; cout << 1 << ' ' << 2 << endl; cout << 2 << ' ' << 3 << endl; for (int l = 0; l < i; l++){ cout << 1 << ' ' << 4 + l << endl; } for (int l = 0; l < j; l++){ cout << 2 << ' ' << 4 + i + l << endl; } for (int l = 0; l < k; l++){ cout << 3 << ' ' << 4 + i + j + l << endl; } cout << "b b b"; for (int l = 0; l < i + j + k; l++){ cout << ' ' << 'g'; } cout << endl; } } else { cout << -1 << endl; } }