#t53. 小杨的 H 字矩阵

小杨的 H 字矩阵

Xiao Yang's H-Matrix

Problem Description

Xiao Yang wants to construct an N×NN \times N H-shaped matrix (NN is odd). Specifically, this matrix has NN rows, each with NN characters, where the leftmost column and the rightmost column are both |, and the middle row (i.e. the N+12\frac{N+1}{2}-th row) has its 2nd to (N−1)(N-1)-th characters all -, while all remaining characters are the lowercase half-width letter a. For example, an N=5N=5 H-matrix is as follows:

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

Please help Xiao Yang print the corresponding "H-matrix" for a given NN.

Input Format

One line with an integer NN (5≤N≤495\le N \le 49, it is guaranteed that NN is odd).

Output Format

Output the corresponding "H-matrix".

Strictly follow the required format; do not add any spaces, punctuation, blank lines, or any other symbols on your own. You must output exactly NN rows, each containing exactly NN characters besides the newline, and each character is either -, |, or a. Your output must match the standard answer exactly to score, so please check carefully before submitting.

Sample Input 1

5

Sample Output 1

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

Sample Input 2

7

Sample Output 2

|aaaaa|
|aaaaa|
|aaaaa|
|-----|
|aaaaa|
|aaaaa|
|aaaaa|

Sample Explanation

For N=5N=5:

  • Rows 1, 2, 4, and 5: leftmost and rightmost are |, with the middle 33 characters being a, i.e. |aaa|.
  • Row 3 is the middle row (5+12=3\frac{5+1}{2}=3); besides the leading and trailing |, columns 2 to 4 are all -, so it is |---|. So the output is as shown in the sample.

Constraints

  • 5≤N≤495 \le N \le 49, and NN is odd.