#include using namespace std; using int64 = long long; using uint64 = unsigned long long; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N; cin >> N; for (int a = 1; a <= N / 3; a++) { for (int b = a, c = N - a - b; b <= c; b++, c--) { cout << a << " " << b << " " << c << endl; } } return 0; }