spoj#ALCATRAZ4. THE SHORTEST PATH

THE SHORTEST PATH

YOU ARE GIVEN A 2D GRID WITH EACH CELL CONTAINING AN ALPHABET , YOU HAVE TO START AT ANY POINT AND MOVE EITHER UP,DOW,LEFT AND RIGHT TO CREATE THE WORD "ALCATRAZ" BY PICKING UP ALPHABETS IN ORDER  . AFTER CHOOSING AN ALPHABET , IT GETS REMOVED FROM THERE AND LEAVES AN EMPTY CELL BEHIND . YOU HAVE TO TELL THE MINIMUM NUMBER OF MOVES NEEDED TO DO SO 

Input

2 SPACE SEPERATED INTEGERS N,M ( ROWS AND COLUMNS RESPECTIVELY ) 

1<=  N,M <=500

THEN NEXT N LINES GIVES THE DETAILS OF THE MAZE 

Output

THE SHORTEST PATH AS DESCRIBED IN THE ABOVE PROBLEM 

PRINT "IMPOSSIBLE" (WITHOUT QUOTES) IF YOU CAN'T MAKE UP THAT WORD .

Example

Input:
4 5
AZCLT
AARAL
SJATC
LARAZ
Output:
9
PATH IS AS FOLLOWS : 2,4 - 2,5 - 3,5 - 3,4 - 3,3 - 3,4 - 4,4 - 4,3 - 4,4 - 4,5