import java.util.Scanner; public class Main { public static void main(String[] args){ Main main = new Main(); main.solveB(); } private void solveB() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for (int a = 1; a <= N - 2 * a; a++) { for (int b = a; b <= N - b - a; b++) { System.out.println(a + " " + b + " " + (N - b - a)); } } } }