NASSA's Robot

No attempts yetTime limit1sMemory limit128 MB

Problem

NASSA's robot landed on Mars. The landing site can be modeled as an infinite two-dimensional plane with perpendicular XX and YY axes.

The robot keeps reporting its location back to Earth. Because of a serious design flaw it reports the moves it makes instead of the coordinates of its exact location, and some of the signals went missing before they reached the receiver.

During one exploration mission the robot sent a sequence of signals that can be written as a string over the characters U, R, D, L and ?. U is a step up (YY increases by 11), R is a step right (XX increases by 11), D is a step down (YY decreases by 11), L is a step left (XX decreases by 11), and ? is a missed signal. Every character of the string is a single step in the corresponding direction. A missed signal is a single step in one of the four directions. Before the robot starts sending the signals it is at XX coordinate 00 and YY coordinate 00.

After sending some of the signals while moving, the robot's software crashed and it could not move any further. The researchers at the base want to narrow down the area they have to search. In other words, they want the minimum possible XX coordinate, the minimum possible YY coordinate, the maximum possible XX coordinate and the maximum possible YY coordinate of the place where the robot stopped.

Each of the four values is computed on its own. A single final position does not have to attain all four at once.

Input

The input contains several test cases. The first line holds one integer TT, the number of test cases (1T1001 \le T \le 100). Each of the next TT lines holds one non-empty string of at most 100000100\,000 characters, and each character is U, R, D, L or ?. This string is the sequence of signals described above.

Output

For each test case print one line with four integers separated by single spaces: the minimum possible XX coordinate, the minimum possible YY coordinate, the maximum possible XX coordinate and the maximum possible YY coordinate of the place where the robot stopped.