#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main() { ios::sync_with_stdio(false); cin.tie(0); ll n, h; cin >> n; h = n / 3; vector> ans(3, vector(3, h)); ll r = n - h * 3; if(h % 2 == 0){ for(int y = 0; y < 3; y++){ for(int x = 0; x < r; x++){ ans[y][x]++; } } }else{ for(int y = 0; y < r; y++){ for(int x = 0; x < 3; x++){ ans[y][x]++; } } } for(int y = 0; y < 3; y++) cout << ans[y] << '\n'; }