The drone is located on the coordinate plane and starts its movement from the point . Every second, it moves one unit along either the or axis. Movement is possible in both directions along each axis. After executing all movement commands, the drone explodes at the end of its path. Determine the coordinates at which the drone explodes.
On the axis, forward movement is indicated by ">", and backward movement is indicated by "<".
On the axis, forward movement is indicated by "^", and backward movement is indicated by "v".
The first line contains one integer (1 \leq t \leq 100) — the number of test cases.
Each of the following lines contains a string (1 \leq |s| \leq 1000) indicating the movement of the drone. Here, denotes the length of the string .
For each test case, print on a separate line two integers — the and coordinates of the drone explosion.
Example 1