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(); int x = 0; while (x * x <= n) { int y = x; while(y * y <= n) { if (x + y == 0) { y++; continue; } int a = x * y; int b = x + y; if ((n - a) % b == 0) { int z = (n - a) / b; if (z < y) { y++; continue; } if (x == y && y == z) { list.Add(string.Format("{0} {1} {2}", x, y, z)); } else 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)); } } y++; } x++; } Console.WriteLine(list.Count); foreach (string s in list) { Console.WriteLine(s); } } } }