using System; using System.Text; using System.Collections.Generic; public class Solution { public static void Main() { var n = int.Parse(Console.ReadLine()); var str = new StringBuilder(); for (int a = 1; a * 3 <= n; a++) { for (int b = a; a + b + b <= n; b++) { var c = n - a - b; str.Append($"{a} {b} {c}\n"); } } Console.WriteLine(str); } }