Goal
The 12 year old child has lost his mother and now he wants to meet his mother. He can move horizontally or vertically but not diagonally. In order to help him you have to tell him the exact shortest distance. Each block = 10km.
Input
10 lines: A string row for one row of the map, which consists of the following characters only:
. means a road where the child can move.
# means a wall that the child cannot pass through.
M is the position of the mother.
C is the position of the child.
Output
Line 1: An integer for the shortest distance which the child has to travel in order to reach his mother, followed by km.
Constraints
There will always be a solution.
Example
Input
..........
M....C....
..........
..........
..........
..........
..........
..........
..........
..........