Team Red and Team Blue competed in a competitive FPS. Their match was streamed around the world. They played a series of $n$ matches.

In the end, it turned out Team Red won $r$ times and Team Blue won $b$ times. Team Blue was less skilled than Team Red, so $b$ was strictly less than $r$.

You missed the stream since you overslept, but you think that the match must have been neck and neck since so many people watched it. So you imagine a string of length $n$ where the $i$-th character denotes who won the $i$-th match  — it is R if Team Red won or B if Team Blue won. You imagine the string was such that the maximum number of times a team won in a row was as small as possible. For example, in the series of matches RBBRRRB, Team Red won $3$ times in a row, which is the maximum.

You must find a string satisfying the above conditions. If there are multiple answers, print any.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 1000$)  — the number of test cases.

Each test case has a single line containing three integers $n$, $r$, and $b$ ($3 \leq n \leq 100$; $1 \leq b < r \leq n$, $r+b=n$).


-----Output-----

For each test case, output a single line containing a string satisfying the given conditions. If there are multiple answers, print any.


-----Examples-----

Input
3
7 4 3
6 5 1
19 13 6
Output
RBRBRBR
RRRBRR
RRBRRBRRBRRBRRBRRBR
Input
6
3 2 1
10 6 4
11 6 5
10 9 1
10 8 2
11 9 2
Output
RBR
RRBRBRBRBR
RBRBRBRBRBR
RRRRRBRRRR
RRRBRRRBRR
RRRBRRRBRRR


-----Note-----

The first test case of the first example gives the optimal answer for the example in the statement. The maximum number of times a team wins in a row in RBRBRBR is $1$. We cannot minimize it any further.

The answer for the second test case of the second example is RRBRBRBRBR. The maximum number of times a team wins in a row is $2$, given by RR at the beginning. We cannot minimize the answer any further.

Difficulty: EASY
Tags: Mathematics

Greedy algorithms

Implementation

Constructive algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
for n in [*open(0)][1:]:
	(n, r, b) = map(int, n.split())
	b += 1
	c = r // b * 'R' + 'B'
	print((('R' + c) * (r % b) + c * n)[:n])


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n, r, b) = I()
	low = r // (b + 1)
	rm = r % (b + 1)
	print(('R' * (low + 1) + 'B') * rm + ('R' * low + 'B') * (b - rm) + 'R' * (r - (low + 1) * rm - low * (b - rm)))


def solve():
	(n, r, b) = map(int, input().split())
	divs = b + 1
	size = r // divs
	nbig = r % divs
	nsmall = divs - nbig
	big = 'R' * (size + 1) + 'B'
	small = 'R' * size + 'B'
	ans = nbig * big + (nsmall - 1) * small + 'R' * size
	print(ans)
tc = int(input())
for _ in range(tc):
	solve()


from sys import stdin, stdout

def input():
	return stdin.readline()

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def yn(x):
	print('YES' if x else 'NO')
for _ in range(int(input())):
	(n, r, b) = mi()
	cnt = r // (b + 1)
	rem = r % (b + 1)
	a = ('R' * (cnt + 1) + 'B') * rem + ('R' * cnt + 'B') * (b - rem) + 'R' * cnt
	print(a)


for _ in range(int(input())):
	(n, r, b) = map(int, input().split())
	x = r // (b + 1)
	y = r % (b + 1)
	str1 = ('R' * (x + 1) + 'B') * y
	str1 += ('R' * x + 'B') * (b + 1 - y)
	print(str1[:-1])


import math

def main():
	size = int(input())
	cases = []
	for i in range(size):
		cases.append([int(word) for word in input().split(' '[:3])])
	for case in cases:
		rate = math.floor(case[1] / (case[2] + 1))
		k = case[1] % (case[2] + 1)
		red_wins = 0
		line = ''
		for i in range(case[2]):
			if k > 0:
				k_win = 'R'
				k -= 1
				red_wins += 1
			else:
				k_win = ''
			line = line + k_win + 'R' * rate + 'B'
			red_wins += rate
		line = line + (case[1] - red_wins) * 'R'
		print(line)
main()


for _ in range(int(input())):
	(n, r, b) = map(int, input().split())
	rr = r // (b + 1)
	rrr = r % (b + 1)
	s = ''
	for i in range(b):
		if i < rrr:
			s += 'R' * (rr + 1) + 'B'
		else:
			s += 'R' * rr + 'B'
	s += 'R' * rr
	print(s)


