#include<bits/stdc++.h>
 
using namespace std;
using ll = long long;

class SegTree {
public :
    ll n;
    bool mx;
    vector<ll> T;
    SegTree(ll n, bool mx)
    : n(n), mx(mx), T(n * 4 + 20, mx ? INT_MIN : INT_MAX)
    {}

private :
    void put(int i, int l, int r, long long val, int p)
    {
        T[i] = mx ? max(T[i], val) : min(T[i], val);
        if(l + 1 == r)
            return;

        int m = (l + r) / 2;
        if(p < m)
            put(i * 2 + 1, l, m, val, p);
        else
            put(i * 2 + 2, m, r, val, p);
    }

    long long get(int i, int l, int r, int L, int R)
    {
        if(L <= l && R >= r)
            return T[i];

        int m = (l + r) / 2;
        long long ret = mx ? INT_MIN : INT_MAX;
        if(L < m)
            ret = mx ? max(ret, get(i * 2 + 1, l, m, L, R))
                     : min(ret, get(i * 2 + 1, l, m, L, R));
        if(R > m)
            ret = mx ? max(ret, get(i * 2 + 2, m, r, L, R))
                     : min(ret, get(i * 2 + 2, m, r, L, R));

        return ret;
    }

public :
    void put(long long val, int p) { put(0, 0, n, val, p); }
    long long get(int L, int R) { return get(0, 0, n, L, R); }
};

void solve(int TestCase) {
    ll n;
    cin >> n;

    vector<ll> P(n);
    for(auto& x : P) cin >> x;

    SegTree max_st(n + 1, true), min_st(n + 1, false);
    for(auto i = 0; i < n; ++i)
        max_st.put(min(n, i + P[i] + 1), i);

    vector<ll> dp(n+1), par(n+1, -1);
    min_st.put(0, 0);
    for(auto i = 1; i <= n; ++i) {
        dp[i] = dp[i-1];
        if(dp[i-1] >= i)
            dp[i] = max(dp[i-1], P[i-1] + i);

        auto j = min_st.get(max(0ll, i - 1 - P[i-1]), n+1);
        if(j != INT_MAX) {
            auto val = max_st.get(j, i-1);
            val = max(val, dp[j]);
            val = max(val, (ll)i-1);

            if(val > dp[i]) {
                dp[i] = val;
                par[i] = j;
            }
        }
        min_st.put(i, dp[i]);
    }

    if(dp[n] >= n) {
        cout << "YES" << endl;
        string ret;
        int cur = n;
        while(cur >= 1) {
            if(par[cur] == -1) {
                ret.push_back('R');
                cur--;
            }
            else {
                auto to = par[cur--];
                ret.push_back('L');
                while(cur > to) {
                    ret.push_back('R');
                    cur--;
                }
            }
        }
        reverse(ret.begin(), ret.end());
        cout << ret << endl;
    }
    else cout << "NO" << endl;
}
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 
    int t = 1;
    cin >> t;
    for(auto i = 1; i <= t; ++i) {
        //cout << "Case #"<< i << ": ";
        solve(i);
    }
}