Given a positive integer $n$ and an integer sequence $a_1, a_2, \dots, a_{2n}$, where each of the numbers $1, 2, \dots, n$ appears exactly twice in these $2n$ numbers. We perform $2n$ operations to create a sequence $b_1, b_2, \dots, b_{2n}$ of the same length. Initially, $b$ is an empty sequence. In each step, we can perform one of the following two operations:
- Add the first element of sequence $a$ to the end of $b$, and remove it from $a$.
- Add the last element of sequence $a$ to the end of $b$, and remove it from $a$.
Our goal is to make $b$ a palindrome, i.e., $b_i = b_{2n+1-i}$ for all $1 \le i \le n$. Determine if this goal can be achieved. If it can, output the lexicographically smallest operation sequence, as specified in the Output section.
Input
The input is read from the file palin.in.
Each test case contains multiple test data.
The first line of the input contains an integer $T$, representing the number of test cases.
The first line of each test case contains a positive integer $n$, and the second line contains $2n$ space-separated integers $a_1, a_2, \dots, a_{2n}$.
Output
The output is written to the file palin.out.
For each test case, output the answer on a single line.
If it is impossible to generate a palindrome sequence, output -1. Otherwise, output a string of length $2n$ consisting of characters L or R (without spaces), where L represents operation 1 (removing the first element) and R represents operation 2 (removing the last element). You must output the lexicographically smallest string among all valid schemes.
The lexicographical comparison rule is as follows: a string $s_{1 \dots 2n}$ is lexicographically smaller than $t_{1 \dots 2n}$ if and only if there exists an index $1 \le k \le 2n$ such that $\forall 1 \le i < k$, $s_i = t_i$ and $s_k < t_k$.
Examples
Input 1
2 5 4 1 2 4 5 3 1 2 3 5 3 3 2 1 2 1 3
Output 1
LRRLLRRRRL -1
Note 1
In the first test case, the generated sequence $b$ is $4, 5, 3, 1, 2, 2, 1, 3, 5, 4$, which is a palindrome.
Another possible operation scheme is LRRLLRRRRR, but it is lexicographically larger than the answer.
Examples 2
See palin/palin2.in and palin/palin2.ans in the contestant's directory.
Constraints
Let $\sum n$ denote the sum of $n$ over all $T$ test cases. For all test cases, it is guaranteed that $1 \le T \le 100$, $1 \le n$, and $\sum n \le 5 \times 10^5$.
| Test Case ID | $T$ | $n$ | $\sum n$ | Special Property |
|---|---|---|---|---|
| $1 \sim 7$ | None | |||
| $8 \sim 10$ | ||||
| $11 \sim 12$ | ||||
| $13 \sim 15$ | ||||
| $16 \sim 17$ | $= 1$ | $\le 5 \times 10^5$ | $\le 5 \times 10^5$ | None |
| $18 \sim 20$ | $\le 100$ | $\le 5 \times 10^5$ | $\le 5 \times 10^5$ | Yes |
| $21 \sim 25$ | None |
Special property: If we remove two adjacent and equal numbers from $a$ each time, there exists a way to empty the sequence (e.g., $a = [1, 2, 2, 1]$).