Changyoung was walking on a coordinate plane in a dream. He starts at the origin (0, 0), and his destination is (A, B). He always stands on integer coordinates, and his size is small enough to ignore.
In one move, he can move from the current point to one of the four adjacent points: up, down, left, or right. For example, moving up from (x, y) goes to (x, y + 1), and moving left goes to (x - 1, y).
If his current position is (x, y), the distance to the destination (A, B) is defined as follows.
d((x, y), (A, B)) = |x - A| + |y - B|
Changyoung woke up before reaching the destination and wrote down every move he made in the dream. Now he wants to delete one non-empty contiguous segment from the move sequence. After performing the remaining moves in order, the following two conditions must hold.
0 <= x <= A and 0 <= y <= B.Given the recorded move sequence, determine which contiguous segment should be deleted.
The first line contains the destination coordinates A and B. (1 <= A, B <= 4000)
The second line contains the number of moves N. (1 <= N <= 8000)
The third line contains a string of length N. Each character describes one move: R for right, L for left, U for up, and D for down.
The input is guaranteed to allow the conditions to be satisfied by deleting at least one contiguous segment.
Print K and L separated by a space on the first line. (1 <= K <= L <= N)
This means that the moves from the K-th move through the L-th move, inclusive, should be deleted.