#include <iostream>
using namespace std;

void reverseStr(string& str) 
{ 
    int n = str.length(); 
  
    // Swap character starting from two 
    // corners 
    for (int i = 0; i < n / 2; i++) 
        swap(str[i], str[n - i - 1]); 
}

string directionsToString(int nbLanterns, bool directions[], bool isReverse) {
    string s = "";
    string left = (isReverse?"R":"L");
    string right = (isReverse?"L":"R");
    for (int j=0;j<nbLanterns;j++) {
        if (directions[j]) {
            s += left;
        } else {
            s += right;
        }
    }
    if (isReverse) {
        reverseStr(s);
    }
    return s;
}

bool search(int nbLanterns, int lanterns[], bool directions[], int count[], int current, int currentsum, int min[]) {
    if (current>=nbLanterns) {
        return true;
    } else {
        if (currentsum>0) {
            if (current+1<nbLanterns) {
                currentsum += count[current+1];
            }
            return search(nbLanterns, lanterns, directions, count, current+1, currentsum, min);
        } else {
            for (int i=current+1;i<=current+min[current];i++) {
                currentsum += count[i];
//            for (int i=nbLanterns-1;i>=current+1;i--) {
                if ((!directions[i])&&(i-lanterns[i]<=current)) {
                    // turn lantern i
                    directions[i]=true;
                    if (i+1<nbLanterns) {
                        count[i+1]--;
                        if (i+lanterns[i]+1<nbLanterns) {
                            count[i+lanterns[i]+1]++;
                        }
                    }
                    count[i]--;
                    if (i-lanterns[i]>=0) {
                        count[i-lanterns[i]]++;
                    } else {
                        count[0]++;
                    }
                    // try to search
                    bool result = search(nbLanterns, lanterns, directions, count, i, currentsum, min);
                    if (!result) {
                        // turn back the lantern
                        directions[i]=false;
                        if (i+1<nbLanterns) {
                            count[i+1]++;
                            if (i+lanterns[i]+1<nbLanterns) {
                                count[i+lanterns[i]+1]--;
                            }
                        }
                        count[i]++;
                        if (i-lanterns[i]>=0) {
                            count[i-lanterns[i]]--;
                        } else {
                            count[0]--;
                        }
                    } else {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}

void clearArray(int m[], int size) {
    for (int i=0;i<size;i++) {
        m[i] = 0;
    }
}

void clearArray(bool m[], int size) {
    for (int i=0;i<size;i++) {
        m[i] = false;
    }
}

void initCount(int nbLanterns, int lanterns[], int count[]) {
    clearArray(count, nbLanterns);
    for (int j=0;j<nbLanterns;j++) {
        if (lanterns[j]>0 && j+1<nbLanterns) {
            count[j+1]++;
            if (j+lanterns[j]+1<nbLanterns) {
                count[j+lanterns[j]+1]--;
            }
        }
    }
   /*cout << "initCount ";
    for (int i=0;i<nbLanterns;i++) {
        cout << count[i];
    }
    cout << "\n";*/
}

void initMin(int nbLanterns, int lanterns[], int min[]) {
    clearArray(min, nbLanterns);
    int refIndex = nbLanterns-1;
    int ref = lanterns[nbLanterns-1];
    for (int i=nbLanterns-2;i>=0;i--) {
        if (refIndex-i>ref) {
            // refIndex doesn't reach anymore
            bool found = false;
            for (int j=refIndex-1;j>=i+1 && !found;j--) {
                if (j-i<=lanterns[j]) {
                    // j is the new refIndex!
                    refIndex = j;
                    ref = lanterns[j];found = true;
                }
            }
            if (!found) {
                refIndex = i+1;
                ref = lanterns[refIndex];
            }
        }
        if (refIndex-i<=ref) {
            min[i] = refIndex-i;
        }
    }
    /*cout << "initMin ";
    for (int i=0;i<nbLanterns;i++) {
        cout << min[i];
    }
    cout << "\n";*/
}

int main() {
    int nbTests;
    cin >> nbTests;
    cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
    for (int i=0;i<nbTests;i++) {
        int nbLanterns;
        cin >> nbLanterns;
        cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
        int lanterns[nbLanterns];
        int rev[nbLanterns];
        for (int j=0;j<nbLanterns;j++) {
            cin >> lanterns[j];
            rev[nbLanterns-1-j] = lanterns[j];
        }
        cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
        bool isReverse = false;
        bool directions[nbLanterns];
        clearArray(directions, nbLanterns);
        int count[nbLanterns];
        int countrev[nbLanterns];
        int min[nbLanterns];
        int minrev[nbLanterns];
        initCount(nbLanterns, lanterns, count);
        initCount(nbLanterns, rev, countrev);
        initMin(nbLanterns, lanterns, min);
        initMin(nbLanterns, rev, minrev);
        bool possible = true;
        if (possible) {
            bool result = search(nbLanterns, lanterns, directions, count, 0, count[0], min);
            if (!result) {
                isReverse = true;
                for (int j=0;j<nbLanterns;j++) {
                    directions[j] = false;
                }
                result = search(nbLanterns, rev, directions, countrev, 0, count[0], min);
            }
            if (!result) {
                cout << "NO\n";
            } else {
                cout << "YES\n";
                string s = directionsToString(nbLanterns, directions, isReverse);
                cout << s << "\n";
            }
        } else {
            cout << "NO\n";
        }
    }
}
