#include <stdio.h>

int main() {
    int n,man,woman,child;
    scanf("%d", &n);

    for (man = 0; man <= n / 4; man++) {
        for (woman = 0; woman <= n / 3; woman++) {
            child = (n - 4 * man - 3 * woman) * 2;
            if (child >= 0 && man + woman + child == n) {
                printf("%d %d %d\n", man, woman, child);
            }
        }
    }

    return 0;
}
