#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define all(c) ((c).begin(),(c).end()) #define rall(c) ((c).rbegin(),(c).rend()) #define ll long long #define fi first #define se second #define inf (999999999) using namespace std; const ll MOD = 1e9 + 7; const double PI = acos(-1.0); //---------------------------------------------------------------------------------------------// int n; vector>> v; inline void solve(){ for (int i = 1; i < n; i++) { for (int j = i; j < n; j++) { if (n - i - j > 0 && j<=n-i-j) { v.push_back(pair>(i, pair(j, n - i - j))); } } } } int main() { cin >> n; solve(); sort(v.begin(), v.end()); for (int i = 0; i < v.size(); i++) { cout << v[i].first <<" "<< v[i].second.first <<" "<< v[i].second.second << endl; } return 0; }