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()); for (int a = 1; a <= N / 3; a++) { for (int b = a; a + b <= N / 3 * 2; b++) { int c = N - a - b; //if (c <= 0 || b > c) //{ // continue; //} Console.WriteLine("{0} {1} {2}", a, b, c); } } } }