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 <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;

int n;
ll num[10];
ll num2[10];
ll out[10][10];
ll hoge[10];

int main() {
    cin >> n;
    if (n == 2) {
        cout << 0 << " " << 1 << endl;
        cout << 1 << " " << 0 << endl;
        return 0;
    }
    num[0] = 1;
    for (int i = 1; i <= n-1; i++) {
        for (int j = num[i-1]+i;; j++) {
            bool ok = true;
            for (int k = 0; k < i; k++) {
                for (int l = k+1; l < i; l++) {
                    if (num[k]+num[l] == j) {
                        ok = false;
                        break;
                    }
                    for (int z = 0; z < i; z++) {
                        if (num[k]+num[l] == j+num[z]) {
                            ok = false;
                            break;
                        }
                    }
                }
            }
            if (ok) {
                num[i] = j;
                break;
            }
        }
    }
    num2[0] = 1;
    for (int i = 1; i <= n-1; i++) {
        for (int j = num2[i-1]+i;; j++) {
            bool ok = true;
            for (int k = 0; k < i; k++) {
                for (int l = k+1; l < i; l++) {
                    for (int z = 0; z < i; z++) {
                        if (num2[k]+num2[l] == j+num2[z]) {
                            ok = false;
                            break;
                        }
                    }
                }
            }
            if (ok) {
                num2[i] = j;
                break;
            }
        }
    }
    ll base = 1;
    ll m_c = 0;
    ll acc = 0;
    /*
    rep(i,n) cerr << num[i] << " ";
    cerr << endl;
    */
    rep(i,n) {
        if (i == 0) {
            for (int j = 1; j < n; j++) {
                out[i][j] = num2[j-1];
            }
        } else {
            ll c = 0;
            rep(j,n) {
                if (i == j) {
                    continue;
                }
                if (out[j][i] != 0) continue;

                out[i][j] = base*num[c];
                m_c = max(m_c,out[i][j]);
                c++;
            }
        }
        ll sum = 0;
        rep(j,n) hoge[j] = 0;
        for (int j = i; j >= 0; j--) {
            int ccnt = 0;
            for (int k = n-1; k > j; k--) {
                if (hoge[k] <= 1 && hoge[j] <= 1) {
                    sum += out[j][k];
                    hoge[k]++;
                    hoge[j]++;
                    ccnt++;
                }
                if (ccnt == 2) break;
            }
        }
        base = sum+1;
        //if (c >= 2) base = base*(num[c-2]+num[c-1]+1);
        //else if (c == 1) base = base*(num[c-1]+1);
        //base = base*(num[4]+num[3]+1);
        //cerr << base << endl;
    }
    cerr << m_c << endl;
    rep(i,n) {
        rep(j,n) {
            out[i][j] = max(out[i][j], out[j][i]);
            cout << out[i][j];
            if (j != n-1) cout << " ";
            else cout << endl;
        }
    }
    int hoge[10];
    rep(i,10) hoge[i] = i;
    unordered_map<ll,int> checker;
    ll val = 0;
    do{ 
        ll cnt = 0;
        rep(i,9) cnt += out[hoge[i]][hoge[i+1]];
        if (checker[cnt] > 1) {
            cerr << "fail" << endl;
            break;
        }
        checker[cnt]++;
        val = max(cnt, val);
    } while(next_permutation(hoge, hoge+n));
    cerr<< val << endl;
}