#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 25;
const int MAX_W = 1010;
int n;
int label[MAX_N];
bool used[MAX_W];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 2; ++i) {
    label[i] = i + 1;
    used[i + 1] = true;
  }
  for (int i = 2; i < n; ++i) {
    int value;
    for (int j = 1; j < 1001; ++j) {
      if (!used[j]) {
        value = j;
        break;
      }
    }
    label[i] = value;
    used[value] = true;
    for (int j = 0; j < i; ++j) {
      for (int k = j + 1; k < i; ++k) {
        if (label[j] + label[k] - label[i] > 0) {
          used[label[j] + label[k] - label[i]] = true;
        }
        if (label[k] + label[i] - label[j] > 0) {
          used[label[k] + label[i] - label[j]] = true;
        }
        if (label[i] + label[j] - label[k] > 0) {
          used[label[i] + label[j] - label[k]] = true;
        }
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      printf("%d%c", i == j ? 0 : label[i] + label[j], j < n - 1 ? ' ' : '\n');
    }
  }
}
