#include #define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++) using namespace std; typedef long long ll; int main(void) { int a,b,c,N; cin >> N; a = 0; while(a <= c) { a++; b = a; c = N - a - b; while(b <= c) { cout << a << " " << b << " " << c << endl; b++; c--; } } return 0; }