#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int a = 1; a <= n; a++) { for (int b = a; b <= n; b++) { int c = n - a - b; if (c < b) break; cout << a << " " << b << " " << c << endl; } } return 0; }