#include <bits/stdc++.h>
using namespace std;
template <typename T1>
void print_list(const T1& a) {
  cerr << a << endl;
}
template <typename T1, typename T2>
void print_list(const T1& a, const T2& b) {
  cerr << a << " " << b << endl;
}
template <typename T1, typename T2, typename T3>
void print_list(const T1& a, const T2& b, const T3& c) {
  cerr << a << " " << b << " " << c << endl;
}
template <typename T1, typename T2, typename T3, typename T4>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d) {
  cerr << a << " " << b << " " << c << " " << d << endl;
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d,
                const T5& e) {
  cerr << a << " " << b << " " << c << " " << d << " " << e << endl;
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
          typename T6>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d, const T5& e,
                const T6& f) {
  cerr << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
          typename T6, typename T7>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d, const T5& e,
                const T6& f, const T7& g) {
  cerr << a << " " << b << " " << c << " " << d << " " << e << " " << f << " "
       << g << endl;
}
template <typename A, typename B>
ostream& operator<<(ostream& out, const pair<A, B>& pp) {
  out << "(" << pp.first << "," << pp.second << ")";
  return out;
}
template <typename A, typename B>
istream& operator<<(istream& in, pair<A, B>& pp) {
  cerr << "A pair wanted" << endl;
  in >> pp.first >> pp.second;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& vect) {
  out << "length = " << vect.size() << endl;
  for (int i = 0; i < vect.size(); i++) out << vect[i] << " ";
  out << endl;
  return out;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& vect) {
  vect.clear();
  int n;
  cerr << "A integer of length wanted" << endl;
  in >> n;
  vect.resize(n);
  cerr << n << " elements wanted" << endl;
  for (int i = 0; i < n; i++) in >> vect[i];
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<vector<T> >& vect) {
  out << "row number=" << vect.size() << endl;
  for (int i = 0; i < vect.size(); i++) {
    out << "row #" << i << ":";
    for (int j = 0; j < vect[i].size(); j++) out << " " << vect[i][j];
    out << endl;
  }
  return out;
}
template <typename T>
istream& operator>>(istream& in, vector<vector<T> >& vect) {
  vect.clear();
  int n, m;
  cerr << "Two integers wnated" << endl;
  in >> n >> m;
  vect.resize(n);
  cerr << "A matrix " << n << " X " << m << " wanted" << endl;
  for (int i = 0; i < n; i++) {
    vect[i].resize(m);
    for (int j = 0; j < m; j++) in >> vect[i][j];
  }
  return in;
}
template <typename T>
inline void updateMax(T& a, const T& b) {
  a = max(a, b);
}
template <typename T>
inline void updateMin(T& a, const T& b) {
  a = min(a, b);
}
template <typename T>
inline vector<T> erase(vector<T> table, int ind) {
  assert(ind < table.size());
  table.erase(table.begin() + ind);
  return table;
}
template <typename T>
vector<T> unique(vector<T> table) {
  sort(table.begin(), table.end());
  return vector<T>(table.begin(), unique(table.begin(), table.end()));
}
template <class T>
vector<T> parse(const string& ss, const char* cut = " ") {
  vector<T> re;
  for (int j = 0; j < ss.size(); j++) {
    string s;
    while (j < ss.size() && NULL == strchr(cut, ss[j])) s += ss[j++];
    if (!s.empty()) {
      T tmp;
      istringstream is(s);
      is >> tmp;
      re.push_back(tmp);
    }
  }
  return re;
}
int countBit(int n) {
  int re = 0;
  while (n) re++, n ^= ((((n) ^ ((n)-1)) & n));
  return re;
}
int MSB(int n) {
  if (n == 0) return 0;
  while (((((n) ^ ((n)-1)) & n)) != n) n ^= ((((n) ^ ((n)-1)) & n));
  return n;
}
void initHash(int n, int hash[]) {
  for (int i = 0; i < n; i++) hash[((1) << (i))] = i;
}
void initBcnt(int n, int bcnt[]) {
  bcnt[0] = 0;
  for (int i = 1; i < ((1) << (n)); i++)
    bcnt[i] = bcnt[i ^ ((((i) ^ ((i)-1)) & i))] + 1;
}
template <typename T>
T __gcd(T n, T m, T& a, T& b) {
  T a1 = 0, b1 = 1;
  a = 1, b = 0;
  while (m) {
    T c = n / m;
    T r = n - m * c;
    T t;
    t = a;
    a = a1;
    a1 = t - c * a1;
    t = b;
    b = b1;
    b1 = t - c * b1;
    n = m;
    m = r;
  }
  return n;
}
struct Node {
  int r, c, d;
  int v;
  Node(int x, int y, int z, int v1) : r(x), c(y), d(z), v(v1){};
  bool operator<(const Node& other) const { return v > other.v; };
};
priority_queue<Node> heap;
const int dir[][2] = {{-1, 0}, {0, 1},  {1, 0},  {0, -1},
                      {1, 1},  {1, -1}, {-1, 1}, {-1, -1}};
