#include <bits/stdc++.h>
using namespace std;
class FDivertaCity {
 public:
  void solve(std::istream& cin, std::ostream& cout) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<vector<int>> a(n + 1, vector<int>(n + 1));
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (i == j) continue;
        a[i][j] = a[j][i] = rand() % 1000 + 1;
      }
    }
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        cout << a[i][j] << " ";
      }
      cout << endl;
    }
  }
};
int main() {
  FDivertaCity solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
