P27905 [洛谷] [GESP202312 Level 2] Xiao Yang's H-Matrix
普及-
题目描述

Problem Description

Xiao Yang wants to construct an $N \times N$ H-matrix ($N$ is an odd number). Specifically, this matrix has $N$ rows, each containing $N$ characters. The leftmost and rightmost columns are filled with the character |, and the middle row (i.e., the $\frac{N+1}{2}$-th row) has the characters - in the $2 \sim N-1$ positions. All other characters are lowercase letters a. For example, an H-matrix with $N=5$ looks like this:

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

Please help Xiao Yang print the corresponding "H-matrix" based on the given $N$.

Input Format

A single line containing an integer $N$ ($5 \le N \le 49$, ensuring $N$ is an odd number).

Output Format

Output the corresponding "H-matrix".

Please strictly adhere to the output format. Do not add any extra spaces, punctuation, blank lines, or any other symbols. You should output exactly $N$ lines, each containing exactly $N$ characters, which can be either -, |, or a. Your output must exactly match the standard answer to score points, so please check carefully before submitting.

Sample Input and Output

Sample Input #1

5

Sample Output #1

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

Sample Input #2

7

Sample Output #2

|aaaaa|
|aaaaa|
|aaaaa|
|-----|
|aaaaa|
|aaaaa|
|aaaaa|
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
5
样例输出
|aaa| |aaa| |---| |aaa| |aaa|