#include using namespace std; int main() { int a, b, c, n; cin >> n; for (a = 1; a <= n / 3; a++) { for (b = a; b <= n / 2; b++) { if (a + 2 * b > n) break; for (c = b; c <= n - 2; c++) { if (a + b + c > n) break; if (a + b + c == n) { cout << a << " " << b << " " << c << endl; } } } } }