A marble sits on an open cell of an R by C maze. Each cell is open (.) or a wall (#). You apply a sequence of tilts, each U, D, L, or R. On a tilt, the marble rolls in that direction, passing over open cells, and does not stop until the next cell in that direction is a wall or lies outside the maze; it then rests on the last open cell it reached. A tilt where the marble cannot move at all leaves it in place. Row 0 is the top, column 0 is the left.
Input format
Line 1: two integers R and C.
Next R lines: each a string of C characters, or .
Next line: two integers , the starting open cell.
Next line: a non-empty string of tilts over , , , .
Output format
A single line r c: the marble's final resting cell.
Constraints
- 2 <= R, C <= 100
- 1 <= number of tilts <= 100000