#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<pii, int> ppiii;

int scale[10]{1,2,4,7,12,20,29,38,52,73};

ll dp[10][10];

void dfs(int curr, int mask, int v, ll currW, ll& ret) {
  if(__builtin_popcount(mask) == v) {
    ret = max(ret, currW);
    return;
  }
  for(int i = 0; i < v; i++) {
    if((mask&(1<<i)) == 0) {
      dfs(i, mask | (1<<i), v, currW + dp[curr][i], ret);
    }
  }
}

void solve() {
  int n;
  cin >> n;
  dp[0][1] = 1;
  dp[1][0] = 1;
  for(int v = 2; v < n; v++) {
    ll ret = 0;
    for(int i = 0; i < v; i++) {
      dfs(i, 1<<i, v, 0, ret);
    }
    for(int k = 0; k < v; k++) {
      dp[v][k] = (ret+1) * scale[k];
      dp[k][v] = (ret+1) * scale[k];
    }
  }
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < n; j++) {
      cout << dp[i][j];
      if(j == n-1) cout << "\n";
      else cout << " ";
    }
  }
}

void casesolve() {
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  // casesolve();
}
