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:
// problem: CF1476F
#include <bits/stdc++.h>
using namespace std;

#define mk make_pair
#define fi first
#define se second
#define SZ(x) ((int)(x).size())

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

template<typename T> inline void ckmax(T& x, T y) { x = (y > x ? y : x); }
template<typename T> inline void ckmin(T& x, T y) { x = (y < x ? y : x); }

/* --------------- fast io --------------- */ // begin
namespace Fread {
const int SIZE = 1 << 21;
char buf[SIZE], *S, *T;
inline char getchar() {
	if (S == T) {
		T = (S = buf) + fread(buf, 1, SIZE, stdin);
		if (S == T) return '\n';
	}
	return *S++;
}
} // namespace Fread
namespace Fwrite {
const int SIZE = 1 << 21;
char buf[SIZE], *S = buf, *T = buf + SIZE;
inline void flush() {
	fwrite(buf, 1, S - buf, stdout);
	S = buf;
}
inline void putchar(char c) {
	*S++ = c;
	if (S == T) flush();
}
struct NTR {
	~ NTR() { flush(); }
} ztr;
} // namespace Fwrite
#ifdef ONLINE_JUDGE
	#define getchar Fread :: getchar
	#define putchar Fwrite :: putchar
#endif
namespace Fastio {
struct Reader {
	template<typename T>
	Reader& operator >> (T& x) {
		char c = getchar();
		T f = 1;
		while (c < '0' || c > '9') {
			if (c == '-') f = -1;
			c = getchar();
		}
		x = 0;
		while (c >= '0' && c <= '9') {
			x = x * 10 + (c - '0');
			c = getchar();
		}
		x *= f;
		return *this;
	}
	Reader& operator >> (char& c) {
		c = getchar();
		while (c == '\n' || c == ' ') c = getchar();
		return *this;
	}
	Reader& operator >> (char* str) {
		int len = 0;
		char c = getchar();
		while (c == '\n' || c == ' ') c = getchar();
		while (c != '\n' && c != ' ') {
			str[len++] = c;
			c = getchar();
		}
		str[len] = '\0';
		return *this;
	}
	Reader(){}
} cin;
const char endl = '\n';
struct Writer {
	template<typename T>
	Writer& operator << (T x) {
		if (x == 0) { putchar('0'); return *this; }
		if (x < 0) { putchar('-'); x = -x; }
		static int sta[45];
		int top = 0;
		while (x) { sta[++top] = x % 10; x /= 10; }
		while (top) { putchar(sta[top] + '0'); --top; }
		return *this;
	}
	Writer& operator << (char c) {
		putchar(c);
		return *this;
	}
	Writer& operator << (char* str) {
		int cur = 0;
		while (str[cur]) putchar(str[cur++]);
		return *this;
	}
	Writer& operator << (const char* str) {
		int cur = 0;
		while (str[cur]) putchar(str[cur++]);
		return *this;
	}
	Writer(){}
} cout;
} // namespace Fastio
#define cin Fastio :: cin
#define cout Fastio :: cout
#define endl Fastio :: endl
/* --------------- fast io --------------- */ // end

const int MAXN = 3e5, LOG = 18;
int n, p[MAXN + 5];
int arr[MAXN + 5];
int f[MAXN + 5];

bool dp[MAXN + 5][2]; // dp[i][0/1]: [1,i] 全部都用过了, [i+1,n] 都没用过, i 这个位置有没有被覆盖
pair<pii, int> frm[MAXN + 5][2];
set<int> s[2]; // dp 值为 true 的位置
char ans[MAXN + 5];

struct RangeMaxQuery {
	int _log2[MAXN + 5];
	pii st[MAXN + 5][LOG + 1];
	void build(int* a, int n) {
		_log2[0] = -1;
		for (int i = 1; i <= n; ++i) {
			_log2[i] = _log2[i >> 1] + 1;
			st[i][0] = mk(a[i], i);
		}
		for (int j = 1; j <= LOG; ++j) {
			for (int i = 1; i + (1 << (j - 1)) <= n; ++i) {
				st[i][j] = max(st[i][j - 1], st[i + (1 << (j - 1))][j - 1]); // *****
			}
		}
	}
	pii rmq(int l, int r) {
		int k = _log2[r - l + 1];
		return max(st[l][k], st[r - (1 << k) + 1][k]); // *****
	}
	int rmq_val(int l, int r) { return rmq(l, r).fi; }
	int rmq_pos(int l, int r) { return rmq(l, r).se; }
	RangeMaxQuery() {}
} RMQ;
struct RangeMinQuery {
	int _log2[MAXN + 5];
	pii st[MAXN + 5][LOG + 1];
	void build(int* a, int n) {
		_log2[0] = -1;
		for (int i = 1; i <= n; ++i) {
			_log2[i] = _log2[i >> 1] + 1;
			st[i][0] = mk(a[i], i);
		}
		for (int j = 1; j <= LOG; ++j) {
			for (int i = 1; i + (1 << (j - 1)) <= n; ++i) {
				st[i][j] = min(st[i][j - 1], st[i + (1 << (j - 1))][j - 1]); // *****
			}
		}
	}
	pii rmq(int l, int r) {
		int k = _log2[r - l + 1];
		return min(st[l][k], st[r - (1 << k) + 1][k]); // *****
	}
	int rmq_val(int l, int r) { return rmq(l, r).fi; }
	int rmq_pos(int l, int r) { return rmq(l, r).se; }
	RangeMinQuery() {}
} RMQf;


