Bypass matrix with "snake"#138

Bypass matrix with "snake"

1 second
128 megabytes
Very easy (≈850)

For a given number n fill the square matrix of size n * n with integers from 1 to n^2 as follows:

Input

One integer n (1 ≤ n ≤ 100).

Output

Print the filled matrix in the form of n rows by n integers each.

Examples

Example 1

Loading
Loading