#include #include #include #include #include #include #include #include #include #include #define ALL(obj) (obj).begin(),(obj).end() #define RALL(obj) (obj).rbegin(),(obj).rend() #define P pair #define MOD 1000000007 #define INF 1012345678 #define NINF (-2147483647-1) #define LLINF 9223372036854775807 using ll = long long; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; for (int a = 1; a <= N / 3; a++) { for (int b = a; b < N; b++) { if (N - a - b >= b) { printf("%d %d %d\n", a, b, N - a - b); } else { break; } } } getchar(); getchar(); }