using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { new Magatro().Solve(); } } class Magatro { private int N; public void Solve() { N = int.Parse(Console.ReadLine()); var sb = new StringBuilder(); for (int a = 1; a <= N / 3; a++) { for (int b = a; b <= (N - a) / 2; b++) { int c = N - a - b; if (c <= 0 || b > c) { continue; } sb.Append(string.Format("{0} {1} {2}\n", a, b, c)); } } Console.Write(sb.ToString()); } }