#include #include using namespace std; using namespace atcoder; #define sz(x) ((int64_t)x.size()) #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define in_grid(h, w, H, W) if (!(0 <= h && 0 <= w && h < H && w < W)) continue; template using priority_queue_g = priority_queue, greater>; template using vec = vector; //プロトタイプ宣言 template istream &operator>>(istream &is, vector &v); template ostream &operator<<(ostream &os, const vector &v); template ostream &operator<<(ostream &os, const vector> &v); template ostream &operator<<(ostream &os, const vector>> &v); template istream &operator>>(istream &is, pair &p); template ostream &operator<<(ostream &os, const pair & p); template ostream &operator<<(ostream &os, const map &m); template ostream &operator<<(ostream &os, const set &s); template ostream &operator<<(ostream &os, const multiset &s); template ostream &operator<<(ostream &os, queue q); template ostream &operator<<(ostream &os, priority_queue q); template ostream &operator<<(ostream &os, stack s); istream &operator>>(istream &is, modint &i); istream &operator>>(istream &is, modint998244353 &i); istream &operator>>(istream &is, modint1000000007 &i); ostream &operator<<(ostream &os, const modint &i); ostream &operator<<(ostream &os, const modint998244353 &i); ostream &operator<<(ostream &os, const modint1000000007 &i); //vector template istream &operator>>(istream &is, vector &v) { for (T & in : v) is >> in; return is; } template ostream &operator<<(ostream &os, const vector &v) { bool first = true; for (const auto &x : v) { if (!first) os << " "; os << x; first = false; } return os; } template ostream &operator<<(ostream &os, const vector> &v) { bool first = true; for (const auto &x : v) { if (!first) os << "\n"; os << x; first = false; } return os; } template ostream &operator<<(ostream &os, const vector>> &v) { bool first = true; for (const auto &x : v) { if (!first) os << "\n\n"; os << x; first = false; } return os; } //pair template istream &operator>>(istream &is, pair &p) { is >> p.first >> p.second; return is; } template ostream &operator<<(ostream &os, const pair &p) { os << "(" << p.first << "," << p.second << ")"; return os; } //map template ostream &operator<<(ostream &os, const map &m) { bool first = true; for (const auto &[key, val] : m) { if (!first) os << " "; os << key << ":" << val; first = false; } return os; } //set template ostream &operator<<(ostream &os, const set &s) { bool first = true; for (const auto &x : s) { if (!first) os << " "; os << x; first = false; } return os; } //multiset template ostream &operator<<(ostream &os, const multiset &s) { bool first = true; for (const auto &x : s) { if (!first) os << " "; os << x; first = false; } return os; } //queue template ostream &operator<<(ostream &os, queue q) { bool first = true; while (!q.empty()) { if (!first) os << " "; os << q.front(); q.pop(); first = false; } return os; } //priority_queue template ostream &operator<<(ostream &os, priority_queue q) { bool first = true; while (!q.empty()) { if (!first) os << " "; os << q.top(); q.pop(); first = false; } return os; } //stack template ostream &operator<<(ostream &os, stack s) { bool first = true; while (!s.empty()) { if (!first) os << " "; os << s.top(); s.pop(); first = false; } return os; } //modint istream &operator>>(istream &is, modint &i) { int64_t x; is >> x; i = x; return is; } istream &operator>>(istream &is, modint998244353 &i) { int64_t x; is >> x; i = x; return is; } istream &operator>>(istream &is, modint1000000007 &i) { int64_t x; is >> x; i = x; return is; } ostream &operator<<(ostream &os, const modint &i) { os << i.val(); return os; } ostream &operator<<(ostream &os, const modint998244353 &i) { os << i.val(); return os; } ostream &operator<<(ostream &os, const modint1000000007 &i) { os << i.val(); return os; } //複数ベクター同時受け取り template void vcin(vector &first, vector &... rest) { vector sizes = {rest.size()...}; for (auto sz : sizes) { if (sz != first.size()) { cerr << "vcinエラー サイズが異なります" << "\n"; assert(false); } } for (int i = 0; i < (int)first.size(); i++) { cin >> first[i], (cin >> ... >> rest[i]); } } //ジャグ配列 template void jagcin(vector> &vv) { for (auto &v : vv) { int k; cin >> k; v.resize(k); for (int i = 0; i < k; i++) { cin >> v[i]; } } } //map template void mapcin(map &m, int n) { for (int i = 0; i < n; i++) { T1 x; T2 y; cin >> x >> y; m[x] = y; } } //set template void setcin(set &s, int n) { for (int i = 0; i < n; i++) { T x; cin >> x; s.insert(x); } } //multiset template void setcin(multiset &s, int n) { for (int i = 0; i < n; i++) { T x; cin >> x; s.insert(x); } } //queue template void queuecin(queue &q, int n) { for (int i = 0; i < n; i++) { T x; cin >> x; q.push(x); } } //priority_queue template void queuecin(priority_queue &q, int n) { for (int i = 0; i < n; i++) { T x; cin >> x; q.push(x); } } //stack template void stackcin(stack &s, int n) { for (int i = 0; i < n; i++) { T x; cin >> x; s.push(x); } } //組み合わせ template< typename T > struct Combination { vector< T > _fact, _rfact, _inv; Combination(int sz) : _fact(sz + 1), _rfact(sz + 1), _inv(sz + 1) { _fact[0] = _rfact[sz] = _inv[0] = 1; for(int i = 1; i <= sz; i++) _fact[i] = _fact[i - 1] * i; _rfact[sz] /= _fact[sz]; for(int i = sz - 1; i >= 0; i--) _rfact[i] = _rfact[i + 1] * (i + 1); for(int i = 1; i <= sz; i++) _inv[i] = _rfact[i] * _fact[i - 1]; } inline T fact(int k) const { return _fact[k]; } inline T rfact(int k) const { return _rfact[k]; } inline T inv(int k) const { return _inv[k]; } T P(int n, int r) const { if(r < 0 || n < r) return 0; return fact(n) * rfact(n - r); } T C(int p, int q) const { if(q < 0 || p < q) return 0; return fact(p) * rfact(q) * rfact(p - q); } T H(int n, int r) const { if(n < 0 || r < 0) return (0); return r == 0 ? 1 : C(n + r - 1, r); } }; template int64_t LIS (const vector& V) { vector DP(V.size()); int len = 0; for (const auto& x : V) { auto itr = lower_bound(DP.begin(), DP.begin() + len, x); *itr = x; if (itr == DP.begin() + len) len++; } return len; } int64_t powmod(int64_t a, int64_t b, int64_t mod) { a %= mod; int64_t res = 1 % mod; while (b) { if (b&1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; } template bool chtop(vector& a, const T& b, int limit_size = -1) { if (limit_size == -1) limit_size = a.size(); if ((int)a.size() < limit_size) { auto it = lower_bound(a.begin(), a.end(), b, greater()); a.insert(it, b); return true; } if (limit_size == 0 || b <= a.back()) return false; a.pop_back(); auto it = lower_bound(a.begin(), a.end(), b, greater()); a.insert(it, b); return true; } template bool chbot(vector& a, const T& b, int limit_size = -1) { if (limit_size == -1) limit_size = a.size(); if ((int)a.size() < limit_size) { auto it = lower_bound(a.begin(), a.end(), b); a.insert(it, b); return true; } if (limit_size == 0 || b >= a.back()) return false; a.pop_back(); auto it = lower_bound(a.begin(), a.end(), b); a.insert(it, b); return true; } //ループマクロ #define re(n) for (int64_t r_= 0; r_< int64_t(n);r_++) #define rep(i, n) for (int64_t i = 0; i < int64_t(n); i++) #define repp(i, n) for (int64_t i = 0; i <= int64_t(n); i++) #define rrep(i, a, b) for (int64_t i = int64_t(a); i < int64_t(b); i++) #define rrepp(i, a, b) for (int64_t i = int64_t(a); i <= int64_t(b); i++) #define reep(i, n) for (int64_t i = int64_t(n)-1; i >= 0; i--) #define reepp(i, n) for (int64_t i = int64_t(n); i >= 0; i--) #define rreep(i, a, b) for (int64_t i = int64_t(b)-1; i >= int64_t(a); i--) #define rreepp(i, a, b) for (int64_t i = int64_t(b); i >= int64_t(a); i--) template bool chmax(T& a, const U&b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T& a, const U&b) { if (a > b) { a = b; return true; } return false; } //セグ木 static constexpr int64_t seg_MOD = 998244353; static constexpr int64_t seg_ID = -8'000'000'000'000'000'000LL; constexpr int64_t sum_op (int64_t a, int64_t b) { return (a + b); } constexpr int64_t mul_op (int64_t a, int64_t b) { return (a * b); } constexpr int64_t SUM_op (int64_t a, int64_t b) { return (a + b) % seg_MOD; } constexpr int64_t MUL_op (int64_t a, int64_t b) { return (a * b) % seg_MOD; } string txt_op (string a, string b) { return (a + b); } constexpr int64_t min_op (int64_t a, int64_t b) { return min(a , b); } constexpr int64_t max_op (int64_t a, int64_t b) { return max(a , b); } constexpr int64_t lcm_op (int64_t a, int64_t b) { return lcm(a , b); } constexpr int64_t gcd_op (int64_t a, int64_t b) { return gcd(a , b); } constexpr int64_t and_op (int64_t a, int64_t b) { return (a & b); } constexpr int64_t or_op (int64_t a, int64_t b) { return (a | b); } constexpr int64_t xor_op (int64_t a, int64_t b) { return (a ^ b); } constexpr pair sum_OP (pair a, pair b) { return {sum_op(a.first, b.first), a.second + b.second}; } constexpr int64_t no0_e () { return 0; } constexpr int64_t no1_e () { return 1; } constexpr int64_t all_e () { return -1; } string emp_e () { return ""; } constexpr int64_t max_e () { return 4'000'000'000'000'000'000LL; } constexpr int64_t min_e () { return -4'000'000'000'000'000'000LL; } constexpr pair no0_E () { return {0, 0}; } constexpr int64_t add_map (int64_t f, int64_t x) { return x + f; } constexpr int64_t upd_map (int64_t f, int64_t x) { return f == seg_ID ? x : f; } constexpr pair add_MAP (int64_t f, pair x) { x.first += f * x.second; return x; } constexpr pair upd_MAP (int64_t f, pair x) { if (f != seg_ID) x.first = f * x.second; return x; } constexpr int64_t add_com (int64_t f, int64_t g) { return g + f; } constexpr int64_t upd_com (int64_t f, int64_t g) { return f == seg_ID ? g : f; } constexpr int64_t no0_id () { return 0; } constexpr int64_t upd_id () { return seg_ID; } //セグ木 using sumtree = segtree; using multree = segtree; using txttree = segtree; using mintree = segtree; using maxtree = segtree; using lcmtree = segtree; using gcdtree = segtree; using andtree = segtree; using ortree = segtree; using xortree = segtree; using summodtree = segtree; using mulmodtree = segtree; //遅延セグ木 using lazyaddsum = lazy_segtree, sum_OP, no0_E, int64_t, add_MAP, add_com, no0_id>; using lazyupdsum = lazy_segtree, sum_OP, no0_E, int64_t, upd_MAP, upd_com, upd_id>; using addmintree = lazy_segtree; using updmintree = lazy_segtree; using addmaxtree = lazy_segtree; using updmaxtree = lazy_segtree; struct addsumtree : lazyaddsum { addsumtree (int64_t n) : lazyaddsum(vector>(n, {0, 1})) {} addsumtree (vector v) : lazyaddsum([&]{ vector> p(v.size()); for (int64_t i = 0; i < (int64_t)v.size(); i++) p[i] = {v[i], 1}; return p; }()) {} int64_t get(int p) { return lazyaddsum::get(p).first; } int64_t prod(int l, int r) { return lazyaddsum::prod(l, r).first; } int64_t all_prod() { return lazyaddsum::all_prod().first; } }; struct updsumtree : lazyupdsum { updsumtree (int64_t n) : lazyupdsum(vector>(n, {0, 1})) {} updsumtree (vector v) : lazyupdsum([&]{ vector> p(v.size()); for (int64_t i = 0; i < (int64_t)v.size(); i++) p[i] = {v[i], 1}; return p; }()) {} int64_t get(int p) { return lazyupdsum::get(p).first; } int64_t prod(int l, int r) { return lazyupdsum::prod(l, r).first; } int64_t all_prod() { return lazyupdsum::all_prod().first; } }; using lint = int64_t; using pll = pair; using tll = tuple; using vl = vector; using vvl = vector>; using vvvl = vector>>; using vpll = vector>; using ld = long double; using mint = modint998244353; void yn(bool b) { cout << (b ? "Yes" : "No") << endl; } const lint MOD = 998244353; // const lint MOD = 1000000007; const lint INF = 4004004004004004004; const ld pi = 3.141592653589793238; const lint dx[] = {-1,0,1,0,-1,1,1,-1}; const lint dy[] = {0,-1,0,1,-1,-1,1,1}; void solve() { lint n; cin >> n; rep(i,n){ rep(j,i+1){ cout << ((i+j)%3==2?2:1) << " "; } cout << "\n"; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(20); int T = 1; // cin >> T; while (T--) solve(); }