#B3924. H Matrix Construction

    ID: 11581 Type: Default 1000ms 256MiB

H Matrix Construction

H Matrix Construction

Given an odd integer \(N\), construct an \(N\times N\) H matrix. The matrix has \(N\) rows and \(N\) columns. The first and last columns of every row are the pipe character (|). The middle row, i.e. the \(\frac{N+1}{2}\)th row, has the characters from the 2nd to the \(N-1\)th column replaced with a hyphen (-). All other characters in the matrix are the lowercase letter 'a'.

For example, when \(N = 5\), the output should be:

|aaa|
|aaa|
|---|
|aaa|
|aaa|

inputFormat

The input consists of a single line containing an odd integer \(N\).

outputFormat

Output the constructed H matrix with \(N\) rows. Each row should exactly follow the pattern described, with no extra spaces or lines.

sample

3
|a|

|-| |a|

</p>