import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); StringBuilder sb = new StringBuilder(); for (int i = 1; i * 3 <= n; i++) { for (int j = i; i + j * 2 <= n; j++) { sb.append(i).append(" ").append(j).append(" ").append(n - i - j).append("\n"); } } System.out.print(sb); } }