Young Marin, now already a respectable star of Croatian cinematography, spends his free time looking out the window. Unfortunately for him, the same activity is also taken up by a few flies that have landed on his window and are looking into the distance. Marin immediately hurried to get his square racket for killing flies. At the same time, he wondered how many flies it is possible to kill in one shot. After trying to scare away the flies unsuccessfully for a few hours, he decided to ask for your help.
Marin has sent you a picture of his window, the dimensions being
Input
The first line of input contains three integers
Each of the following *
denote the position of a fly, whereas all the other pixels are marked with .
and denote
empty space. On his window, there is at least one fly that Marin can kill with his racket.
Output
The first line of output must contain the maximal number of flies Marin can kill in a single shot.
The following -
and the vertical ones with |
, whereas angles are denoted with +
. For a more
detailed explanation, consult the sample tests.
Please note: Marin's racket will affect only the flies located strictly inside the racket, and the racket must be located inside the window with all its parts. In other words, it is assumed that the flies located at the sides of the racket will have enough time to fly away.
Scoring
In test cases worth
Sample Input 1
3 5 3
.....
.*.*.
.....
Sample Output 1
1
+-+..
|*|*.
+-+..
Sample Input 2
7 6 4
......
.*.*.*
......
.*.*..
..*...
..*...
*....*
Sample Output 2
2
......
.*.*.*
+--+..
|*.|..
|.*|..
+--+..
*....*
Sample Input 3
9 9 6
***......
......*.*
.*....*..
..*...*..
..*.*....
..*....*.
.....*...
.*...***.
.........
Sample Output 3
6
***......
......*.*
.*....*..
..*+----+
..*|*...|
..*|...*|
...|.*..|
.*.|.***|
...+----+
Comments