L. Looking for Waldo
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

You may know the game Where is Waldo?. In this game you need to find a person named Waldo in a crowd of people. This problem is kind of similar. You need to find an axis-aligned rectangle of minimal area which contains the letters W, A, L, D and O and those letters are hidden in a crowd of other letters.

Illustration of the second sample case.
Input

The input consists of:

  • One line with two integers $$$h$$$ and $$$w$$$ $$$(1\leq h, w \leq 10^5$$$, $$$h\cdot{}w \leq 10^5)$$$, the height and width of the grid of letters.
  • $$$h$$$ lines, each with $$$w$$$ upper case letters A-Z, the grid of letters.
Output

Output the area of the smallest axis-aligned rectangle which contains at least one of each of the letters W, A, L, D and O. If there is no rectangle containing those letters, output impossible.

Examples
Input
5 5
ABCDE
FGHIJ
KLMNO
PQRST
VWXYZ
Output
25
Input
5 10
ABCDEABCDE
FGHIJFGHIJ
KLMNOKLMNO
PQRSTPQRST
VWXYZVWXYZ
Output
20
Input
5 10
WAALDLODOW
AWWLAOODOW
LOLADOWALO
ADALLLWWOL
WWOOAAAALO
Output
5
Input
2 3
WAL
TER
Output
impossible