#include using namespace std; vector> ans; int n; void check(int x, int z) { if ((n - x * z) % (x + z) != 0) return; ans.push_back({ x, (n - x * z) / (x + z), z }); } int main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); cin >> n; for (int xz = 1; xz <= n; xz ++) { for (int i = 1; i * i <= xz; i ++) if (xz % i == 0) { int x = i, z = xz / i; check(x, z); if (x != z) check(z, x); } } for (int i = 1; i * i <= n; i ++) if (n % i == 0) { int a = i, b = n / i; ans.push_back({ 0, a, b }); ans.push_back({ b, a, 0 }); if (a != b) { swap(a, b); ans.push_back({ 0, a, b }); ans.push_back({ b, a, 0 }); } } cout << ans.size() << "\n"; for (auto [x, y, z] : ans) { cout << x << " " << y << " " << z << "\n"; } return 0; }