#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; #define MOD 1000000007 // 10^9 + 7 #define INF 1000000000 // 10^9 #define LLINF 1LL<<60 int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; for (int a = 1; a <= N; a++) { for (int b = 1; b <= N - a; b++) { int c = N - a - b; if (c >= 1 && a <= b && b <= c) cout << a << " " << b << " " << c << endl; } } return 0; }