#include using namespace std; using ll = long long; vector> ans; __int128_t power(ll x, int e){ __int128_t t = 1; for (int i = 0; i < e; i++) t *= x; return t; } void solve(ll n, int e) { ll l = 1, r = 1; __int128_t t = 1; while (power(r, e) <= n){ if (t == n){ ans.push_back({e, l, r}); } if (t <= n) { r++; t += power(r, e); } else { t -= power(l, e); l++; } } return; } void solve2(ll n) { ll l = 1, r = 1; ll t = 1; while (r * r <= n){ if (t == n){ ans.push_back({2, l, r}); } if (t <= n) { r++; t += r * r; } else { t -= l * l; l++; } } return; } int main(){ ll n; cin >> n; assert(1 <= n && n <= 1000000000000000000); solve2(n); for (int i = 3; i < 60; i++){ solve(n, i); } sort(ans.begin(), ans.end()); cout << ans.size() << "\n"; for (auto [e, l, r] : ans){ cout << e << " " << l << " " << r << '\n'; } }