1204: 蛇形填数

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:38 Solved:23

Description

在 nxn 方阵里填入1,2,3,...,n*n,要求填成蛇形。例如 n=4时 方阵为: 10 11 12 1 9 16 13 2 8 15 14 3 7 6 5 4 其中,n<=20。

Input

输入n

Output

出题述方阵。n行,每行各数之间用一个空格隔开。

Sample Input Copy

4

Sample Output Copy

10 11 12 1
9 16 13 2
8 15 14 3
7 6 5 4