using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var ans = new List(); for (var x = 0; x <= n; ++x) for (var y = 0; y <= n; ++y) { if (x == 0 && y == 0) continue; if (x * y > n) break; if ((n - x * y) % (x + y) == 0) ans.Add(new int[] { x, y, (n - x * y) / (x + y) }); } WriteLine(ans.Count); WriteLine(string.Join("\n", ans.Select(ai => string.Join(" ", ai)))); } }