# n = int(input())
# for i in range(0, n):
# for j in range(1, n+1):
# print(n*j-i, end=' ')
# print()
# n = int(input())
#
# data = []
# for i in range(n):
# v = [0] * n
# data.append(v)
#
# k = 1
#
# for i in range(n): #줄
# for j in range(n): #가로
# data[j][i] = k
# k += 1
#
# for i in range(n-1, -1, -1):
# for j in range(n):
# print(data[i][j], end=' ')
# print()
# n, m = map(int, input().split())
#
# data = []
# for i in range(n):
# v = [0] * m
# data.append(v)
#
# k = 1
#
# for i in range(n):
# for j in range(m):
# data[i][j] = k
# k += 1
#
# for i in range(n-1, -1, -1):
# for j in range(m-1, -1, -1):
# print(data[i][j], end=' ')
# print()
# n, m = map(int, input().split())
#
# data = []
# for i in range(n):
# v = [0] * m
# data.append(v)
#
# k = 1
#
# for i in range(n):
# for j in range(m):
# data[i][j] = k
# k += 1
#
# for i in range(n-1, -1, -1):
# for j in range(0, m):
# print(data[i][j], end=' ')
# print()
# n, m = map(int, input().split())
#
# data = []
# for i in range(n):
# v = [0] * m
# data.append(v)
#
# k = 1
#
# for i in range(m):
# for j in range(n):
# data[j][i] = k
# k += 1
#
# for j in range(n-1, -1, -1):
# for i in range(m-1, -1, -1):
# print(data[j][i], end=' ')
# print()