A farmer has a plot of land with some holes. The farmer wants to build a paling around the largest possible rectangular area that does not contain any holes. What is the perimeter of this largest rectangular area?
The input consists of two lines. The first line contains two space-separated integers, m and n, the number of rows and columns in the grid, respectively. The second line contains m strings, each of length n, representing the grid. Each character in the grid is either a '.' (representing good land) or an 'x' (representing a hole).
The output consists of a single integer, the perimeter of the largest possible rectangular area that does not contain any holes. If such an area cannot be constructed, output the string "impossible". Constraints: 1ā¤m,nā¤200 samples:
4 5 ..... .x.x. ..... .....
14
2 2 .x x.
Impossible
2 5 ..... xxxx. ###Sample Output: Impossible