import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static int RANGE = 100; public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); PrintWriter pw = new PrintWriter(System.out); for(int a = 1; a <= N; a++){ for(int b = a; a + b <= N; b++){ final int c = N - a - b; if(c < b){ break; } pw.println(a + " " + b + " " + c); } } pw.flush(); } }