Problem: Diverta City is a new city consisting of N towns numbered 1, 2, ..., N.

The mayor Ringo is planning to connect every pair of two different towns with a bidirectional road. The length of each road is undecided.

A Hamiltonian path is a path that starts at one of the towns and visits each of the other towns exactly once. The reversal of a Hamiltonian path is considered the same as the original Hamiltonian path.

There are N! / 2 Hamiltonian paths. Ringo wants all these paths to have distinct total lengths (the sum of the lengths of the roads on a path), to make the city diverse.

Find one such set of the lengths of the roads, under the following conditions:

* The length of each road must be a positive integer.
* The maximum total length of a Hamiltonian path must be at most 10^{11}.

Constraints

* N is a integer between 2 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:


N


Output

Print a set of the lengths of the roads that meets the objective, in the following format:


w_{1, 1} \ w_{1, 2} \ w_{1, 3} \ ... \ w_{1, N}
w_{2, 1} \ w_{2, 2} \ w_{2, 3} \ ... \ w_{2, N}
:  :     :
w_{N, 1} \ w_{N, 2} \ w_{N, 3} \ ... \ w_{N, N}


where w_{i, j} is the length of the road connecting Town i and Town j, which must satisfy the following conditions:

* w_{i, i} = 0
* w_{i, j} = w_{j, i} \ (i \neq j)
* 1 \leq w_{i, j} \leq 10^{11} \ (i \neq j)



If there are multiple sets of lengths of the roads that meet the objective, any of them will be accepted.

Examples

Input

3


Output

0 6 15
6 0 21
15 21 0


Input

4


Output

0 111 157 193
111 0 224 239
157 224 0 258
193 239 258 0

Solution (in CPP):

Solution:
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

ll calc(VVL d){
    int n = d.size();
    VI p(n);
    REP(i,n) p[i] = i;
    ll ret = 0;
    do {
        ll s = 0;
        REP(i,n-1) s += d[p[i]][p[i + 1]];
        chmax(ret, s);
    }while (next_permutation(ALL(p)));
    return ret;
}

int main() {
    ll n;
    cin >> n;

    VL a(n-1);
    a[0] = 1;
    a[1] = 2;
    FOR(i,2,n-2){
        set<int> st;
        REP(j,i) st.insert(a[j]);
        REP(j,i) REP(k,j) st.insert(a[j] + a[k]);
        FOR(x,1,1e5){
            if (st.count(x)) continue;
            bool ok = true;
            REP(j,i) if (st.count(x + a[j])) ok = false;
            if (ok){
                a[i] = x;
                break;
            }
        }
    }

    // REP(i,n-1) cout << a[i] << endl;

    VVL d(2, VL(2));
    d[0][1] = d[1][0] = 1;
    FOR(x,2,n-1){
        ll m = calc(d);
        REP(i,x) d[i].push_back((m + 1) * a[i]);
        d.push_back(VL());
        REP(i,x) d[x].push_back((m + 1) * a[i]);
        d[x].push_back(0);
    }

    REP(i,n){
        REP(j,n) cout << d[i][j] << " ";
        cout << endl;
    }


    return 0;
}