import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); for (int i = 1; i < N - 1; ++i) { for (int j = i; j < N - i; ++j) { if (i + 2 * j <= N) System.out.printf("%d %d %d\n", i, j, N - i - j); } } } }