This time your job is to fill a sequence of positive integers into a spiral matrix in non-increasing order. A spiral matrix is filled in from the first element at the upper-left corner, then move in a clockwise spiral. The matrix has rows and columns, where and satisfy the following: must be equal to ; ; and is the minimum of all the possible values.
Input Specification
Each input file contains one test case. For each case, the first line gives a positive integer . Then the next line contains positive integers to be filled into the spiral matrix. All the numbers are no more than . The numbers in a line are separated by spaces.
Output Specification
For each test case, output the resulting matrix in lines, each contains numbers. There must be exactly 1 space between two adjacent numbers, and no extra space at the end of each line.