Time Limit: 1000 MS    Memory Limit: 65536 K 


Description

In 2-D Cartesian coordinates, the positive direction of x-axis is right and the positive direction of y-axis is up. Now, a dice is in the grid [0, 1] * [0, 1], and we call the position of the dice (0, 0). The face of the dice we can see is the top face of the dice. The top face is 1, the down is 2, the right is 3, the bottom (against the top) is 6, the up (against the down) is 5, the left (against the right) is 4. We have 4 kinds of instructions to change the status of the dice: right s : flip the dice to the right s times, and when s is negative flip it to the left. up s : flip the dice to the up s times, and when s is negative flip to the down. rotate s : rotate the dice s times in clockwise order, and when s is negative in anti-clockwise order. Rotating 1 times means rotate 90 degree. query : query the status of the dice and the output format is : position, the number of top face, the number of the down face, the number of the right face. To get more information by reading the sample. Examples : Assuming the dice is in the initial status before the each of the following instructions. After flipping the dice to right, the top face is 4, the down is 1, the right is 1, the position is (1, 0). After flipping the dice to up, the top face is 2, the down is 6, the right is 3, the position is (0, 1). After rotating the dice one time, the top face is 1, the down is 6, the right is 5, the position is still (0, 0).

Input

One test case containing mutiple lines, and you need to process the the end of file. Each line has an instruction described just now. constraints: s is a 32-bit signed integer.

Output

For each query, output the status of the dice in a single line.

Sample Input

query right 1 query right -1 up 1 query up -1 rotate 1 query

Sample Output

(0, 0): 1 2 3 (1, 0): 4 2 1 (0, 1): 2 6 3 (0, 0): 1 3 5

Author

baihacker