Problem: There are n lanterns in a row. The lantern i is placed in position i and has power equal to p_i.

Each lantern can be directed to illuminate either some lanterns to the left or some lanterns to the right. If the i-th lantern is turned to the left, it illuminates all such lanterns j that j ∈ [i - p_i, i - 1]. Similarly, if it is turned to the right, it illuminates all such lanterns j that j ∈ [i + 1, i + p_i].

Your goal is to choose a direction for each lantern so each lantern is illuminated by at least one other lantern, or report that it is impossible.

Input

The first line contains one integer t (1 ≤ t ≤ 10000) — the number of test cases.

Each test case consists of two lines. The first line contains one integer n (2 ≤ n ≤ 3 ⋅ 10^5) — the number of lanterns.

The second line contains n integers p_1, p_2, ..., p_n (0 ≤ p_i ≤ n) — the power of the i-th lantern.

The sum of n over all test cases does not exceed 3 ⋅ 10^5.

Output

For each test case, print the answer as follows:

If it is possible to direct all lanterns so that each lantern is illuminated, print YES in the first line and a string of n characters L and/or R (the i-th character is L if the i-th lantern is turned to the left, otherwise this character is R) in the second line. If there are multiple answers, you may print any of them.

If there is no answer, simply print NO for that test case.

Example

Input


4
8
0 0 3 1 1 1 1 2
2
1 1
2
2 2
2
0 1


Output


YES
RRLLLLRL
YES
RL
YES
RL
NO

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define i2 array<int,2>
using namespace std;
const int N = 300100;
const int oo = 2e9;
int st[4 * N], MX[4 * N];
int n, f[N], p[N], pre[N], dir[N], ans[N];

// 0 -- left, 1 -- right

void build(int v, int l, int r){
    st[v] = oo;

    if (l == r) {
        MX[v] = p[l] + l;
        return;
    }

    int md = (l + r) >> 1;

    build(v + v, l, md);
    build(v + v + 1, md + 1, r);

    MX[v] = max(MX[v + v], MX[v + v + 1]);
}

void update(int v, int l, int r, int ps, int vl){
    if (l == r) {
        st[v] = min(st[v], vl);
        return;
    }

    int md = (l + r) >> 1;

    if (ps <= md)
        update(v + v, l, md, ps, vl);
    else update(v + v + 1, md + 1, r, ps, vl);

    st[v] = min(st[v + v], st[v + v + 1]);
}

int get_loc(int v, int tl, int tr, int l, int r){
    if (l > r) return oo;

    if (tl == l && tr == r) return st[v];

    int md = (tl + tr) >> 1;

    return min(get_loc(v + v, tl, md, l, min(r, md)),
               get_loc(v + v + 1, md + 1, tr, max(md + 1, l), r));
}

int get_max(int v, int tl, int tr, int l, int r){
    if (l > r) return 0;

    if (tl == l && tr == r) return MX[v];

    int md = (tl + tr) >> 1;

    return max(get_max(v + v, tl, md, l, min(r, md)),
               get_max(v + v + 1, md + 1, tr, max(md + 1, l), r));
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

#ifdef _LOCAL
    freopen("in.txt","r",stdin);
#endif // _LOCAL

    int qq; cin >> qq;

    for (; qq; qq--){
        cin >> n;

        fill(f, f + n + 1, 0);

        for (int i = 1; i <= n; i++)
            cin >> p[i];

        build(1, 0, n);

        update(1, 0, n, 0, 0);

        // if BAD you can't recalc

        for (int i = 1; i <= n; i++){
            // from i - 1
            // from j
            // max(left_bound, 0)

            f[i] = -1;

            if (f[i - 1] >= i){
                pre[i] = i - 1;
                dir[i] = 1;
                f[i] = max(f[i - 1], p[i] + i);
            }

            {
                int loc = get_loc(1, 0, n, max(0, i - p[i] - 1), n);

                if (loc < oo){
                    int nw = max(i - 1, get_max(1, 0, n, loc + 1, i - 1));

                    if (nw > f[i]){
                        pre[i] = loc;
                        dir[i] = 0;
                        f[i] = nw;
                    }
                } else {
                    if (f[i] < f[i - 1]){
                        f[i] = f[i - 1];
                        pre[i] = i - 1;
                        dir[i] = 1;
                    }
                }
            }

            update(1, 0, n, f[i], i);
        }

        if (f[n] < n)
            cout << "NO\n";
        else {
            cout << "YES\n";

            int j = n;

            while (j > 0){
                ans[j] = dir[j];

                if (!dir[j]){
                    for (int i = pre[j] + 1; i < j; i++)
                        ans[i] = 1;
                }

                j = pre[j];
            }

            for (int i = 1; i <= n; i++)
                cout << (ans[i] ? 'R' : 'L');

            cout << '\n';
        }
    }

    return 0;
}