import math

def solve(x, y, cx, cy):
	d = y // (x + 1)
	return ''.join(((d + (i < y % (x + 1))) * cy + cx for i in range(x))) + d * cy

def main(n, r, b):
	res = solve(r, b, 'R', 'B') if r < b else solve(b, r, 'B', 'R')
	assert len(res) == n, (n, r, b)
	return res
t = int(input())
for _ in range(t):
	(_n, _r, _b) = map(int, input().split(' '))
	print(main(_n, _r, _b))


from math import ceil, floor
t = int(input())
for _case in range(t):
	(n, r, b) = [int(x) for x in input().split()]
	c = b + 1
	first_part = ('R' * ceil(r / c) + 'B') * (r % c)
	second_part = ('R' * floor(r / c) + 'B') * (c - r % c)
	ans = first_part + second_part
	print(ans[:-1])


def sp(lst, n):
	return [lst[i::n] for i in range(n)]
for _ in range(int(input())):
	(a, b, c) = list(map(int, input().split()))
	b1 = (b - 1) // (c + 1)
	l = ['R'] * b
	l = list(sp(l, c + 1))
	print('B'.join([''.join(i) for i in l]))


import sys
N = int(sys.stdin.readline().strip())
for i in range(N):
	(n, r, b) = map(int, sys.stdin.readline().strip().split(' '))
	p = r // (b + 1)
	q = r % (b + 1)
	answer = ('R' * (p + 1) + 'B') * q + ('R' * p + 'B') * (b - q)
	answer = answer + 'R' * (n - len(answer))
	print(answer)


import sys, math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	(n, r, b) = inlt()
	x = r // (b + 1)
	n1 = r % (b + 1)
	n2 = b - n1
	tmp1 = 'R' * (x + 1) + 'B'
	tmp2 = 'R' * x + 'B'
	res = tmp1 * n1 + tmp2 * n2
	res += 'R' * x
	print(res)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
N = inp()
for _ in range(N):
	answer = ''
	(n, r, b) = invr()
	left = r % (b + 1)
	d = r // (b + 1)
	for _ in range(left):
		answer += 'R' * (d + 1)
		answer += 'B'
	for _ in range(b - left):
		answer += 'R' * d
		answer += 'B'
	answer += 'R' * d
	print(answer)


t = int(input())
otv = [''] * t
for T in range(t):
	(n, r, b) = map(int, input().split())
	vse = r // (b + 1)
	pl = r % (b + 1)
	s = pl * ('R' * (1 + vse) + 'B')
	s += ('R' * vse + 'B') * (b - pl)
	s += 'R' * (r - s.count('R'))
	otv[T] = s
for i in range(t):
	print(otv[i])


import sys
input = lambda : sys.stdin.readline().strip()
sys.setrecursionlimit(10 ** 9)
t = int(input())
for _ in [0] * t:
	(n, r, b) = map(int, input().split())
	a = ['R'] * n
	p = (n + 1) // (b + 1)
	q = (n + 1) % (b + 1)
	j = -1
	for i in range(q):
		j += p + 1
		a[j] = 'B'
	for i in range(b - q):
		j += p
		a[j] = 'B'
	print(''.join(a))


