#include <bits/stdc++.h>
using namespace std;

int main() {
int x;          // 班费
int a, b, c;    // 6元、5元、4元的个数
int quotient;   // 商
int remainder;  // 余数
cin >> x;
quotient = x / 4;   // 首先,尽量购买 价格最低的 4元笔
remainder = x % 4;  // 其次,根据除 4 的余数,再考虑其他价格的笔
switch (remainder) { // x 一定大于等于 4元
case 0 :    // 能被 4 整除的情况,尽量购买 4 元的笔
a = 0;
b = 0;
c = quotient;
break;
case 1 :
a = 0;
b = 1;  // 余数 为 1 时,购买 1 支 5 元的笔
c = quotient - 1;   // 别忘记从 除 4 的商数中减掉 1
break;
case 2 :    // 余数 为 2 时,优先考虑 买 1只 6 元的笔 (也可以买 2只5元的笔)
if (quotient >= 2) {
a = 1;
b = 0;
c = quotient - 1;
/*
a = 0;
b = 2;
c = quotient - 2;
*/
}
break;
case 3 :    // 余数 为 3 时,优先考虑 买 1只 6 元的笔
if (quotient >= 3) {
a = 0;
b = 3;
c = quotient - 3;
} else if (quotient == 2) { // x = 11
a = 1;
b = 1;
c = quotient - 2;
} else { // x = 7
// 无可行解
}
break;
}
cout << a << " " << b << " " << c << endl;
return 0;
}