int jump(int l, int r) {
	/*
	while (1) {
		int mx = 0;
		for (int i = l; i <= r; ++i) {
			ckmax(mx, i + p[i]);
		}
		if (mx >= n)
			return n;
		if (mx == r)
			return r;
		l = r + 1;
		r = mx;
	}
	*/
	/*
	for (int i = r; i <= n; ++i) {
		if (f[i] < l) return i;
	}
	return n;
	*/
	int lo = r, hi = n;
	while (lo < hi) {
		int mid = (lo + hi) >> 1;
		if (RMQf.rmq_val(r, mid) < l) {
			hi = mid;
		} else {
			lo = mid + 1;
		}
	}
	return lo;
}

void get_ans(int i, int t) {
	if (i == 0)
		return;
	ans[frm[i][t].se] = 'L';
	get_ans(frm[i][t].fi.fi, frm[i][t].fi.se);
}

void solve_case() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> p[i];
		arr[i] = p[i] + i;
	}
	
	RMQ.build(arr, n);
	
	for (int i = 1; i <= n; ++i) {
		int l = 0, r = i;
		while (l < r) {
			int mid = (l + r + 1) >> 1;
			if (RMQ.rmq_val(mid, i) > i) {
				l = mid;
			} else {
				r = mid - 1;
			}
		}
		f[i] = l;
	}
	
	RMQf.build(f, n);
	
	for (int i = 0; i <= n; ++i) dp[i][0] = dp[i][1] = 0;
	s[0].clear();
	s[1].clear();
	
	dp[0][1] = 1;
	s[1].insert(0);
	for (int j = 2; j <= n; ++j) {
		set<int> :: iterator it = s[1].lower_bound(max(0, j - p[j] - 1));
		if (it != s[1].end() && *it <= j - 2) {
			int i = *it;
			int mx = RMQ.rmq_val(i + 1, j - 1);
			ckmin(mx, n);
			assert(mx >= j - 1);
			if (mx == j - 1) {
				dp[j][0] = 1;
				frm[j][0] = mk(mk(i, 1), j);
				s[0].insert(j);
			} else if (mx == j) {
				dp[j][1] = 1;
				frm[j][1] = mk(mk(i, 1), j);
				s[1].insert(j);
			} else {
				int to = jump(j + 1, mx);
				dp[to][1] = 1;
				frm[to][1] = mk(mk(i, 1), j);
				s[1].insert(to);
			}
		}
		
		it = s[0].lower_bound(max(0, j - p[j]));
		if (it != s[0].end() && *it <= j - 2) {
			int i = *it;
			int mx = RMQ.rmq_val(i + 1, j - 1);
			ckmin(mx, n);
			assert(mx >= j - 1);
			if (mx == j - 1) {
				dp[j][0] = 1;
				frm[j][0] = mk(mk(i, 0), j);
				s[0].insert(j);
			} else if (mx == j) {
				dp[j][1] = 1;
				frm[j][1] = mk(mk(i, 0), j);
				s[1].insert(j);
			} else {
				int to = jump(j + 1, mx);
				dp[to][1] = 1;
				frm[to][1] = mk(mk(i, 0), j);
				s[1].insert(to);
			}
		}
		if (dp[j - 1][0] && p[j] >= 1) {
			dp[j][0] = 1;
			frm[j][0] = mk(mk(j - 1, 0), j);
			s[0].insert(j);
		}
	}
	if (!dp[n][1]) {
		cout << "NO" << endl;
		return;
	}
	cout << "YES" << endl;
	for (int i = 1; i <= n; ++i)
		ans[i] = 'R';
	get_ans(n, 1);
	for (int i = 1; i <= n; ++i)
		cout << ans[i];
	cout << endl;
}
int main() {
	// freopen("data.txt", "r", stdin);
	int T; cin >> T; while (T--) {
		solve_case();
	}
	return 0;
}