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 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
mt19937 mt_rand(time(0));
int n;
int rel[25][25], A[25];
int vis[1005], visT;
int b19[19][19] = {
    0,   548, 987, 964, 842, 988, 582, 858, 522, 669, 586, 709, 997, 748, 734,
    717, 789, 886, 982, 548, 0,   535, 512, 390, 536, 130, 406, 70,  217, 134,
    257, 545, 296, 282, 265, 337, 434, 530, 987, 535, 0,   951, 829, 975, 569,
    845, 509, 656, 573, 696, 984, 735, 721, 704, 776, 873, 969, 964, 512, 951,
    0,   806, 952, 546, 822, 486, 633, 550, 673, 961, 712, 698, 681, 753, 850,
    946, 842, 390, 829, 806, 0,   830, 424, 700, 364, 511, 428, 551, 839, 590,
    576, 559, 631, 728, 824, 988, 536, 975, 952, 830, 0,   570, 846, 510, 657,
    574, 697, 985, 736, 722, 705, 777, 874, 970, 582, 130, 569, 546, 424, 570,
    0,   440, 104, 251, 168, 291, 579, 330, 316, 299, 371, 468, 564, 858, 406,
    845, 822, 700, 846, 440, 0,   380, 527, 444, 567, 855, 606, 592, 575, 647,
    744, 840, 522, 70,  509, 486, 364, 510, 104, 380, 0,   191, 108, 231, 519,
    270, 256, 239, 311, 408, 504, 669, 217, 656, 633, 511, 657, 251, 527, 191,
    0,   255, 378, 666, 417, 403, 386, 458, 555, 651, 586, 134, 573, 550, 428,
    574, 168, 444, 108, 255, 0,   295, 583, 334, 320, 303, 375, 472, 568, 709,
    257, 696, 673, 551, 697, 291, 567, 231, 378, 295, 0,   706, 457, 443, 426,
    498, 595, 691, 997, 545, 984, 961, 839, 985, 579, 855, 519, 666, 583, 706,
    0,   745, 731, 714, 786, 883, 979, 748, 296, 735, 712, 590, 736, 330, 606,
    270, 417, 334, 457, 745, 0,   482, 465, 537, 634, 730, 734, 282, 721, 698,
    576, 722, 316, 592, 256, 403, 320, 443, 731, 482, 0,   451, 523, 620, 716,
    717, 265, 704, 681, 559, 705, 299, 575, 239, 386, 303, 426, 714, 465, 451,
    0,   506, 603, 699, 789, 337, 776, 753, 631, 777, 371, 647, 311, 458, 375,
    498, 786, 537, 523, 506, 0,   675, 771, 886, 434, 873, 850, 728, 874, 468,
    744, 408, 555, 472, 595, 883, 634, 620, 603, 675, 0,   868, 982, 530, 969,
    946, 824, 970, 564, 840, 504, 651, 568, 691, 979, 730, 716, 699, 771, 868,
    0};
int b20[20][20] = {};
inline void rd(int &x) {
  x = 0;
  char ch = getchar();
  int f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
int main() {
  rd(n);
  while (true) {
    bool flag = false;
    visT++;
    for (int i = 1; i <= n; ++i) {
      bool d = false;
      for (int T = 1; T <= 1000; ++T) {
        A[i] = mt_rand() % 500 + 1;
        bool h = false;
        for (int j = 1; j < i; ++j)
          if (vis[A[i] + A[j]] == visT) {
            h = true;
            break;
          }
        if (!h) {
          d = true;
          for (int j = 1; j < i; ++j) vis[A[i] + A[j]] = visT;
          break;
        }
      }
      if (!d) {
        flag = true;
        break;
      }
    }
    if (flag) continue;
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j)
        if (i == j)
          printf("0 ");
        else
          printf("%d ", A[i] + A[j]);
      puts("");
    }
    break;
  }
  return 0;
}