There is a robot in the 2D rectangular region $W = \{(x,y) \; | \; 0\le x \le n, 0\le y \le m\}$. Assume that the robot is at $(x,y)$ currently, it can move in the following four directions:
- U : go from $(x,y)$ to $(x,y+1)$ if $(x,y+1) \in W$;
- D : go from $(x,y)$ to $(x,y-1)$ if $(x,y-1) \in W$;
- L : go from $(x,y)$ to $(x-1,y)$ if $(x-1,y) \in W$;
- R : go from $(x,y)$ to $(x+1,y)$ if $(x+1,y) \in W$.
An instruction contains a character $c$ of \`\`U'', \`\`D'', \`\`L'', \`\`R'' and an integer $t\,(1 \le t \le 10^9)$, indicating that the robot moves in the direction $c$ for $t$ times consecutively under the instruction.
Given a list of instructions of length $k$, there are $q$ queries, you should report the final position and the length of the moving route if the robot starts moving from the given position $(x,y)$ and does the $l$\-th, $(l+1)$\-th, $(l+2)$\-th, ..., $r$\-th instructions one by one for each query.