#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <ctime>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <iomanip>
#include <bitset>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define inf 1000000007
#define mod 1000000007
#define x first
#define y second
#define pi acos(-1.0)
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";

#define FOREACH(it,x) for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define ull unsigned long long
#define ll long long
#define N 1000005

template <class T,class U>inline void Max(T &a,U b){if(a<b)a=b;}
template <class T,class U>inline void Min(T &a,U b){if(a>b)a=b;}

//FILE* outFile;

inline void add(int &a,int b){a+=b;while(a>=mod)a-=mod;}
inline int gcd(int a, int b){if(b == 0)return a; return gcd(b, a%b);}
int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=ans*(ll)a%mod;
        a=(ll)a*a%mod;b>>=1;
    }
    return ans;
}

const int M = 11;
ll a[11][11], f[11];
int id[11];
int main(){
    int j,k,i,T,ca=0, m = 0, K = 0, n;
    scanf("%d", &n);
    f[0] = 1, f[1] = 2;
    map<int, int>use;
    rep(i, 2, M){
        rep(j, 0, i){
            use[f[j]] = 1;
            rep(k, 0, j)use[f[j] + f[k]] = 1;
        }
        f[i] = 3;
        while(1){
            int ok = !use[f[i]];
            rep(j, 0, i)ok &= !use[f[j] + f[i]];
            if(ok)break;
            f[i]++;
        }
    }
    ll mul = 1;
    rep(i, 1, M){
        rep(j, 0, i)a[i][j] = a[j][i] = f[j] * mul;
        if(i==1)mul <<= 1;
        else{
            mul *= f[i-2] + f[i-1];
            mul++;
        }
    }
    /*
    map<ll, int>cnt;
    int ok = 0;
    ll mx = 1e11;
    rep(i, 0, n)id[i] = i;
    ok = 1;
    do{
        ll sum = 0;
        rep(i, 1, n){
            sum += a[id[i-1]][id[i]];
        }
        cnt[sum]++;
        if(cnt[sum] > 2 || sum > mx){ok = 0;break;}
    }while(next_permutation(id, id+n));
    */
    rep(i, 0, n){
        rep(j, 0, n)printf("%lld ", a[i][j]);
        puts("");
    }
}


