#include using namespace std; using ll = long long; int main(){ int N, ans=0; cin >> N; vector> v; for (int x=1; x<=N; x++){ for (int y=0; y<=N/x; y++){ if (N-x*y >= 0 && (N-x*y)%(x+y) == 0){ v.push_back({x, y, (N-x*y)/(x+y)}); } } } for (int y=1; y<=N; y++) if (N % y == 0) v.push_back({0, y, N/y}); cout << v.size() << '\n'; for (auto &x : v) cout << x[0] << " " << x[1] << " " << x[2] << '\n'; return 0; }