const char dname[] = "NWSE";
int ans[100][100];
int main() {
  int n;
  cin >> n;
  int top = 3;
  ans[1][2] = ans[2][1] = 1;
  ans[1][3] = ans[3][1] = 3;
  ans[2][3] = ans[3][2] = 2;
  set<int> mem;
  mem.insert(1);
  mem.insert(2);
  mem.insert(3);
  for (int i = 4; i <= n; i++) {
    bool bad = false;
    for (int delta = 2; delta <= 1000; delta += 2) {
      bad = false;
      ans[i][1] = ans[1][i] = delta / 2 + 1;
      if (mem.count(ans[i][1])) bad = true;
      for (int j = 2; j < i && !bad; j++) {
        ans[i][j] = ans[j][i] = delta + ans[j][1] - ans[i][1];
        if (mem.count(ans[i][j])) bad = true;
      }
      if (!bad) {
        break;
      }
    }
    assert(!bad);
    for (int j = 1; j < i; j++) mem.insert(ans[i][j]);
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i][1];
    for (int j = 2; j <= n; j++) cout << " " << ans[i][j];
    cout << endl;
  }
  assert(mem.size() == n * (n - 1) / 2);
  assert(*mem.rbegin() <= 1000);
  for (int a = 1; a <= n; a++)
    for (int b = a + 1; b <= n; b++)
      for (int c = b + 1; c <= n; c++)
        for (int d = c + 1; d <= n; d++)
          assert(ans[a][b] + ans[c][d] == ans[a][c] + ans[b][d]);
  return 0;
  int per[20];
  for (int i = 1; i <= n; i++) per[i - 1] = i;
  int sum = 0;
  do {
    int t = 0;
    for (int i = 1; i < n; i++) t += ans[per[i - 1]][per[i]];
    t += ans[per[0]][per[n - 1]];
    if (sum == 0)
      sum = t;
    else
      assert(sum == t);
  } while (next_permutation(per, per + n));
  return 0;
}

### Prompt

Please create a solution in cpp to the following problem:

Volodya has recently visited a very odd town. There are N tourist attractions in the town and every two of them are connected by a bidirectional road. Each road has some travel price (natural number) assigned to it and all prices are distinct. But the most striking thing about this town is that each city sightseeing tour has the same total price! That is, if we choose any city sightseeing tour — a cycle which visits every attraction exactly once — the sum of the costs of the tour roads is independent of the tour. Volodya is curious if you can find such price system with all road prices not greater than 1000.

Input

Input contains just one natural number (3 ≤ N ≤ 20) — the number of town attractions.

Output

Output should contain N rows containing N positive integer numbers each — the adjacency matrix of the prices graph (thus, j-th number in i-th row should be equal to the price of the road between the j-th and the i-th attraction). Diagonal numbers should be equal to zero. All numbers should not be greater than 1000. All prices should be positive and pairwise distinct. If there are several solutions, output any of them.

Examples

Input

3


Output

