F. Fine arts museum
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Students of Voronezh State University not only participate in various programming competitions. This time, in another city, Nikita suggested visiting the fine arts museum. Out of all the paintings, he was most impressed by the works of Ivan Shishkin. Inspired by the great Russian painter, Nikita decided to create his own masterpiece in the form of an ASCII drawing. For the ASCII drawing to be a masterpiece, it must have the following:

  1. The drawing is framed by a rectangular border, which consists of the characters '+' at the corners, '-' on the horizontal borders, and '|' on the vertical borders.
  2. The drawing depicts $$$n$$$ trees. Each tree consists of a trunk and a crown, which are defined by the parameters $$$s_{i}$$$ and $$$t_{i}$$$. The trunk of the tree is made up of $$$s_{i}$$$ characters '|', with the very bottom of the trunk necessarily drawn from the bottom border of the frame. Trees come in three types depending on the character that makes up the crown of the tree. The crown of the tree is an isosceles triangle with a height of $$$t_{i} + 1$$$ and a base of $$$2 \cdot t_{i} + 1$$$, which borders the top part of the trunk and consists of identical characters $$$c$$$. The trunk of the tree is exactly in the middle of the base of the crown's triangle. Depending on the type of tree, the character $$$c$$$ is equal to '*', '+' or '#'. For a better understanding of how a tree is drawn, please refer to the figure.
  3. Each tree fits completely within the drawing, meaning the drawings of the trees and the frame borders do not intersect but may touch.
  4. If any two trees touch with their crowns, they are of different types. Trees $$$x$$$ and $$$y$$$ touch with their crowns if there is a crown character belonging to tree $$$x$$$, which has an adjacent side character of the crown belonging to tree $$$y$$$.
  5. The rectangular frame of the drawing has the smallest possible perimeter.
  6. Characters inside the frame that do not belong to any of the trees are spaces (i.e., the character with ASCII code $$$32$$$).
Correct tree drawings.
Incorrect tree drawings.
Correct (left) and incorrect (right) ASCII drawings.

Given $$$n$$$ trees, tell us what Nikita's masterpiece will look like!

If there are several possible answers that fit all of the above conditions, any of them may be output.

Input

The first line contains a single integer $$$n$$$ ($$$1 \le n \le 8$$$) – the number of trees.

The following $$$n$$$ lines contain two integers $$$s_{i}$$$ and $$$t_{i}$$$ ($$$1 \le s_{i}, t_{i} \le 10$$$) – the parameters of the $$$i$$$-th tree.

Output

Output the ASCII drawing.

The output data should not contain any extra characters that do not belong to the drawing!

Examples
Input
3
1 1
2 2
3 3
Output
+-----------+
|   +       |
|  +++      |
| +++++  *  |
|+++++++*** |
| # |  *****|
|###|    |  |
| | |    |  |
+-----------+
Input
4
1 1
1 1
1 1
1 1
Output
+------------+
| +  *  +  * |
|+++***+++***|
| |  |  |  | |
+------------+