Problem: In order to do some research, n^2 labs are built on different heights of a mountain. Let's enumerate them with integers from 1 to n^2, such that the lab with the number 1 is at the lowest place, the lab with the number 2 is at the second-lowest place, …, the lab with the number n^2 is at the highest place.

To transport water between the labs, pipes are built between every pair of labs. A pipe can transport at most one unit of water at a time from the lab with the number u to the lab with the number v if u > v.

Now the labs need to be divided into n groups, each group should contain exactly n labs. The labs from different groups can transport water to each other. The sum of units of water that can be sent from a group A to a group B is equal to the number of pairs of labs (u, v) such that the lab with the number u is from the group A, the lab with the number v is from the group B and u > v. Let's denote this value as f(A,B) (i.e. f(A,B) is the sum of units of water that can be sent from a group A to a group B).

For example, if n=3 and there are 3 groups X, Y and Z: X = \{1, 5, 6\}, Y = \{2, 4, 9\} and Z = \{3, 7, 8\}. In this case, the values of f are equal to:

  * f(X,Y)=4 because of 5 → 2, 5 → 4, 6 → 2, 6 → 4, 
  * f(X,Z)=2 because of 5 → 3, 6 → 3, 
  * f(Y,X)=5 because of 2 → 1, 4 → 1, 9 → 1, 9 → 5, 9 → 6, 
  * f(Y,Z)=4 because of 4 → 3, 9 → 3, 9 → 7, 9 → 8, 
  * f(Z,X)=7 because of 3 → 1, 7 → 1, 7 → 5, 7 → 6, 8 → 1, 8 → 5, 8 → 6, 
  * f(Z,Y)=5 because of 3 → 2, 7 → 2, 7 → 4, 8 → 2, 8 → 4. 



Please, divide labs into n groups with size n, such that the value min f(A,B) over all possible pairs of groups A and B (A ≠ B) is maximal.

In other words, divide labs into n groups with size n, such that minimum number of the sum of units of water that can be transported from a group A to a group B for every pair of different groups A and B (A ≠ B) as big as possible.

Note, that the example above doesn't demonstrate an optimal division, but it demonstrates how to calculate the values f for some division.

If there are many optimal divisions, you can find any.

Input

The only line contains one number n (2 ≤ n ≤ 300).

Output

Output n lines:

In the i-th line print n numbers, the numbers of labs of the i-th group, in any order you want.

If there are multiple answers, that maximize the minimum number of the sum of units of water that can be transported from one group the another, you can print any.

Example

Input


3


Output


2 8 5
9 3 4
7 6 1

Note

In the first test we can divide 9 labs into groups \{2, 8, 5\}, \{9, 3, 4\}, \{7, 6, 1\}.

From the first group to the second group we can transport 4 units of water (8 → 3, 8 → 4, 5 → 3, 5 → 4).

From the first group to the third group we can transport 5 units of water (2 → 1, 8 → 7, 8 → 6, 8 → 1, 5 → 1).

From the second group to the first group we can transport 5 units of water (9 → 2, 9 → 8, 9 → 5, 3 → 2, 4 → 2).

From the second group to the third group we can transport 5 units of water (9 → 7, 9 → 6, 9 → 1, 3 → 1, 4 → 1).

From the third group to the first group we can transport 4 units of water (7 → 2, 7 → 5, 6 → 2, 6 → 5).

From the third group to the second group we can transport 4 units of water (7 → 3, 7 → 4, 6 → 3, 6 → 4).

The minimal number of the sum of units of water, that can be transported from one group to another is equal to 4. It can be proved, that it is impossible to make a better division.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
class SegTree {
 public:
  vector<long long> A;
  vector<long long> st;
  int n;
  int left(int i) { return (i << 1); }
  int right(int i) { return (i << 1) + 1; }
  void build(int p, int L, int R) {
    if (L == R)
      st[p] = L;
    else {
      build(left(p), L, (L + R) / 2);
      build(right(p), (L + R) / 2 + 1, R);
      int p1 = st[left(p)];
      int p2 = st[right(p)];
      st[p] = A[p1] >= A[p2] ? p1 : p2;
    }
  }
  SegTree(const vector<long long> &_A) {
    A = _A;
    n = _A.size();
    st.assign(4 * n, -1);
    build(1, 0, n - 1);
  }
  int rmq(int p, int L, int R, int i, int j) {
    if (i > R || j < L) return -1;
    if (L >= i && R <= j) return st[p];
    int p1 = rmq(left(p), L, (L + R) / 2, i, j);
    int p2 = rmq(right(p), (L + R) / 2 + 1, R, i, j);
    if (p1 == -1) return p2;
    if (p2 == -1) return p1;
    return (A[p1] >= A[p2] ? p1 : p2);
  }
  int rmq(int i, int j) {
    if (i < 0) i = 0;
    return rmq(1, 0, n - 1, i, j);
  }
  int getIndex(int p, int L, int R, int pos) {
    if (L == R) return p;
    if (pos <= (L + R) / 2) return getIndex(left(p), L, (L + R) / 2, pos);
    return getIndex(right(p), (L + R) / 2 + 1, R, pos);
  }
  void update(int pos, int value) {
    A[pos] = value;
    pos = getIndex(1, 0, n - 1, pos);
    pos /= 2;
    while (pos != 0) {
      int p1 = st[left(pos)];
      int p2 = st[right(pos)];
      if (p1 >= 0 && p2 >= 0) st[pos] = A[p1] >= A[p2] ? p1 : p2;
      pos /= 2;
    }
  }
};
class UnionFind {
 public:
  vector<int> rank;
  vector<pair<int, int> > p;
  UnionFind(int N) {
    rank.assign(N, 0);
    p.assign(N, pair<int, int>(0, 1));
    for (int i = 0; i < N; i++) p[i].first = i;
  }
  int findSet(int i) {
    return (p[i].first == i) ? i : (p[i].first = findSet(p[i].first));
  }
  bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
  void unionSet(int i, int j) {
    if (!isSameSet(i, j)) {
      int x = findSet(i), y = findSet(j);
      if (rank[x] > rank[y]) {
        p[y].first = x;
        p[x].second += p[y].second;
      } else {
        p[x].first = y;
        p[y].second += p[x].second;
        if (rank[x] == rank[y]) rank[y]++;
      }
    }
  }
  int getMaxId() {
    int maxIn = 0;
    for (int i = 0; i < p.size(); i++)
      if (p[i].second > p[maxIn].second) maxIn = i;
    return maxIn;
  }
  int getNum() {
    set<int> par;
    for (int i = 0; i < p.size(); i++) par.insert(p[i].first);
    return par.size();
  }
};
string getString(char x) {
  string s(1, x);
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    bool fl = true;
    for (int j = 0; j < n; j++) {
      int tmp = i + j;
      if (tmp > n) tmp -= n;
      int res = j * n;
      if (fl) {
        res += n - i + 1;
      } else {
        res += i;
      }
      cout << res;
      fl = 1 - fl;
      if (j != n - 1) cout << " ";
    }
    cout << endl;
  }
}