#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10;
long long ans[10][10];
int main() {
  static std::random_device rd;
  static std::uniform_int_distribution<long long> u(1, 99999999);
  int n;
  cin >> n;
  long long count = 0;
  long long key[9] = {1, 2, 4, 7, 12, 20, 33, 54, 88};
  for (int r = 0; r < n; r++) {
    long long base = 1;
    for (int c = r + 1; c < n; c++, base *= 10) ans[r][c] = base * key[count];
    count++;
  }
  for (int i = 0; i < n; i++) ans[i][i] = 0;
  for (int r = 0; r < n; r++)
    for (int c = 0; c < r; c++) ans[r][c] = ans[c][r];
  for (int i = 0; i < n; i++, cout << endl)
    for (int j = 0; j < n; j++) cout << ans[i][j] << " ";
  return 0;
}
