The first line contains two integers $n$ and $m$ ($2 \le n, m \le 500$) --- the dimensions of the apartment.

The second line contains the string $s$ ($1 \le |s| \le 2nm$, $s_i \in \{\texttt{D}, \texttt{R}, \texttt{U}\}$) --- the description of the exercise.

The $i$-th of the following $n$ lines contains $a_{i,1}, a_{i,2}, \ldots, a_{i, m}$ ($a_{i,j} \in \{\texttt{\#}, \texttt{.}\}$) --- the description of the turtle's apartment.