Gerald has n younger brothers and their number happens to be even. One day he bought n^2 candy bags. One bag has one candy, one bag has two candies, one bag has three candies and so on. In fact, for each integer k from 1 to n^2 he has exactly one bag with k candies. 

Help him give n bags of candies to each brother so that all brothers got the same number of candies.


-----Input-----

The single line contains a single integer n (n is even, 2 ≤ n ≤ 100) — the number of Gerald's brothers.


-----Output-----

Let's assume that Gerald indexes his brothers with numbers from 1 to n. You need to print n lines, on the i-th line print n integers — the numbers of candies in the bags for the i-th brother. Naturally, all these numbers should be distinct and be within limits from 1 to n^2. You can print the numbers in the lines in any order. 

It is guaranteed that the solution exists at the given limits.


-----Examples-----
Input
2

Output
1 4
2 3



-----Note-----

The sample shows Gerald's actions if he has two brothers. In this case, his bags contain 1, 2, 3 and 4 candies. He can give the bags with 1 and 4 candies to one brother and the bags with 2 and 3 to the other brother.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
l = 0
r = n * n - 1

for i in range(n):
    for k in range(n // 2):
        print(l + 1, end = ' ')
        print(r + 1, end = ' ')
        l += 1
        r -= 1
    print()


n = int(input())
a = 1
b = n * n
for i in range(n):
    for j in range(n // 2):
        print(a, b, end = ' ')
        a += 1
        b -= 1
    print()

def __starting_point():
    N = int(input())
    st = 1
    en = N*N
    for i in range(N):
        for j in range(N//2):
            print (st,end=" ")
            st+=1
            print (en,end=" ")
            en-=1
        print()

__starting_point()

def get_candies(n):
    result = []
    bags = list(range(1, n**2 +1))

    for i in range(n):
        each = []
        for times in range(int(n / 2)):
            each.append(bags[0])
            each.append(bags[-1])
            bags = bags[1:len(bags)-1]
        each.sort()
        result.append(each)

    return result


def main():
    n = int(input())
    


    result = get_candies(n)
    
    for i in range(len(result)):
        string = ""
        for value in result[i]:
            string += str(value)
            string += " "
        print(string)
        
        
    

#import doctest
#doctest.testmod()
main()   


n = int(input())
a = int(n ** 2 + 1)
t = 1

for i in range(1, n+1):
    for j in range(int(n/2) - 1):
        print('%d %d' % (t, a - t), end = ' ')
        t += 1
    print('%d %d' % (t, a - t))
    t += 1

n = int(input())
a = int(n ** 2 + 1)
t = 1

for i in range(n):
    for j in range(int(n/2) - 1):
        print('%d %d' % (t, a - t), end = ' ')
        t += 1
    print('%d %d' % (t, a - t))
    t += 1

n = int(input())
cnt1 = 1
cnt2 = n ** 2
arr = []
for i in range(n * n // 2):
    arr.append([cnt1, cnt2])
    cnt1 += 1
    cnt2 -= 1
for i in range(0, len(arr), n // 2):
    for j in range(n // 2):
        print(arr[i + j][0], arr[i + j][1], sep=' ', end=' ')
    print('')

n = input()
n = int(n)
bags = []
for i in range(n**2):
	bags.append(i + 1)

start = 0
end = -1
step = int(n / 2)

for i in range(n):
	for j in range(start, start + step):
		print(bags[j], end=' ')
	start += step
	for j in range(end, end - step, -1):
		print(bags[j], end=' ')
	end -= step
	print('')	


n = int(input())
t1, t2 = 1, n ** 2
for i in range(0, n):
    for j in range(0, n, 2):
        print(t1, t2, sep = ' ', end = ' ')
        t1 += 1
        t2 -= 1
    print('')

n = int(input())
p = 0
for i in range(n):
    for j in range(int(n/2)):
        p += 1
        print(p,n*n-p+1,end=" ")
    print()


n = int(input()) 
vec = [x + 1 for x in range(n * n)]
m = n // 2;
for i in range(n):
    for j in range(m):
        print(vec[i * m + j], end = " ")
        print(vec[-(i * m + j + 1)], end = " ");
    print();


n = int(input())
left = 1
right = n ** 2
for i in range(n):
    for j in range(n // 2):
        print(left, right, end=' ')
        left, right = left + 1, right - 1
    print()

def solve(n):
  start = 1
  end = n*n
  halfN = n // 2
  while(n):
    line = ""
    i=0
    while(i<halfN):
      line += str(start) + " "
      start += 1
      i += 1
    i=0
    while(i<halfN):
      line += str(end) + " "
      end -= 1
      i += 1
    n -= 1
    print(line)

n = int(input())

solve(n)