Since he learnt how to solve the Rubik's cube, Jurica has also been interested in other puzzles of this
kind and he recently created an enigmatic toy himself. We can imagine Jurica's puzzle as a triangular
net in the form of a parallelogram whose nodes are arranged in

The layout of the puzzle can be changed in two ways:
By selecting the unit sized rhombus whose nodes are determined by the coordinates
, , and , and rotating the node values in the clockwise direction.By selecting a unit sized equilateral triangle whose nodes are determined by the coordinates
, and , and rotating the node values in the clockwise direction.
On one boring day, Jurica scrambled the puzzle, writing down the moves he had made on a piece of
paper. This sequence of moves he called a mega-move, and explained the application of mega-move
as the sequential application of the moves written on the paper. After that, he has repeatedly made
the same mega-move several times. He noticed an unusual regularity soon. Starting from a solved
puzzle, after exactly
For given integers
Input Specification
The first line contains three integers
Output Specification
If there is not such a mega-move that meets the conditions from the task, print -1
in the only line.
Otherwise, print the number of moves
R x y
(without the quotation marks) if it is a rotation of a rhombus (operation 1), orT x y
(without the quotation marks) if it is a rotation of an equilateral triangle (operation 2), whereas the coordinate represents the bottom left node of the rhombus or the triangle and it holds that and .
Constraints
In the test samples worth 40% of the points it will hold that
Sample Input 1
2 3 2
Sample Output 1
5
R 1 1
R 1 1
T 1 1
T 1 1
T 1 1
Sample Input 2
3 3 12
Sample Output 2
3
R 1 1
T 2 2
T 2 1
Sample Input 3
5 4 116
Sample Output 3
-1
Comments