#include <bits/stdc++.h>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
template <class Ty>
using passive_queue = priority_queue<Ty, vector<Ty>, greater<Ty>>;
struct Problem {
  void Solve() {
    ULL ans[10][10] = {};
    ans[1][0] = 1;
    for (UL i = 2; i < 10; i++) {
      ans[i][0] = ans[i - 1][0] * i * 2;
      for (UL j = 1; j < i; j++) {
        ans[i][j] = ans[i][0] / i * (i + j);
      }
    }
    for (UL i = 0; i < (10); i++)
      for (UL j = 0; j < (i); j++) ans[j][i] = ans[i][j];
    UL N;
    cin >> N;
    for (UL i = 0; i < (N); i++) {
      for (UL j = 0; j < (N); j++) {
        if (j) cout << " ";
        cout << ans[i][j];
      }
      cout << endl;
    }
  }
  Problem();
};
int main() {
  unique_ptr<Problem> p(new Problem());
  p->Solve();
  return 0;
}
Problem::Problem() { cout << fixed << setprecision(10); }
