|Author:||A. Klenin||Time limit:||1 sec|
|Input file:||input.txt||Memory limit:||256 Mb|
Rectangular jigsaw puzzle consists of two pieces.
Each piece is a 4-connected set of square cells,
each cell represented by character '
X' or '
Your program must determine whether it is possible to separate puzzle pieces by moving either of them in vertical or horizontal direction.
In the first sample it is possible to separate pieces
by moving '
X' piece up and/or '
O' piece down.
First line of input contains two integers W H. Following H lines contain W characters each — puzzle representation.
Output must contain a single string
1 ≤ W, H ≤ 100. Each piece contains at least one cell.
|No.||Input file (
||Output file (|