#include <cstdio>
#define repeat(i,n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_from(i,m,n) for (int i = (m); (i) < int(n); ++(i))
int main() {
    int n; scanf("%d", &n);
    repeat_from (a, 1, n+1) {
        repeat_from (b, a, n-a+1) {
            int c = n-a-b;
            if (b <= c) {
                printf("%d %d %d\n", a, b, c);
            }
        }
    }
    return 0;
}