using System; using System.Collections.Generic; using System.Linq; namespace B_xy_yz_zx_N { internal class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); List list = new List(); for (int x = 0; x <= n / 8 + 1; x++) { for (int y = x; y <= n / 4 + 1; y++) { if (y == 0) { continue; } int a = x * y; int b = x + y; if ((n - a) % b == 0) { int z = (n - a) / b; if (z < y) { break; } if (x == y) { list.Add(string.Format("{0} {1} {2}", x, y, z)); list.Add(string.Format("{0} {1} {2}", x, z, y)); list.Add(string.Format("{0} {1} {2}", z, x, y)); } else if (y == z) { list.Add(string.Format("{0} {1} {2}", x, y, z)); list.Add(string.Format("{0} {1} {2}", y, x, z)); list.Add(string.Format("{0} {1} {2}", y, z, x)); } else { list.Add(string.Format("{0} {1} {2}", x, y, z)); list.Add(string.Format("{0} {1} {2}", x, z, y)); list.Add(string.Format("{0} {1} {2}", y, x, z)); list.Add(string.Format("{0} {1} {2}", y, z, x)); list.Add(string.Format("{0} {1} {2}", z, x, y)); list.Add(string.Format("{0} {1} {2}", z, y, x)); } } } } Console.WriteLine(list.Count); foreach (string s in list) { Console.WriteLine(s); } } } }