Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

Problem hidden

REVENG - Reverse Engineering

no tags 

 

Reverse-Engineer
Reverse Engineering is about working backwards to question from answer. 
In this situation there exists a compiled program P. P controls the state of indicator. This indicator is a single bar charecter which takes one of the 4 states : '|', '-', '/', '\'. This program is given a sequence of instructions of the form <instr> <persistance> 
where <instr> represents one of 4 possible actions and <persistance> is the number of seconds the state persists once action executed. 
The 3 possible actions are ( bar state sequence is '/','-','\','|' ): 
- 'L' : Shift Left. If the bar is in state '|' it goes to '\'. State '\' goes to '-'. State '-' goes to '/'. State '/' goes to '|'.
- 'R' : Shift Right. If the bar is in state '|' it goes to '/'. State '/' goes to '-'. State '-' goes to '\'. State '\' goes to '|'.
- 'F' : Flip. If the bar is in state '|' it goes to '-'. State '-' goes to '|'. State '/' goes to '\'. State '\' goes to '/'.
The program given startState and set of instructions prints out sequence of states produced by program. 
Now your task as Reverse Engineer is given the output of program print the start state and instructions given to program.

 

Reverse Engineering is about working backwards to question from answer. 

In this situation there exists a compiled program P. P controls the state of indicator. This indicator is a single bar charecter which takes one of the 4 states : '|', '-', '/', '\'. This program is given a sequence of instructions of the form <instr> <persistance> 

where <instr> represents one of 4 possible actions and <persistance> is the number of seconds the state persists once action executed. 

 

The 3 possible actions are ( bar state sequence is '/','-','\','|' ): 

- 'L' : Shift Left. If the bar is in state '|' it goes to '\'. State '\' goes to '-'. State '-' goes to '/'. State '/' goes to '|'.

- 'R' : Shift Right. If the bar is in state '|' it goes to '/'. State '/' goes to '-'. State '-' goes to '\'. State '\' goes to '|'.

- 'F' : Flip. If the bar is in state '|' it goes to '-'. State '-' goes to '|'. State '/' goes to '\'. State '\' goes to '/'.

 

The program given startState and set of instructions prints out sequence of states produced by program. 

Now your task as Reverse Engineer is given the output of program print the start state and instructions given to program.

 

 

Input

 

First line contains integer n representing number of testcases.

Next n lines contains a char sequence s terminated by newline. Each line represents a valid state sequence S of the machine. 

 

Output

 

Output for each testcase two lines.

Start State: <Start State>

<Instruction Sequence>

 

LIMITS:

1<=n<=50

length of eaach string<=1000

Example

Input : 
3
/-/|/-
\
/\\\\\///----

Output:
Start State: /
R0L0L0R0R0
Start State: \

Start State: /
F4F2R3

Added by:Anil Shanbhag
Date:2012-09-20
Time limit:0.200s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All