#include int main(void) { int a, b, N; scanf("%d", &N); for (a = 1; a <= N; a++) { for (b = 1; b <= N; b++) { int c = N - a - b; if (a <= b && b <= c) { printf("%d %d %d\n", a, b, c); } } } return 0; }