#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i bool chmin(T& a, T b){ if(a > b){a = b; return true;} return false; } template bool chmax(T& a, T b){ if(a < b){a = b; return true;} return false; } template T gcd(T a, T b){ return a % b ? gcd(b, a % b) : b; } template T lcm(T a, T b){ return a / gcd(a, b) * b; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; // xy + yz + zx = N, x >= y >= z set> st; for(int x = 0; x*x <= N; ++x){ for(int y = 0; y <= x; ++y){ int w = N - x*y, v = x + y; if(w < 0 || v == 0) continue; if(w % v != 0) continue; int z = w / v; st.insert({x, y, z}); st.insert({x, z, y}); st.insert({y, x, z}); st.insert({y, z, x}); st.insert({z, x, y}); st.insert({z, y, x}); } } cout << st.size() << endl; for(auto [x, y, z] : st) cout << x << ' ' << y << ' ' << z << endl; return 0; }