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 INF 1e9
using namespace std;
int arr[300001];
int last[300001];
int ans[300001];
int res[300001];
int dp[300001];
//segment tree
struct data1
{
	int l,r,val;
};
data1 tree_max[1500001];
data1 tree_min[1500001]; 
 
void revise_max(int i,int pos,int c)
{
	if(tree_max[i].l==tree_max[i].r&&tree_max[i].l==pos)
	{
		tree_max[i].val=c;
		return ;
	}
	int mid=(tree_max[i].l+tree_max[i].r)>>1;
	if(pos<=mid)
	{
		revise_max(i<<1,pos,c);
	}
	else if(pos>mid)
	{
		revise_max((i<<1)+1,pos,c);
	}
	tree_max[i].val=max(tree_max[i<<1].val,tree_max[(i<<1)+1].val);
	return ;
}
void revise_min(int i,int pos,int c)
{
	if(tree_min[i].l==tree_min[i].r&&tree_min[i].l==pos)
	{
		tree_min[i].val=min(tree_min[i].val,c);
		return ;
	}
	int mid=(tree_min[i].l+tree_min[i].r)>>1;
	if(pos<=mid)
	{
		revise_min(i<<1,pos,c);
	}
	else if(pos>mid)
	{
		revise_min((i<<1)+1,pos,c);
	}
	tree_min[i].val=min(tree_min[i<<1].val,tree_min[(i<<1)+1].val);
	return ;
}
int query_max(int i,int l,int r)
{
	if(l<=tree_max[i].l&&r>=tree_max[i].r)
	{
		return tree_max[i].val;
	}
	int mid=(tree_max[i].l+tree_max[i].r)>>1;
	int ans=0;
	if(l<=mid)
	{
		ans=max(ans,query_max(i<<1,l,r));
	}
	if(mid<r)
	{
		ans=max(ans,query_max((i<<1)+1,l,r));
	}
	return ans;
 
}
int query_min(int i,int l,int r)
{
	
	if(l<=tree_min[i].l&&r>=tree_min[i].r)
	{
		return tree_min[i].val;
	}
	int mid=(tree_min[i].l+tree_min[i].r)>>1;
	int ans=INF;
	if(l<=mid)
	{
		ans=min(ans,query_min(i<<1,l,r));
	}
	if(mid<r)
	{
		ans=min(ans,query_min((i<<1)+1,l,r));
	}
	//cout<<ans<<"\n";
	return ans;
 	
}
void init_max(int i,int l,int r)
{
	tree_max[i].l=l;
	tree_max[i].r=r;
	tree_max[i].val=0;
	if(l==r)
	{
		return ;
	}
	int mid=(l+r)>>1;
	init_max(i<<1,l,mid);
	init_max((i<<1)+1,mid+1,r);
	return ;
}
void init_min(int i,int l,int r)
{
	tree_min[i].l=l;
	tree_min[i].r=r;
	tree_min[i].val=INF;
	if(l==r)
	{
		return ;
	}
	int mid=(l+r)>>1;
	init_min(i<<1,l,mid);
	init_min((i<<1)+1,mid+1,r);
	return ;
}







int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		for(int i=1;  i<=n ; i++)
		{
			cin>>arr[i];
		}
		for(int i=1 ; i<=n ; i++)
		{
			dp[i]=-INF;
		}
		dp[1]=0;
		last[1]=0;
		ans[1]=1;
		init_max(1,1,n);
		init_min(1,1,n);
		for(int i=1 ; i<=n ; i++)
		{
			revise_max(1,i,min(i+arr[i],n));
		}
		for(int i=2 ; i<=n;  i++)
		{
			int a=query_min(1,max(i-arr[i]-1,1),n);
			/*if(i==8)
			{
				cout<<max(i-arr[i]-1,1)<<"\n";
			}*/
			if(i-arr[i]<=1)
			{
				a=0;
			}
			//cout<<a<<"\n";
			if(a!=INF)
			{
				
				if(a!=i-1)
				{
					dp[i]=max(query_max(1,a+1,i-1),i-1);
				}
				else
				{
					dp[i]=i-1;
				}
				last[i]=a;
				ans[i]=0;
			}
			if(dp[i-1]>=i&&max(dp[i-1],min(i+arr[i],n))>dp[i])
			{
				dp[i]=max(dp[i-1],min(i+arr[i],n));
				last[i]=i-1;
				ans[i]=1;
			}
			if(dp[i-1]>dp[i])
			{
				dp[i]=dp[i-1];
				last[i]=i-1;
				ans[i]=1;
			}
			if(dp[i]>0)
			{
				revise_min(1,dp[i],i);
			}
			//cout<<dp[i]<<" "<<ans[i]<<" "<<last[i]<<"\n";
		}
		if(dp[n]<n)
		{
			cout<<"NO"<<"\n";
			continue;
		}
		cout<<"YES"<<"\n";
		int t=n;
		while(t!=0)
		{
			int tmp=last[t];
			for(int i=tmp+1 ; i<t ; i++)
			{
				res[i]=1;
			}
			res[t]=ans[t];
			t=tmp;
		}
		for(int i=1;  i<=n;  i++)
		{
			cout<<((res[i]==0)?"L":"R");
		}
		cout<<"\n";
	}
}