for n in [*open(0)][1:]:
	(n, r, b) = map(int, n.split())
	b += 1
	print(''.join(('R' * (r // b + (i < r % b)) + 'B' for i in range(b)))[:-1])


import math
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	low = b // (c + 1)
	high = math.ceil(b / (c + 1))
	temp = b % (c + 1)
	rem = c + 1 - temp
	if rem == 0:
		temp -= 1
		rem += 1
	string = ('R' * high + 'B') * temp + ('R' * low + 'B') * (rem - 1) + 'R' * low
	print(string)


for _ in range(int(input())):
	(n, r, b) = map(int, input().split())
	c = r // (b + 1) * 'R' + 'B'
	print((('R' + c) * (r % (b + 1)) + c * n)[:n])


tc = int(input())
for _ in range(tc):
	(n, a, b) = map(int, input().split())
	b += 1
	print((('R' * (a // b + 1) + 'B') * (a % b) + ('R' * (a // b) + 'B') * (b - a % b))[:-1])


def solve():
	(n, r, b) = map(int, input().split())
	x = r // (b + 1)
	y = r % (b + 1)
	ANS = ''
	for i in range(b + 1):
		if i < y:
			ANS += 'R'
		ANS += 'R' * x
		ANS += 'B'
	print(ANS[:-1])
t = int(input())
while t > 0:
	t -= 1
	solve()


t = int(input())
while t > 0:
	t -= 1
	(n, a, b) = map(int, input().split())
	d = a // (b + 1)
	s = ''
	a -= d * (b + 1)
	if a > 0:
		a -= 1
		s += 'R' * (d + 1)
	else:
		s += 'R' * d
	for i in range(b):
		s += 'B'
		s += 'R' * d
		if a > 0:
			s += 'R'
			a -= 1
	print(s)


def inp(*, cf=lambda x: x):
	return cf(input())

def inpint():
	return inp(cf=int)

def inp_line(*, cf=lambda x: x, s=' '):
	return list(map(cf, input().split(s)))

def inpints():
	return inp_line(cf=int)

def test_case(n, r, b):
	rs_in_region = r // (b + 1)
	rs_remaining = r % (b + 1)
	ans = ''
	for i in range(b):
		if rs_remaining > 0:
			ans += 'R'
			rs_remaining -= 1
		ans += rs_in_region * 'R' + 'B'
	ans += rs_in_region * 'R'
	return ans

def main():
	T = inpint()
	for t in range(T):
		(n, r, b) = inpints()
		print(test_case(n, r, b))
main()


t = int(input())
for _ in range(t):
	(n, r, b) = map(int, input().split())
	max_red_segments = r % (b + 1)
	y = ''
	for i in range(r // (b + 1)):
		y += 'R'
	res = ''
	for i in range(b + 1):
		if i > 0:
			res += 'B'
		res += y
		if max_red_segments:
			res += 'R'
			max_red_segments -= 1
	print(res)


def solve(r, b):
	from math import ceil, floor
	d = ceil(r / (b + 1))
	d2 = floor(r / (b + 1))
	rem = r % (b + 1)
	s = ('R' * d + 'B') * rem + ('R' * d2 + 'B') * (b + 1 - rem)
	return s[:-1]
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, r, b) = [int(x) for x in input().split()]
	print(solve(r, b))


t = int(input())
for i in range(t):
	(n, r, b) = map(int, input().split())
	p = r % (b + 1)
	y = ''
	for j in range(int(r / (b + 1))):
		y = y + 'R'
	ans = ''
	for i in range(b + 1):
		if i > 0:
			ans = ans + 'B'
		ans = ans + y
		if p > 0:
			ans = ans + 'R'
			p = p - 1
	print(ans)


import sys, math
input = sys.stdin.readline
for _ in range(int(input())):
	(a, b, c) = map(int, input().split())
	x = b // (c + 1)
	arr = [x] * (c + 1)
	for i in range(b % (c + 1)):
		arr[i] = arr[i] + 1
	s = ''
	for i in range(c + 1):
		if i < c:
			s = s + 'R' * arr[i] + 'B'
		else:
			s = s + 'R' * arr[i]
	print(s)


for _ in range(int(input())):
	(n, r, b) = map(int, input().split())
	t = (r - 1) // (b + 1) + 1
	k = t * (b + 1) - r
	res = ('R' * t + 'B') * (b + 1 - k) + ('R' * (t - 1) + 'B') * k
	print(res[:-1])


ts = int(input())
for t in range(ts):
	(n, r, b) = input().split(' ')
	(n, r, b) = (int(n), int(r), int(b))
	together = r // (b + 1)
	remains = r % (b + 1)
	output = ''
	for i in range(b + 1):
		output += 'R' * together
		if remains:
			output += 'R'
			remains -= 1
		if i < b:
			output += 'B'
	print(output)


t = int(input())
for i in range(t):
	x = input().split()
	r = int(x[1])
	b = int(x[2])
	x = ''
	p = r % (b + 1)
	q = r // (b + 1)
	for i in range(p):
		x += 'R' * (q + 1) + 'B'
	for i in range(b + 1 - p):
		x += 'R' * q + 'B'
	print(x[:-1])


def solve():
	(n, r, b) = list(map(int, input().split(' ')))
	d = r // (b + 1)
	rem = r % (b + 1)
	s = ''
	for i in range(b):
		if rem > 0:
			s += 'R'
			rem -= 1
		s += 'R' * d + 'B'
	s += 'R' * d
	s += 'R' * rem
	print(s)
for t in range(int(input())):
	solve()


t = int(input())
for i in range(t):
	(n, r, b) = map(int, input().split())
	d = r // (b + 1)
	k = r % (b + 1)
	s = 'B'.join(['R' * (d + 1)] * k + ['R' * d] * (b + 1 - k))
	print(s)


import math

class Util:
	ALLOWED_LOCAL_FILES = set(['main.py', 'A.py', 'B.py', 'C.py', 'D.py', 'E.py', 'F.py', 'G.py'])
	MOD = 1000000000 + 7

	@staticmethod
	def get_int_list_input():
		return list(map(int, input().split()))

	@staticmethod
	def p(yes=False):
		print('YES') if yes else print('NO')

def solve():
	(n, r, b) = Util.get_int_list_input()
	result = 'R' * math.ceil(r / (b + 1))
	remaining_r = r - math.ceil(r / (b + 1))
	result += ('B' + 'R' * math.ceil(remaining_r // b)) * b
	result = result[:n]
	result_rs = result.split('B')
	for i in range(r - result.count('R')):
		result_rs[i + 1] += 'R'
	result = 'B'.join(result_rs)
	print(result)

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
import sys
if sys.argv[0] in Util.ALLOWED_LOCAL_FILES:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
main()


for _ in range(int(input())):
	(n, r, b) = [*map(int, input().split())]
	x = (r + b) // (b + 1)
	a = x * (b + 1) - r
	print(('R' * x + 'B') * (b - a) + 'R' * x + ('B' + 'R' * (x - 1)) * a)


for t in range(int(input())):
	(n, r, b) = [*map(int, input().split())]
	(a, d) = (r // (b + 1), r - b - 1)
	e = d % (b + 1)
	if e:
		print((('R' * (a + 1) + 'B') * e)[:-1] + (b + 1 - e) * ('B' + 'R' * a))
	else:
		print((('R' * a + 'B') * (b + 1))[:-1])


t = int(input())
for _ in range(t):
	(n, r, b) = map(int, input().split())
	s = ''
	m = r // (b + 1)
	rest = r % (b + 1)
	for i in range(rest):
		s += 'R' * m + 'R' + 'B'
	for i in range(b + 1 - rest):
		if i == b - rest:
			s += 'R' * m
		else:
			s += 'R' * m + 'B'
	print(s)


t: int = int(input())
while t > 0:
	s = input()
	(n, r, b) = [int(x) for x in s.split(' ')]
	rlen = r // (b + 1)
	rleft = r % (b + 1)
	print(rleft * (rlen * 'R' + 'R' + 'B'), end='')
	r -= rleft * rlen + rleft
	b -= rleft
	print('B'.join(['R' * rlen for _ in range(b + 1)]), end='')
	print()
	t = t - 1


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, r, b) = map(int, input().split())
	d = r // (b + 1)
	c = r % (b + 1)
	print(('R' * (d + 1) + 'B') * c + ('R' * d + 'B') * (b - c) + 'R' * d)


for t in range(int(input())):
	(n, r, b) = map(int, input().split())
	b += 1
	x = r // b
	y = r % b
	ans = ''
	for i in range(y):
		ans += (x + 1) * 'R' + 'B'
	for j in range(b - y):
		ans += x * 'R' + 'B'
	ans = ans[:-1]
	print(ans)


import math
t = int(input())
for i in range(t):
	arr = input().split()
	(r, b) = (int(arr[1]), int(arr[2]))
	gap = math.ceil(r / (b + 1))
	t1 = r - (b + 1) * (gap - 1)
	t2 = (b + 1) * gap - r
	if t2 == 0:
		t1 -= 1
	print(('R' * gap + 'B') * t1 + ('R' * (gap - 1) + 'B') * (t2 - 1) + 'R' * (r - (gap * t1 + (gap - 1) * max(0, t2 - 1))))


import os

def calculate(n, a, b):
	if a > b:
		A = a
		A_str = 'R'
		B = b
		B_str = 'B'
	else:
		A = b
		A_str = 'B'
		B = a
		B_str = 'R'
	lenth = int(A / (B + 1))
	rest = int(A % (B + 1))
	result = ''
	add_rest = 0
	for i in range(B + 1):
		if add_rest < rest:
			result += (lenth + 1) * A_str
			add_rest += 1
		else:
			result += lenth * A_str
		result += B_str
	return result[:-1]
cases = input()
for _ in range(int(cases)):
	nab = input()
	(n, a, b) = nab.split()
	print(calculate(int(n), int(a), int(b)))


for _ in range(int(input())):
	(n, r, b) = map(int, input().split())
	ans = ''
	am = r // (b + 1)
	rem = r - (b + 1) * am
	for i in range(b):
		ans += 'R' * (am + (1 if rem > 0 else 0))
		rem -= 1
		ans += 'B'
	ans += 'R' * am
	print(ans)


t = int(input())
for _ in range(t):
	(n, r, b) = [int(x) for x in input().split()]
	d = r // (b + 1)
	m = r % (b + 1)
	s = ''
	print(('R' * (d + 1) + 'B') * m + ('R' * d + 'B') * (b - m) + 'R' * d)


def solve(n, r, b):
	sol = r // (b + 1)
	rem = r % (b + 1)
	temp = ''
	for i in range(sol):
		temp += 'R'
	res = ''
	for i in range(b + 1):
		if i > 0:
			res += 'B'
		res += temp
		if rem > 0:
			res += 'R'
			rem -= 1
	return res
t = int(input())
for _ in range(t):
	(n, r, b) = list(map(int, input().split()))
	print(solve(n, r, b))


a = int(input())
for i in range(a):
	(a, b, c) = [int(x) for x in input().split()]
	h = c + 1
	cn = b // h
	x = b % h
	st = ('B' + 'R' * (cn + 1)) * x + ('B' + 'R' * cn) * (h - x)
	print(st[1:])


for _ in range(int(input())):
	(n, r, b) = list(map(int, input().split()))
	q = r // (b + 1)
	rem = r % (b + 1)
	s = ('R' * (q + 1) + 'B') * rem
	s += ('R' * q + 'B') * (b - rem)
	s += 'R' * q
	print(s)


for jj in range(int(input())):
	(n, r, b) = [int(i) for i in input().split()]
	t = r // (b + 1)
	rm = r % (b + 1)
	ans = ('R' * (t + 1) + 'B') * rm + ('R' * t + 'B') * (b + 1 - rm)
	print(ans[:n])


for _ in range(int(input())):
	(total, red, blue) = map(int, input().split())
	div = red // (blue + 1)
	rem = red % (blue + 1)
	ans1 = 'R' * div
	ans = ''
	for i in range(blue + 1):
		if i != 0:
			ans += 'B'
		ans += ans1
		if rem > 0:
			ans += 'R'
			rem -= 1
	print(ans)


t = int(input())
while t > 0:
	t -= 1
	(n, r, b) = list(map(int, input().split(' ')))
	if r % (b + 1) == 0:
		print(('R' * (r // (b + 1)) + 'B') * b + 'R' * (r // (b + 1)))
	else:
		print(('R' * (r // (b + 1) + 1) + 'B') * (r % (b + 1)) + ('R' * (r // (b + 1)) + 'B') * (b - r % (b + 1)) + 'R' * (r // (b + 1)))


t = int(input())
for _ in range(t):
	(n, r, b) = map(int, input().split())
	remainder = r % (b + 1)
	quotient = r // (b + 1)
	Rs = ['R' * (quotient + 1)] * remainder + ['R' * quotient] * (b + 1 - remainder)
	print('B'.join((R for R in Rs)))


t = int(input())
for i in range(t):
	match = input()
	(n, r, b) = match.split()
	r = int(r)
	b = int(b)
	list = []
	x = r // (b + 1)
	y = 'R' * x
	ans = ''
	z = r % (b + 1)
	for j in range(1, b + 2):
		if j <= z:
			ans += y + 'R' + 'B'
		else:
			ans += y + 'B'
	print(ans[:-1])


def input_list_ints():
	input_data = []
	number_cases = int(input())
	for i in range(number_cases):
		temp = input()
		temp2 = [int(x) for x in temp.split()]
		input_data.append(temp2)
	return input_data

def solution(case):
	(games, red_wins, blue_wins) = (case[0], case[1], case[2])
	temp = red_wins // (blue_wins + 1)
	temp2 = [temp for x in range(blue_wins + 1)]
	available_red_wins = red_wins % (blue_wins + 1)
	for x in range(len(temp2)):
		if available_red_wins == 0:
			break
		temp2[x] += 1
		available_red_wins -= 1
	string = temp2[0] * 'R'
	for i in range(1, len(temp2)):
		string += 'B'
		string += 'R' * temp2[i]
	return string
input_data = input_list_ints()
for case in input_data:
	print(solution(case))


def solve():
	for tc in range(int(input())):
		(n, r, b) = list(map(int, input().split()))
		rep = r // (b + 1)
		s = (['R'] * rep + ['B']) * b
		cntr = r - rep * b
		i = 0
		while cntr > 0:
			try:
				if cntr == rep:
					s.extend(['R'] * cntr)
					break
				elif s[i + 1] == 'B' and cntr > 1:
					s.insert(i, 'R')
					cntr -= 1
					i += 1
				i += 1
			except:
				if cntr > 0:
					s.extend(['R'] * cntr)
					break
				else:
					break
		print(''.join(s))
solve()


import sys
t = int(sys.stdin.readline().rstrip())
for _ in range(t):
	(n, r, b) = map(int, sys.stdin.readline().split())
	arr = []
	col = r // (b + 1)
	reminder = r % (b + 1)
	for _ in range(b + 1):
		arr.append('R' * col)
		arr.append('B')
	arr.pop()
	step = 1
	for _ in range(reminder):
		arr.insert(step, 'R')
		step += 2
		step += 1
	print(''.join(arr))


T = int(input())
for _ in range(T):
	(n, R, B) = map(int, input().split())
	(div, mod) = divmod(R, B + 1)
	ans = []
	for i in range(B * 2 + 1):
		if i % 2:
			ans.append('B')
		elif mod:
			ans.append('R' * (div + 1))
			mod -= 1
		else:
			ans.append('R' * div)
	print(''.join(ans))


t = int(input())
for _ in range(0, t):
	inputs = [int(num) for num in input().split()]
	n = inputs[0]
	r = inputs[1]
	b = inputs[2]
	s = ''
	r1 = r // (b + 1)
	extra = r % (b + 1)
	s1 = 'R' * r1
	for i in range(0, b):
		temp = s1
		if extra > 0:
			temp = s1 + 'R'
			extra -= 1
		s += temp + 'B'
	s += s1
	print(s)


class Solution:

	def solve(self, n, r, b):
		x = r // (b + 1)
		y = r % (b + 1)
		result = []
		for i in range(b):
			if y > 0:
				result.append('R' * (x + 1))
				y -= 1
			else:
				result.append('R' * x)
			result.append('B')
		if y > 0:
			result.append('R' * (x + 1))
			y -= 1
		else:
			result.append('R' * x)
		strResult = ''.join(map(str, result))
		return strResult
T = int(input())
while T:
	T -= 1
	(n, r, b) = map(int, input().split(' '))
	print(Solution().solve(n, r, b))


n = int(input())
for i in range(0, n):
	(n, r, b) = list(map(int, input().split(' ')))
	stri = 'R' * (r // (b + 1))
	ans = ''
	num = r % (b + 1)
	for j in range(0, b):
		if num > 0:
			ans += stri + 'R' + 'B'
			num -= 1
		else:
			ans += stri + 'B'
	ans += stri
	print(ans)


def redversusblue(a, b):
	if a == b:
		return 'Rb' * a
	if a > b:
		lsa = [a // (b + 1)] * (b + 1)
		for i in range(a % (b + 1)):
			lsa[i] += 1
		res = ''
		for i in range(b):
			res += 'R' * lsa[i]
			res += 'B'
		res += 'R' * lsa[-1]
		return res
	if a < b:
		lsb = [b // (a + 1)] * (a + 1)
		for i in range(b % (a + 1)):
			lsb[i] += 1
		res = ''
		for i in range(a):
			res += 'B' * lsb[i]
			res += 'R'
		res += 'B' * lsb[-1]
	return res
t = int(input())
for _ in range(t):
	(_, a, b) = [int(x) for x in input().split()]
	print(redversusblue(a, b))


import math
t = int(input())
for _ in range(t):
	(n, r, b) = map(int, input().split())
	gaps = b + 1
	rmax = r / gaps
	r_i = math.floor(rmax)
	ans = [r_i for _ in range(gaps)]
	r = r - r_i * gaps
	for i in range(r):
		ans[i] += 1
	print('B'.join([x * 'R' for x in ans]))