using System; using System.Collections.Generic; using System.Linq; public static class Solution { public static void Main() { var N = int.Parse(Console.ReadLine()); var answers = new List<(int a, int b, int c)>(); for (int a = 1; a < N; a++) { for (int b = a; a + b < N; b++) { var c = N - a - b; if (c < b) break; answers.Add((a, b, c)); } } Console.WriteLine(string.Join(Environment.NewLine, answers.Select(x => $"{x.a} {x.b} {x.c}"))); } }