URI Online Judge | 1435

Square Matrix I

Adapted by Josué P. de Castro Brazil
Timelimit: 2

Write a program that read an integer number N (0 ≤ N ≤ 100) that correspond to the order of a Bidimentional array of integers, and build the Array according to the above example.

Input

The input consists of several integers numbers, one per line, corresponding to orders from arrays to be built. The end of input is indicated by zero (0).

Output

For each integer number of input, print the corresponding array according to the example. (the values ​​of the arrays must be formatted in a field of size 3 right justified and separated by a space. None space must be printed after the last character of each row of the array. A blank line must be printed after each array.

Sample Input Sample Output

1
2
3
4
5
0

  1
 
  1   1
  1   1
 
  1   1   1
  1   2   1
  1   1   1
   
  1   1   1   1
  1   2   2   1
  1   2   2   1
  1   1   1   1
 
  1   1   1   1   1
  1   2   2   2   1
  1   2   3   2   1
  1   2   2   2   1
  1   1   1   1   1