A magic square is a $3 \times 3$ square, where each element is a single digit between 1 and 9 inclusive, and each digit appears exactly once. There are 4 different contiguous $2 \times 2$ subsquares in a magic squares, which are labeled from 1 to 4 as the following figure shows. These $2 \times 2$ subsquares can be rotated. We use the label of the subsquare with an uppercase letter to represent a rotation. If we rotate the subsquare clockwise, the letter is 'C'; if we rotate it counterclockwise, the letter is 'R'. The following figure shows two different rotations.
Now, given the initial state of a magic square and a sequence of rotations, please print the final state of the magic square after these rotations are performed.