Magic square is an $n$ by $n$ square grid where each cell of the grid contains distinct integers in the range

$1, 2, \cdots, n^ 2$ , and the sum of each row, column and diagonal is equal.

To create an $n$ by $n$ magic square($n$ is odd), you have to fill in $1, 2, \cdots, n^ 2$ accordingly with the following steps:

- Put $1$ in the middle of the first row.
- If upper-right cell is empty, move to the upper-right cell, move downward otherwise. And if it is out of the boundary, jump to opposite of the square grid.
- Fill in the next integer.
- If still haven’t reach $n^ 2$ yet, go to step 2.

A positive odd integer $n(n\leq1001)$

An $n\times n$ magic square which is generated by the previous steps. Notice that integers in the same row are separated by a single white space, and each row should end with a new line character(‘\n’).

3

8 1 6

3 5 7

4 9 2

3 5 7

4 9 2

No. | Testdata Range | Score |
---|---|---|

1 | 0~5 | 100 |

No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|

0 | 1000 | 65536 | 65536 | |

1 | 1000 | 65536 | 65536 | |

2 | 1000 | 65536 | 65536 | |

3 | 1000 | 65536 | 65536 | |

4 | 1000 | 65536 | 65536 | |

5 | 1000 | 65536 | 65536 |