#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N; set> ans; for(int x = 1; x <= N; ++x){ for(int y = 1; y*x <= N; y++){ int w = N - x*y; if(w < 0 || w % (x + y) != 0) continue; int z = w / (x + y); ans.insert({x, y, z}); ans.insert({x, z, y}); ans.insert({y, x, z}); ans.insert({y, z, x}); ans.insert({z, x, y}); ans.insert({z, y, x}); } } cout << ans.size() << endl; for(auto [x,y,z] : ans){ cout << x << ' ' << y << ' ' << z << endl; } return 0; }