Target Practice

No attempts yetTime limit1sMemory limit128 MB

Problem

The Trade Federation is too cheap to buy practice targets for testing the battle droid weapon system. Your job is to write a program that reads an integer specifying the size of a target and prints a target of that size.

A target is a square whose side length is $n$, with an X drawn across the middle. Its characters are as follows.

  • The first and last rows are a border: one |, then $n-2$ dash (minus sign) - characters, then one |.
  • Each of the middle $n-2$ rows is one |, then $n-2$ inner characters, then one |.
  • In the inner $(n-2)\times(n-2)$ grid, index the rows and columns from $0$. A cell holds * if it lies on either diagonal (row == col, or row + col == $n-3$), and a space otherwise. This forms the X.

The following is a target of size $7$.

|-----|
|*   *|
| * * |
|  *  |
| * * |
|*   *|
|-----|

Input

A single odd integer greater than $1$.

Output

The target of the appropriate size.