#B3955. Ri Matrix Pattern

    ID: 11612 Type: Default 1000ms 256MiB

Ri Matrix Pattern

Ri Matrix Pattern

Little Yang wants to construct an N×NN\times N Ri Matrix (with NN being an odd number). The matrix has NN rows and NN columns. In each row, the first and the last characters are always |. For the first row, the last row, and the middle row (i.e. the N+12\frac{N+1}{2}-th row), the characters from the 2nd to the (N1)(N-1)-th positions are -. All the remaining positions are filled with the lowercase letter x.

For example, when N=5N=5, the matrix is:

|---|
|xxx|
|---|
|xxx|
|---|

inputFormat

A single integer NN (an odd number) representing the size of the matrix.

outputFormat

Print the N×NN\times N Ri matrix as described. Each row should be printed on a new line.

sample

3
|-|

|-| |-|

</p>