#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  long long p[11];
  p[0] = 1;
  for (long long i = 1; i <= 10; i++) {
    p[i] = p[i - 1] * 10;
  }
  vector<vector<long long> > A(N, vector<long long>(N, 0));
  for (long long i = 0; i < N; i++) {
    long long c = 1;
    for (long long j = 0; j < N; j++) {
      if (i != j) {
        A[i][j] += c * p[i];
        A[j][i] += c * p[i];
        c++;
      }
    }
  }
  for (long long i = 0; i < N; i++) {
    for (long long j = 0; j < N; j++) {
      if (j > 0) cout << " ";
      cout << A[i][j];
    }
    cout << endl;
  }
}
