LearnPy Hub
← Arena
IntermediateRating 1300

Fill a Spiral

Fill an n×n grid with 1, 2, ..., n² in clockwise spiral order starting at the top-left, and print it with numbers separated by spaces.

Input

One integer n (1–10).

Output

n lines.

Sample 1

Input
3
Output
1 2 3
8 9 4
7 6 5

Sample 2

Input
1
Output
1
solution.py
Output appears here
Fill a Spiral · Python Arena problem · LearnPy Hub