#include <bits/stdc++.h>
using namespace std;
long long n;
long long beki[15];
long long ans[15][15];
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  beki[0] = 1;
  for (int i = 1; i <= n; i++) beki[i] = beki[i - 1] * 10;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      cnt++;
      ans[i][j] += beki[i - 1] * cnt;
      ans[j][i] += beki[i - 1] * cnt;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << ans[i][j] + 1 << " ";
    }
    cout << endl;
  }
  return 0;
}
