#P365. 【例63.1】 蛇形填数

【例63.1】 蛇形填数

Description

Fill an n×nn \times n matrix with numbers 11, 22, 33, ..., n×nn \times n in a snake-like pattern. For example, when n=4n=4, the matrix looks like:

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

Where $n \le 20$.

Input Format

Input nn.

Output Format

Output the matrix as described. nn lines, with numbers in each line separated by a single space.

Sample

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