e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Spiral

Spiral

Output the square, consisting of NxN cells filled with numbers from 1 to N2 in a spiral (see examples).

Input

The first line is a single numberN (2N100).

Output

We derive N rows of N numbers, separated by spaces. Not allowed to start a spiral in the other, except in the upper left-hand corner, spinning spiral counterclockwise, or outward.

Time limit 1 second
Memory limit 64 MiB
Input example #1
2
Output example #1
1 2
4 3