In Mog's old neighborhood, buildings are arranged in a grid. Let be the height of the building in row , column .
All heights are distinct, and each integer from through appears exactly once.
Viewed from the front, column appears to have height . Let the sum of these values be . Viewed from the side, row appears to have height . Let the sum of these values be .
Given an integer , construct any arrangement satisfying . If no such arrangement exists, report that it is impossible.
The input is given from Standard Input in the following format:
For each test case, if no valid arrangement exists, print -1 on one line.
Otherwise, print the matrix in lines. The -th line must contain separated by spaces.
The visible heights of the columns are and , while the visible heights of the rows are and . Therefore,
Each case is given in the following format:
If multiple arrangements are possible, print any of them.
| 3 | 29 | . |
| 4 | 53 | No additional constraints. |
so .