Given , you must build an matrix consisting of integer values from to .
Each value should appear exactly times in the matrix.
The score of an array is defined as the greatest frequency of one element in the array. The score of a matrix is defined as the minimum score over all rows and columns.
Build a matrix with the greatest possible score.
Input:
The first line contains an integer, representing .
Output:
Print lines each containing integers.
Notes and constaints:
Let be the optimal score for a test and be your score for a certain test case.
Then the test will be graded with points.
The maximum frequency in is . The maximum frequency in is . The maximum frequency in is .
Therefore, the score of this matrix is and this is the best that we can, for .