0 3 4 
3 0 5 
4 5 0 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
template <typename T1>
void print_list(const T1& a) {
  cerr << a << endl;
}
template <typename T1, typename T2>
void print_list(const T1& a, const T2& b) {
  cerr << a << " " << b << endl;
}
template <typename T1, typename T2, typename T3>
void print_list(const T1& a, const T2& b, const T3& c) {
  cerr << a << " " << b << " " << c << endl;
}
template <typename T1, typename T2, typename T3, typename T4>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d) {
  cerr << a << " " << b << " " << c << " " << d << endl;
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d,
                const T5& e) {
  cerr << a << " " << b << " " << c << " " << d << " " << e << endl;
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
          typename T6>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d, const T5& e,
                const T6& f) {
  cerr << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
          typename T6, typename T7>
void print_list(const T1& a, const T2& b, const T3& c, const T4& d, const T5& e,
                const T6& f, const T7& g) {
  cerr << a << " " << b << " " << c << " " << d << " " << e << " " << f << " "
       << g << endl;
}
template <typename A, typename B>
ostream& operator<<(ostream& out, const pair<A, B>& pp) {
  out << "(" << pp.first << "," << pp.second << ")";
  return out;
}
template <typename A, typename B>
istream& operator<<(istream& in, pair<A, B>& pp) {
  cerr << "A pair wanted" << endl;
  in >> pp.first >> pp.second;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& vect) {
  out << "length = " << vect.size() << endl;
  for (int i = 0; i < vect.size(); i++) out << vect[i] << " ";
  out << endl;
  return out;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& vect) {
  vect.clear();
  int n;
  cerr << "A integer of length wanted" << endl;
  in >> n;
  vect.resize(n);
  cerr << n << " elements wanted" << endl;
  for (int i = 0; i < n; i++) in >> vect[i];
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<vector<T> >& vect) {
  out << "row number=" << vect.size() << endl;
  for (int i = 0; i < vect.size(); i++) {
    out << "row #" << i << ":";
    for (int j = 0; j < vect[i].size(); j++) out << " " << vect[i][j];
    out << endl;
  }
  return out;
}
template <typename T>
istream& operator>>(istream& in, vector<vector<T> >& vect) {
  vect.clear();
  int n, m;
  cerr << "Two integers wnated" << endl;
  in >> n >> m;
  vect.resize(n);
  cerr << "A matrix " << n << " X " << m << " wanted" << endl;
  for (int i = 0; i < n; i++) {
    vect[i].resize(m);
    for (int j = 0; j < m; j++) in >> vect[i][j];
  }
  return in;
}
template <typename T>
inline void updateMax(T& a, const T& b) {
  a = max(a, b);
}
template <typename T>
inline void updateMin(T& a, const T& b) {
  a = min(a, b);
}
template <typename T>
inline vector<T> erase(vector<T> table, int ind) {
  assert(ind < table.size());
  table.erase(table.begin() + ind);
  return table;
}
template <typename T>
vector<T> unique(vector<T> table) {
  sort(table.begin(), table.end());
  return vector<T>(table.begin(), unique(table.begin(), table.end()));
}
template <class T>
vector<T> parse(const string& ss, const char* cut = " ") {
  vector<T> re;
  for (int j = 0; j < ss.size(); j++) {
    string s;
    while (j < ss.size() && NULL == strchr(cut, ss[j])) s += ss[j++];
    if (!s.empty()) {
      T tmp;
      istringstream is(s);
      is >> tmp;
      re.push_back(tmp);
    }
  }
  return re;
}
int countBit(int n) {
  int re = 0;
  while (n) re++, n ^= ((((n) ^ ((n)-1)) & n));
  return re;
}
int MSB(int n) {
  if (n == 0) return 0;
  while (((((n) ^ ((n)-1)) & n)) != n) n ^= ((((n) ^ ((n)-1)) & n));
  return n;
}
void initHash(int n, int hash[]) {
  for (int i = 0; i < n; i++) hash[((1) << (i))] = i;
}
void initBcnt(int n, int bcnt[]) {
  bcnt[0] = 0;
  for (int i = 1; i < ((1) << (n)); i++)
    bcnt[i] = bcnt[i ^ ((((i) ^ ((i)-1)) & i))] + 1;
}
template <typename T>
T __gcd(T n, T m, T& a, T& b) {
  T a1 = 0, b1 = 1;
  a = 1, b = 0;
  while (m) {
    T c = n / m;
    T r = n - m * c;
    T t;
    t = a;
    a = a1;
    a1 = t - c * a1;
    t = b;
    b = b1;
    b1 = t - c * b1;
    n = m;
    m = r;
  }
  return n;
}
struct Node {
  int r, c, d;
  int v;
  Node(int x, int y, int z, int v1) : r(x), c(y), d(z), v(v1){};
  bool operator<(const Node& other) const { return v > other.v; };
};
priority_queue<Node> heap;
const int dir[][2] = {{-1, 0}, {0, 1},  {1, 0},  {0, -1},
                      {1, 1},  {1, -1}, {-1, 1}, {-1, -1}};
const char dname[] = "NWSE";
int ans[100][100];
int main() {
  int n;
  cin >> n;
  int top = 3;
  ans[1][2] = ans[2][1] = 1;
  ans[1][3] = ans[3][1] = 3;
  ans[2][3] = ans[3][2] = 2;
  set<int> mem;
  mem.insert(1);
  mem.insert(2);
  mem.insert(3);
  for (int i = 4; i <= n; i++) {
    bool bad = false;
    for (int delta = 2; delta <= 1000; delta += 2) {
      bad = false;
      ans[i][1] = ans[1][i] = delta / 2 + 1;
      if (mem.count(ans[i][1])) bad = true;
      for (int j = 2; j < i && !bad; j++) {
        ans[i][j] = ans[j][i] = delta + ans[j][1] - ans[i][1];
        if (mem.count(ans[i][j])) bad = true;
      }
      if (!bad) {
        break;
      }
    }
    assert(!bad);
    for (int j = 1; j < i; j++) mem.insert(ans[i][j]);
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i][1];
    for (int j = 2; j <= n; j++) cout << " " << ans[i][j];
    cout << endl;
  }
  assert(mem.size() == n * (n - 1) / 2);
  assert(*mem.rbegin() <= 1000);
  for (int a = 1; a <= n; a++)
    for (int b = a + 1; b <= n; b++)
      for (int c = b + 1; c <= n; c++)
        for (int d = c + 1; d <= n; d++)
          assert(ans[a][b] + ans[c][d] == ans[a][c] + ans[b][d]);
  return 0;
  int per[20];
  for (int i = 1; i <= n; i++) per[i - 1] = i;
  int sum = 0;
  do {
    int t = 0;
    for (int i = 1; i < n; i++) t += ans[per[i - 1]][per[i]];
    t += ans[per[0]][per[n - 1]];
    if (sum == 0)
      sum = t;
    else
      assert(sum == t);
  } while (next_permutation(per, per + n));
  return 0;
}

```