Mr. Kuo is an adventurer. One day, he finds another secret room in a cave.
There is some hint to the password of this room.
Mr. Kuo is given a string S = s1s2...sN consisting of L, R, l, and r.
At first, Mr. Kuo has a string A = "0", a number x = 1, and the cursor is on 0.
For each letter c in S:
The final contents of A is the password. Please help Mr. Kuo find the password.
For example, S = "rRlL", then:
This problem is partial judge, you have to finish the four functions:
(Don't forget to include "function.h" in you code!)
The first contains an integer T -- the number of testcases.
Each of the following line contains a string S.
For testcase 1~3, 1 <= T <= 100, length of S <= 2e5, S contains only L and R.
For testcase 4~6, 1 <= T <= 10, length of S <= 1000, S contains L, R, l, and r.
For testcase 7~9, 1 <= T <= 100, length of S <= 2e5, S contains L, R, l, and r.
For each test case print a string A — the final contents of the password, seperated by spaces.