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 PYTHON3):

Solution:
#Fast IO Region
import os
import sys
from io import BytesIO,IOBase
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# Get out of main functoin
def main():
    pass
# decimal to binary
def binary(n):
    return (bin(n).replace("0b", ""))
# binary to decimal
def decimal(s):
    return (int(s, 2))
# power of a number base 2
def pow2(n):
    p = 0
    while n > 1:
        n //= 2
        p += 1
    return (p)
# if  number is prime in √n time
def isPrime(n):
    if (n == 1):
        return (False)
    else:
        root = int(n ** 0.5)
        root += 1
        for i in range(2, root):
            if (n % i == 0):
                return (False)
        return (True)
# list to string ,no spaces
def lts(l):
    s = ''.join(map(str, l))
    return s
# String to list
def stl(s):
    # for each character in string to list with no spaces -->
    l = list(s)
    # for space in string  -->
    # l=list(s.split(" "))
    return l
# Returns list of numbers with a particular sum
def sq(a, target, arr=[]):
    s = sum(arr)
    if (s == target):
        return arr
    if (s >= target):
        return
    for i in range(len(a)):
        n = a[i]
        remaining = a[i + 1:]
        ans = sq(remaining, target, arr + [n])
        if (ans):
            return ans
# Sieve for prime numbers in a range
def SieveOfEratosthenes(n):
    cnt = 0
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n + 1, p):
                prime[i] = False
        p += 1
    for p in range(2, n + 1):
        if prime[p]:
            cnt += 1
            # print(p)
    return (cnt)
# for positive integerse only
def nCr(n, r):
    f = math.factorial
    return f(n) // f(r) // f(n - r)
# 1000000007
mod = int(1e9) + 7
def ssinp(): return input()
# s=input()
def iinp(): return int(input())
# n=int(input())
def nninp(): return map(int,input().split())
#a,b,c=map(int,input().split())
def llinp(): return list(map(int,input().split()))
# a=list(map(int,input().split()))
def p(xyz): print(xyz)
def p2(a,b): print(a,b)
import math
#import random
#sys.setrecursionlimit(300000)
#from fractions import Fraction
#from collections import OrderedDict
#from collections import deque
########################                         mat=[[0 for i in range(n)] for j in range(m)]                      ########################
########################                         list.sort(key=lambda x:x[1]) for sorting a list according to second element in sublist            ########################
########################                         Speed: STRING < LIST < SET,DICTIONARY                      ########################
########################                         from collections import deque                              ########################
########################                         ASCII of A-Z= 65-90                                        ########################
########################                         ASCII of a-z= 97-122                                       ########################
########################                         d1.setdefault(key, []).append(value)                       ########################
n=iinp()
l=[[] for j in range(n)]
f=c=0
for i in range(n*n,0,-1):
    if(f==0):
        l[c].append(i)
        c+=1
        if(c==n):
            c=n-1
            f=1
    elif(f==1):
        l[c].append(i)
        c-=1
        if(c==-1):
            c=0
            f=0
for i in l:
    print(*i)