Problems
You have a special balance scale, with two pans (left and right) that are both initially empty. You also have a box of identical 1-gram marbles. There are N of these marbles, and the marbles are numbered from 1 to N.
Your scale is very sensitive, and you know that if the total weight on the left pan and the total weight on the right pan ever differ by strictly more than 1 gram, the scale will break. For example, if at some point there are 4 marbles in one of the pans, there must be either 3, 4, or 5 marbles in the other pan.
Your friend Libra has challenged you to do the following, without breaking the scale at any point:
- First, put all of the marbles on the scale one at a time, in numerical order: marble 1, then marble 2, and so on up to marble N. For each marble, you choose whether to place it on the left pan or on the right pan.
- Then, remove all of the marbles from the scale one at a time, in an order A1, A2, ..., AN specified by your friend. This order is a permutation of 1, 2, ..., N. The i-th marble you remove must be the marble numbered Ai.
Can you find a way to do this?
Input
The first line of the input gives the number of test cases, T. T test cases follow. Each test case begins with one line with an integer N: the number of marbles. Then, there is one more line with N integers A1, A2, ..., AN, which constitute a permutation of the first N natural numbers. The marble numbered Ai must be the i-th marble that you remove in the removal phase.
Output
For each test case, output one line containing Case #x: y,
where x is the test case number (starting from 1) and
y is a string of N characters. The i-th of these
characters (counting starting from 1) should be uppercase L if
the i-th numbered marble should be put on the left pan, or uppercase
R if it should be put on the right pan.
It is guaranteed that at least one answer exists. If there are multiple valid answers, you may output any one of them.
Example
2
4
3 1 2 4
4
1 2 3 4
Case #1: LRRL
Case #2: LRLR