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 <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";
        }
    }
}