#include #include #include #include #include #include #include #include #include #include #include #include #define ALL(g) (g).begin(),(g).end() #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define pb push_back using namespace std; typedef long long ll; typedef pair P; const int mod=1e9+7,INF=1<<30; const double EPS=1e-12,PI=3.1415926535897932384626; const int MAX_N=9; const ll LINF=100000000000000000; int main(){ int N; cin >> N ; int a,b,c; a=1; while(a<=N/3){ b=a; c=N-(a+b); while(a<=b && b<=c){ cout << a << " " << b << " " << c << endl; b++; c--; } a++; } return 0; }