#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=10;
const int a[N+9]={0,1,2,4,7,12,20,29,38,52,73};

int n,p[N+9];
LL ans[N+9][N+9],mx;

void into(){
  scanf("%d",&n);
}

void Get_ans(){
  for (int i=2;i<=n;++i){
	for (int j=1;j<i;++j) ans[i][j]=ans[j][i]=(mx+1)*a[j];
	if (i==n) break;
	for (int j=1;j<=i;++j) p[j]=j;
	for (;2333;){
	  LL sum=0;
	  for (int j=1;j<i;++j) sum+=ans[p[j]][p[j+1]];
	  mx=max(mx,sum);
	  if (!next_permutation(p+1,p+i+1)) break;
	}
  }
}

void work(){
  Get_ans();
}

void outo(){
  for (int i=1;i<=n;++i){
	for (int j=1;j<=n;++j)
	  printf("%lld ",ans[i][j]);
    puts("");
  }
}

int main(){
  into();
  work();
  outo();
  return 0;
}