#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) using ll = long long; #ifdef _WIN32 #define getchar_unlocked _getchar_nolock #define putchar_unlocked _putchar_nolock #define fwrite_unlocked _fwrite_nolock #define fflush_unlocked _fflush_nolock #endif inline int gc() { return getchar_unlocked(); } templateinline void InputF(T& v) { cin >> v; } inline void InputF(char& v) { while (isspace(v = gc())); } inline void InputF(bool& v) { char c; InputF(c); v = c == '1'; } inline void InputF(string& v) { char c; for (InputF(c); !isspace(c); c = gc())v += c; } inline void InputF(int& v) { bool neg = false; v = 0; char c; InputF(c); if (c == '-') { neg = true; c = gc(); } for (; isdigit(c); c = gc())v = v * 10 + (c - '0'); if (neg)v = -v; } inline void InputF(long long& v) { bool neg = false; v = 0; char c; InputF(c); if (c == '-') { neg = true; c = gc(); } for (; isdigit(c); c = gc())v = v * 10 + (c - '0'); if (neg)v = -v; } inline void InputF(double& v) { double dp = 1; bool neg = false, adp = false; v = 0; char c; InputF(c); if (c == '-') { neg = true; c = gc(); } for (; isdigit(c) || c == '.'; c = gc()) { if (c == '.')adp = true; else if (adp)v += (c - '0') * (dp *= 0.1); else v = v * 10 + (c - '0'); } if (neg)v = -v; } templateinline void InputF(pair& v) { InputF(v.first); InputF(v.second); } templateinline void InputF(vector& v) { for (auto& e : v)InputF(e); } templateinline T InputF() { T v; InputF(v); return v; } struct InputV { int n, m; InputV(int N) :n(N), m(0) {} InputV(pair N) :n(N.first), m(N.second) {} templateoperator vector() { vector v(n); InputF(v); return v; } templateoperator vector>() { vector> v(n, vector(m)); InputF(v); return v; } }; struct Input { templateoperator T() { return InputF(); } int operator--(int) { int v; InputF(v); v--; return v; } InputV operator[](int n) { return InputV(n); } InputV operator[](pair n) { return InputV(n); } void operator()() {} templatevoid operator()(H&& h, T&& ...t) { InputF(h); operator()(forward(t)...); } templateInput& operator,(T&& v) { InputF(v); return *this; } }in; struct BoolStr { const char* t, * f; BoolStr(const char* _t, const char* _f) :t(_t), f(_f) {} }Yes("Yes", "No"), yes("yes", "no"), YES("YES", "NO"), Int("1", "0"); struct DivStr { const char* d, * l; DivStr(const char* _d, const char* _l) :d(_d), l(_l) {} }spc(" ", "\n"), no_spc("", "\n"), end_line("\n", "\n"), comma(",", "\n"), no_endl(" ", ""); struct Output { BoolStr B{ Yes }; DivStr D{ spc }; void p(int v) { if (v < 0)putchar_unlocked('-'), v = -v; char b[10]; int n = 0; while (v)b[n++] = '0' + v % 10, v /= 10; if (!n)b[n++] = 0; while (n--)putchar_unlocked(b[n]); } void p(ll v) { if (v < 0)putchar_unlocked('-'), v = -v; char b[20]; int n = 0; while (v)b[n++] = '0' + v % 10, v /= 10; if (!n)b[n++] = 0; while (n--)putchar_unlocked(b[n]); } void p(bool v) { p(v ? B.t : B.f); } void p(char v) { putchar_unlocked(v); } void p(const char* v) { fwrite_unlocked(v, 1, strlen(v), stdout); } void p(double v) { printf("%.20f", v); } void p(long double v) { printf("%.20Lf", v); } template void p(const T& v) { cout << v; } templatevoid p(const pair& v) { p(v.first); p(D.d); p(v.second); } templatevoid p(const vector& v) { rep(i, sz(v)) { if (i)p(D.d); p(v[i]); } } templatevoid p(const vector>& v) { rep(i, sz(v)) { if (i)p(D.l); p(v[i]); } } Output& operator()() { p(D.l); return *this; } templateOutput& operator()(H&& h) { p(h); p(D.l); return *this; } templateOutput& operator()(H&& h, T&& ...t) { p(h); p(D.d); return operator()(forward(t)...); } templatevoid exit(T&& ...t) { operator()(forward(t)...); std::exit(EXIT_SUCCESS); } Output& flush() { fflush_unlocked(stdout); return *this; } Output& set(const BoolStr& b) { B = b; return *this; } Output& set(const DivStr& d) { D = d; return *this; } Output& set(const char* t, const char* f) { B = BoolStr(t, f); return *this; } }out; int main() { int n = in; FOR(i, 1, n)FOR(j, i, n) { int k = n - i - j; if (j > k)break; out.p(i); putchar_unlocked(' '); out.p(j); putchar_unlocked(' '); out.p(k); putchar_unlocked('\n'); } }