There are $n$ cards numbered $1, \ldots, n$. The card $i$ has a red digit $r_i$ and a blue digit $b_i$ written on it.

We arrange all $n$ cards in random order from left to right, with all permutations of $1, \ldots, n$ having the same probability. We then read all red digits on the cards from left to right, and obtain an integer $R$. In the same way, we read all blue digits and obtain an integer $B$. When reading a number, leading zeros can be ignored. If all digits in a number are zeros, then the number is equal to $0$. Below is an illustration of a possible rearrangement of three cards, and how $R$ and $B$ can be found.

Two players, Red and Blue, are involved in a bet. Red bets that after the shuffle $R > B$, and Blue bets that $R < B$. If in the end $R = B$, the bet results in a draw, and neither player wins.

Determine, which of the two players is more likely (has higher probability) to win the bet, or that their chances are equal. Refer to the Note section for a formal discussion of comparing probabilities.


-----Input-----

The first line contains a single integer $T$ ($1 \leq T \leq 100$) — the number of test cases.

Descriptions of $T$ test cases follow. Each test case description starts with a line containing a single integer $n$ ($1 \leq n \leq 1000$) — the number of cards.

The following line contains a string of $n$ digits $r_1, \ldots, r_n$ — red digits on cards $1, \ldots, n$ respectively.

The following line contains a string of $n$ digits $b_1, \ldots, b_n$ — blue digits on cards $1, \ldots, n$ respectively.

Note that digits in the same line are not separated with any delimiters.


-----Output-----

Print $T$ answers for the test cases in order, one per line.

If Red has a strictly higher change to win, print "RED".

If Blue has a strictly higher change to win, print "BLUE".

If both players are equally likely to win, print "EQUAL".

Note that all answers are case-sensitive.


-----Examples-----

Input
3
3
777
111
3
314
159
5
09281
09281
Output
RED
BLUE
EQUAL


-----Note-----

Formally, let $n_R$ be the number of permutations of cards $1, \ldots, n$ such that the resulting numbers $R$ and $B$ satisfy $R > B$. Similarly, let $n_B$ be the number of permutations such that $R < B$. If $n_R > n_B$, you should print "RED". If $n_R < n_B$, you should print "BLUE". If $n_R = n_B$, print "EQUAL".

In the first sample case, $R = 777$ and $B = 111$ regardless of the card order, thus Red always wins.

In the second sample case, there are two card orders when Red wins, and four card orders when Blue wins:

order $1, 2, 3$: $314 > 159$;

order $1, 3, 2$: $341 > 195$;

order $2, 1, 3$: $134 < 519$;

order $2, 3, 1$: $143 < 591$;

order $3, 1, 2$: $431 < 915$;

order $3, 2, 1$: $413 < 951$.

Since $R < B$ is more frequent, the answer is "BLUE".

In the third sample case, $R = B$ regardless of the card order, thus the bet is always a draw, and both Red and Blue have zero chance to win.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Probability


Solutions:
import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		n = int(input())
		a = list(input())
		b = list(input())
		counta = 0
		countb = 0
		for i in range(n):
			if a[i] > b[i]:
				counta += 1
			elif a[i] < b[i]:
				countb += 1
		if counta > countb:
			yield 'RED'
		elif counta < countb:
			yield 'BLUE'
		else:
			yield 'EQUAL'
t = int(input())
ans = gift()
print(*ans, sep='\n')


from collections import Counter
for test in range(int(input())):
	x = int(input())
	Ri = list(input())
	Bi = list(input())
	output = 0
	for (x, y) in zip(Ri, Bi):
		if x > y:
			output += 1
		elif x < y:
			output -= 1
	if output > 0:
		print('RED')
	elif output < 0:
		print('BLUE')
	else:
		print('EQUAL')


T = int(input())
for i in range(T):
	n = int(input())
	n1 = input()
	n2 = input()
	red = 0
	blue = 0
	for i in range(len(n1)):
		if n1[i] > n2[i]:
			red += 1
		elif n1[i] < n2[i]:
			blue += 1
		else:
			blue += 1
			red += 1
	if red > blue:
		print('RED')
	elif red < blue:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for _ in range(t):
	n = int(input())
	(r, b) = ((int(r) for r in input()), (int(b) for b in input()))
	diff = sum(((r - b) // abs(r - b) for (r, b) in zip(r, b) if r != b))
	res = 'RED' if diff > 0 else 'BLUE' if diff < 0 else 'EQUAL'
	print(res)


n = int(input())
for _ in range(n):
	x = int(input())
	r = input()
	b = input()
	lr = len(r)
	lb = len(b)
	c = lr
	na = 0
	nb = 0
	if r == b:
		print('EQUAL')
	else:
		i = 0
		while i < lr:
			if r[i] > b[i]:
				na += 1
			elif r[i] < b[i]:
				nb += 1
			i += 1
		if na > nb:
			print('RED')
		elif nb > na:
			print('BLUE')
		else:
			print('EQUAL')


def solve_case():
	n = int(input())
	a = input()
	b = input()
	x = sum([a[i] > b[i] for i in range(n)])
	y = sum([a[i] < b[i] for i in range(n)])
	if x > y:
		print('RED')
	elif x < y:
		print('BLUE')
	else:
		print('EQUAL')

def main():
	for _ in range(int(input())):
		solve_case()
main()


def solve():
	n = int(input())
	s1 = input()
	s2 = input()
	r = 0
	b = 0
	for i in range(n):
		if s1[i] > s2[i]:
			r = r + 1
		elif s1[i] < s2[i]:
			b = b + 1
	if r > b:
		print('RED')
	elif b > r:
		print('BLUE')
	else:
		print('EQUAL')
for tetsis in range(int(input())):
	solve()


for _ in range(int(input())):
	n = int(input())
	r = input()
	b = input()
	cnt = sum([(r[i] > b[i]) - (b[i] > r[i]) for i in range(n)])
	print(['EQUAL', 'RED', 'BLUE'][(cnt < 0) + (cnt != 0)])


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
t = int(input())
for i in range(t):
	n = int(input())
	red = input()
	blue = input()
	(r, b) = (0, 0)
	for i in range(n):
		if red[i] > blue[i]:
			r += 1
		elif blue[i] > red[i]:
			b += 1
	if r > b:
		print('RED')
	elif b > r:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	r = input()
	b = input()
	if r == b:
		print('EQUAL')
	else:
		red = 0
		blue = 0
		for i in range(n):
			if r[i] > b[i]:
				red += 1
			elif b[i] > r[i]:
				blue += 1
			else:
				continue
		if red > blue:
			print('RED')
		elif blue > red:
			print('BLUE')
		else:
			print('EQUAL')


t = int(input())
for i in range(t):
	n = int(input())
	r = input()
	b = input()
	rl = list(r)
	red = 0
	blue = 0
	bl = list(b)
	for i in range(n):
		if rl[i] > bl[i]:
			red += 1
		if bl[i] > rl[i]:
			blue += 1
	if red > blue:
		print('RED')
	elif blue > red:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	r = [int(i) for i in input()]
	b = [int(i) for i in input()]
	R = 0
	B = 0
	for i in range(n):
		if r[i] > b[i]:
			R += 1
		elif r[i] < b[i]:
			B += 1
		else:
			pass
	if R > B:
		print('RED')
	elif B > R:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	r = input()
	b = input()
	r1 = [int(x) for x in str(r)]
	b1 = [int(y) for y in str(b)]
	cnt_r = 0
	cnt_b = 0
	cnt = 0
	for i in range(n):
		if r1[i] > b1[i]:
			cnt_r += 1
		elif b1[i] > r1[i]:
			cnt_b += 1
		else:
			cnt += 1
	if cnt_r > cnt_b:
		print('RED')
	elif cnt_b > cnt_r:
		print('BLUE')
	else:
		print('EQUAL')


for i in range(int(input())):
	n = int(input())
	red = input()
	blue = input()
	countred = 0
	countblue = 0
	both = 0
	for i in range(n):
		if red[i] > blue[i]:
			countred += 1
		elif red[i] < blue[i]:
			countblue += 1
		else:
			both += 1
	if countred > countblue:
		print('RED')
	elif countred < countblue:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	sa = sb = 0
	for i in range(n):
		if a[i] > b[i]:
			sa += 1
		elif b[i] > a[i]:
			sb += 1
	if sa > sb:
		print('RED')
	elif sb > sa:
		print('BLUE')
	else:
		print('EQUAL')


case = int(input())
for i in range(case):
	n = int(input())
	r = [int(i) for i in input()]
	b = [int(i) for i in input()]
	blue = 0
	red = 0
	equal = 0
	k = []
	for t in range(n):
		if r[t] > b[t]:
			red += 1
		elif r[t] == b[t]:
			equal += 1
		else:
			blue += 1
	if red > blue:
		print('RED')
	elif blue > red:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for i in range(t):
	n = int(input())
	r = input()
	b = input()
	cr = 0
	br = 0
	for i in range(n):
		if r[i] > b[i]:
			cr += 1
		elif r[i] < b[i]:
			br += 1
	if cr > br:
		print('RED')
	elif cr < br:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	c1 = 0
	c2 = 0
	for i in range(n):
		if a[i] > b[i]:
			c1 += 1
		elif b[i] > a[i]:
			c2 += 1
	if c1 == c2:
		print('EQUAL')
	elif c1 > c2:
		print('RED')
	else:
		print('BLUE')


import sys
input = sys.stdin.readline

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def main():
	for _ in range(int(input())):
		n = int(input())
		r = input()
		b = input()
		f = 0
		s = 0
		for i in range(n):
			if r[i] > b[i]:
				f += 1
			elif b[i] > r[i]:
				s += 1
		if f > s:
			print('RED')
		elif s > f:
			print('BLUE')
		else:
			print('EQUAL')
	return
main()


import math
t = int(input())
for _ in range(t):
	n = int(input())
	r = str(input())
	b = str(input())
	red = 0
	blue = 0
	for i in range(n):
		if int(r[i]) > int(b[i]):
			red += 1
		elif int(b[i]) > int(r[i]):
			blue += 1
	if red > blue:
		print('RED')
	elif red < blue:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	s = input()
	s1 = input()
	a = 0
	b = 0
	for i in range(n):
		if s[i] > s1[i]:
			a = a + 1
		elif s[i] < s1[i]:
			b = b + 1
	if a > b:
		print('RED')
	elif b > a:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	red = list(input())
	blue = list(input())
	(r, b) = (0, 0)
	for (x, y) in zip(red, blue):
		if x > y:
			r += 1
		elif x < y:
			b += 1
	if b > r:
		print('BLUE')
	elif b < r:
		print('RED')
	else:
		print('EQUAL')


t = int(input())
for i in range(t):
	n = int(input())
	str1 = input()
	str2 = input()
	a = 0
	b = 0
	for i in range(n):
		if str1[i] > str2[i]:
			a = a + 1
		elif str1[i] < str2[i]:
			b = b + 1
		else:
			a = a
			b = b
	if a > b:
		print('RED')
	elif a < b:
		print('BLUE')
	else:
		print('EQUAL')


for i in range(int(input())):
	n = int(input())
	r = str(input())
	b = str(input())
	rr = 0
	bb = 0
	for i in range(n):
		if r[i] > b[i]:
			rr += 1
		elif r[i] < b[i]:
			bb += 1
	if rr == bb:
		print('EQUAL')
	elif rr > bb:
		print('RED')
	else:
		print('BLUE')


for t in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	c = 0
	d = 0
	for i in range(n):
		if a[i] > b[i]:
			c += 1
		elif a[i] < b[i]:
			d += 1
	if c > d:
		print('RED')
	elif c < d:
		print('BLUE')
	else:
		print('EQUAL')


def handle(red, blue):
	(r, b) = (0, 0)
	for rb in range(len(red)):
		if red[rb] > blue[rb]:
			r += 1
		elif red[rb] < blue[rb]:
			b += 1
		else:
			r += 1
			b += 1
	if r > b:
		print('RED')
	elif r < b:
		print('BLUE')
	else:
		print('EQUAL')
t = int(input().strip())
for c in range(t):
	digits = int(input().strip())
	red = input().strip()
	blue = input().strip()
	handle(red, blue)


from sys import stdin, stdout
(input, print) = (stdin.readline, stdout.write)
for x in range(int(input())):
	n = int(input())
	red = list(input())
	blue = list(input())
	red_more = 0
	blue_more = 0
	for i in range(n):
		x = red[i]
		y = blue[i]
		if x > y:
			red_more += 1
		elif y > x:
			blue_more += 1
	if red_more > blue_more:
		print('RED')
		print('\n')
	elif blue_more > red_more:
		print('BLUE')
		print('\n')
	else:
		print('EQUAL')
		print('\n')


for _ in range(int(input())):
	n = int(input())
	p = str(input())
	q = str(input())
	countR = 0
	countB = 0
	for i in range(n):
		if p[i] > q[i]:
			countR += 1
		elif p[i] < q[i]:
			countB += 1
	if countR > countB:
		print('RED')
	elif countB > countR:
		print('BLUE')
	else:
		print('EQUAL')


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	r = stdin.readline().rstrip()
	b = stdin.readline().rstrip()
	res = 0
	for (ri, bi) in zip(r, b):
		if ri > bi:
			res += 1
		elif ri < bi:
			res -= 1
	if 0 == res:
		print('EQUAL')
	elif res > 0:
		print('RED')
	else:
		print('BLUE')


t = int(input())
for _ in range(t):
	n = int(input())
	r = input()
	b = input()
	wr = 0
	wb = 0
	if int(r) == int(b):
		print('EQUAL')
	else:
		for i in range(n):
			if r[i] > b[i]:
				wr += 1
			elif r[i] < b[i]:
				wb += 1
		if wb > wr:
			print('BLUE')
		elif wr > wb:
			print('RED')
		else:
			print('EQUAL')


for tt in range(int(input())):
	y = int(input())
	x = list(input())
	z = list(input())
	a = [x[i] > z[i] for i in range(y)]
	b = [z[i] > x[i] for i in range(y)]
	if a.count(True) > b.count(True):
		print('RED')
	elif a.count(True) < b.count(True):
		print('BLUE')
	else:
		print('EQUAL')


cases = int(input())
while cases:
	cases -= 1
	num = input()
	arr_r = list(map(int, input()))
	arr_b = list(map(int, input()))
	r = 0
	b = 0
	for (rr, bb) in zip(arr_r, arr_b):
		if rr > bb:
			r += 1
		elif bb > rr:
			b += 1
	if r == b:
		print('EQUAL')
	elif r > b:
		print('RED')
	else:
		print('BLUE')


import sys
T = int(sys.stdin.readline().strip())
for _ in range(T):
	r = b = 0
	n = int(sys.stdin.readline().strip())
	R = sys.stdin.readline().strip()
	B = sys.stdin.readline().strip()
	for i in range(n):
		if R[i] > B[i]:
			r += 1
		if R[i] < B[i]:
			b += 1
	if r > b:
		print('RED')
	if r == b:
		print('EQUAL')
	if r < b:
		print('BLUE')


import sys
import math

def read_generator():
	while True:
		tokens = sys.stdin.readline().rstrip().split(' ')
		for t in tokens:
			yield t
reader = read_generator()

def readword():
	return next(reader)

def readint():
	return int(next(reader))

def readfloat():
	return float(next(reader))

def readline():
	return input()

def readlistint(n):
	return [readint() for _ in range(n)]

def readliststr(n):
	return [readword() for _ in range(n)]

def readlistfloat(n):
	return [readfloat() for _ in range(n)]

def solve(n, r, b):
	s1 = 0
	s2 = 0
	for i in range(n):
		if r[i] > b[i]:
			s1 += 1
		if r[i] < b[i]:
			s2 += 1
	if s1 == s2:
		return 'EQUAL'
	if s1 > s2:
		return 'RED'
	return 'BLUE'
tests = readint()
for test in range(tests):
	n = readint()
	r = readword()
	b = readword()
	print(solve(n, r, b))


def main():
	t = int(input())
	result = []
	for _ in range(t):
		n = int(input())
		reds = input()
		blues = input()
		if reds == blues:
			result.append('EQUAL')
			continue
		nr = 0
		nb = 0
		for i in range(n):
			if int(reds[i]) > int(blues[i]):
				nr += 1
			elif int(reds[i]) < int(blues[i]):
				nb += 1
		if nr > nb:
			result.append('RED')
		elif nb > nr:
			result.append('BLUE')
		else:
			result.append('EQUAL')
	for r in result:
		print(r)
main()


t = int(input())
for k in range(t):
	n = int(input())
	lis = input()
	lis1 = input()
	tr = 0
	tb = 0
	for i in range(n):
		if int(lis[i]) > int(lis1[i]):
			tr = tr + 1
		elif int(lis[i]) < int(lis1[i]):
			tb = tb + 1
	if tr > tb:
		print('RED')
	elif tb > tr:
		print('BLUE')
	else:
		print('EQUAL')


n = int(input())
for i in range(n):
	w = int(input())
	r = list(map(int, input()))
	b = list(map(int, input()))
	if r == b:
		print('EQUAL')
		continue
	red = 0
	blue = 0
	for j in range(w):
		if r[j] > b[j]:
			red += 1
		elif b[j] > r[j]:
			blue += 1
	if red > blue:
		print('RED')
	elif red < blue:
		print('BLUE')
	else:
		print('EQUAL')


def op():
	n = int(input())
	red = input()
	blue = input()
	B = 0
	R = 0
	for i in range(n):
		if red[i] > blue[i]:
			R = R + 1
		if blue[i] > red[i]:
			B = B + 1
	if R > B:
		print('RED')
	if B > R:
		print('BLUE')
	if B == R:
		print('EQUAL')
t = int(input())
while t > 0:
	t = t - 1
	op()


import sys
sys.setrecursionlimit(10 ** 7)
import copy
MAXN = 1001
fact = [1]
for i in range(MAXN):
	fact.append(fact[-1] * (i + 1))

def main():
	n = int(input())
	r = input()
	b = input()
	cards = [0] * 3
	for i in range(n):
		if r[i] > b[i]:
			cards[0] += 1
		elif r[i] < b[i]:
			cards[1] += 1
		else:
			cards[2] += 1

	def dfs(cards):
		rest = sum(cards)
		if rest == 0:
			return (1, 1)
		f = fact[rest - 1]
		(nr, nb) = (0, 0)
		for i in range(3):
			if cards[i] == 0:
				continue
			if i == 0:
				nr += cards[i] * f
			elif i == 1:
				nb += cards[i] * f
			else:
				cards_next = copy.copy(cards)
				cards_next[i] -= 1
				(_nr, _nb) = dfs(cards_next)
				nr += _nr * cards[i]
				nb += _nb * cards[i]
		return (nr, nb)
	(nr, nb) = dfs(cards)
	if nr > nb:
		print('RED')
	elif nr < nb:
		print('BLUE')
	else:
		print('EQUAL')
	return
t = int(input())
for i in range(t):
	main()


def solve():
	n = int(input())
	r = list(map(int, list(input())))
	b = list(map(int, list(input())))
	(rp, bp) = (0, 0)
	for i in range(n):
		if r[i] > b[i]:
			rp += 1
		elif r[i] < b[i]:
			bp += 1
	if rp > bp:
		print('RED')
	elif rp < bp:
		print('BLUE')
	else:
		print('EQUAL')
t = int(input())
for _ in range(t):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	red = input()
	blue = input()
	r = 0
	b = 0
	q = 0
	for i in range(n):
		if int(red[i]) > int(blue[i]):
			r = r + 1
		elif int(red[i]) < int(blue[i]):
			b = b + 1
		else:
			q = q + 1
	if r > b:
		print('RED')
	elif b > r:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	s1 = input()
	s2 = input()
	cr = 0
	cb = 0
	for i in range(n):
		if s1[i] > s2[i]:
			cr += 1
		elif s2[i] > s1[i]:
			cb += 1
	if cr == cb:
		print('EQUAL')
	elif cr > cb:
		print('RED')
	else:
		print('BLUE')


for _ in range(int(input())):
	n = int(input())
	r = input()
	b = input()
	summ = 0
	for i in range(n):
		if int(r[i]) > int(b[i]):
			summ += 1
		elif int(b[i]) > int(r[i]):
			summ -= 1
	if summ > 0:
		print('RED')
	elif summ == 0:
		print('EQUAL')
	else:
		print('BLUE')


T = int(input())
for _ in range(T):
	N = int(input())
	R = input()
	B = input()
	r = [ord(R[i]) - ord('0') for i in range(N)]
	b = [ord(B[i]) - ord('0') for i in range(N)]
	rwin = sum([int(r[i] > b[i]) for i in range(N)])
	bwin = sum([int(b[i] > r[i]) for i in range(N)])
	if rwin > bwin:
		print('RED')
	if rwin == bwin:
		print('EQUAL')
	if rwin < bwin:
		print('BLUE')


for _ in range(int(input())):
	m = int(input())
	a = 0
	c = 0
	r = input()
	b = input()
	for i in range(m):
		if r[i] > b[i]:
			a += 1
		elif r[i] < b[i]:
			c += 1
		else:
			c += 1
			a += 1
	if a > c:
		print('RED')
	elif c > a:
		print('BLUE')
	else:
		print('EQUAL')


for i in range(int(input())):
	n = int(input())
	s1 = list(input())
	s2 = list(input())
	(cnt1, cnt2) = (0, 0)
	for i in range(n):
		if s1[i] > s2[i]:
			cnt1 += 1
		elif s1[i] < s2[i]:
			cnt2 += 1
	if cnt1 > cnt2:
		print('RED')
	elif cnt1 < cnt2:
		print('BLUE')
	else:
		print('EQUAL')


w = int(input())
for j in range(w):
	z = int(input())
	n = input()
	s = input()
	r = 0
	b = 0
	for i in range(z):
		if n[i] > s[i]:
			r += 1
		elif n[i] < s[i]:
			b += 1
	if r > b:
		print('RED')
	elif r < b:
		print('BLUE')
	else:
		print('EQUAL')


T = int(input())
for _ in range(T):
	n = int(input())
	red = 0
	blue = 0
	rcard = input()
	bcard = input()
	for (r, b) in zip(rcard, bcard):
		if r > b:
			red += 1
		elif b > r:
			blue += 1
		else:
			red += 1
			blue += 1
	if red > blue:
		print('RED')
	elif blue > red:
		print('BLUE')
	else:
		print('EQUAL')


T = int(input())
R = 0
B = 0
for i in range(T):
	n = int(input())
	r = input()
	b = input()
	for i in range(len(r)):
		if r[i] > b[i]:
			R += 1
		elif r[i] < b[i]:
			B += 1
	if R > B:
		print('RED')
	elif B > R:
		print('BLUE')
	else:
		print('EQUAL')
	R = 0
	B = 0


t = int(input())
for i in range(t):
	n = int(input())
	r = input()
	b = input()
	rp = 0
	bp = 0
	for i in range(n):
		if int(r[i]) > int(b[i]):
			rp = rp + 1
		elif int(b[i]) > int(r[i]):
			bp = bp + 1
	if rp > bp:
		print('RED')
	elif bp > rp:
		print('BLUE')
	else:
		print('EQUAL')


from pprint import pprint
import sys

def do():
	n = int(input())
	s1 = input()
	s2 = input()
	s1 = list(map(int, s1))
	s2 = list(map(int, s2))
	w1 = w2 = 0
	for i in range(n):
		if s1[i] > s2[i]:
			w1 += 1
		elif s1[i] < s2[i]:
			w2 += 1
		else:
			pass
	if w1 == w2:
		print('EQUAL')
		return
	if w1 > w2:
		print('RED')
		return
	if w1 < w2:
		print('BLUE')
		return
q = int(input())
for _ in range(q):
	do()


t = int(input())
res = []
for i in range(t):
	n = int(input())
	reds = input()
	reds = list(map(int, [char for char in reds]))
	blues = input()
	blues = list(map(int, [char for char in blues]))
	(bluepoints, redpoints) = (0, 0)
	for card in range(n):
		blue = blues[card]
		red = reds[card]
		if blue > red:
			bluepoints += 1
		elif red > blue:
			redpoints += 1
	if redpoints > bluepoints:
		res.append('RED')
	elif redpoints < bluepoints:
		res.append('BLUE')
	elif redpoints == bluepoints:
		res.append('EQUAL')
for r in res:
	print(r)


def predictWinner(length, red, blue):
	sum_of_red = 0
	sum_of_blue = 0
	for i in range(length):
		if red[i] > blue[i]:
			sum_of_red += 1
		if blue[i] > red[i]:
			sum_of_blue += 1
	if sum_of_blue > sum_of_red:
		return 'BLUE'
	elif sum_of_red > sum_of_blue:
		return 'RED'
	elif sum_of_red == sum_of_red:
		return 'EQUAL'
tests = int(input())
result = list(range(tests))
for i in range(tests):
	length = int(input())
	red = str(input())
	blue = str(input())
	result[i] = predictWinner(length, red, blue)
for j in range(tests):
	print(result[j])


import sys
input = sys.stdin.readline
from sys import stdin, stdout
from collections import defaultdict, Counter
M = 10 ** 9 + 7

def main():
	for _ in range(int(input())):
		n = int(input())
		s1 = [int(i) for i in input().strip()]
		s2 = [int(i) for i in input().strip()]
		(r, b, e) = (0, 0, 0)
		for i in range(n):
			if s1[i] == s2[i]:
				e += 1
			elif s1[i] > s2[i]:
				r += 1
			else:
				b += 1
		if r > b:
			print('RED')
		elif r < b:
			print('BLUE')
		else:
			print('EQUAL')
main()


t = int(input())
while t:
	n = int(input())
	reds = list(map(int, list(input())))
	blues = list(map(int, list(input())))
	red = 0
	blue = 0
	for i in range(n):
		if reds[i] > blues[i]:
			red += 1
		elif reds[i] < blues[i]:
			blue += 1
	if red == blue:
		print('EQUAL')
	elif red > blue:
		print('RED')
	else:
		print('BLUE')
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	(red, blue) = (0, 0)
	for i in range(n):
		if a[i] > b[i]:
			red += 1
		elif b[i] > a[i]:
			blue += 1
		else:
			pass
	if red > blue:
		print('RED')
	elif blue > red:
		print('BLUE')
	else:
		print('EQUAL')


import string
for _ in range(int(input())):
	n = int(input())
	r = input()
	b = input()
	count_r = 0
	count_b = 0
	for i in range(n):
		if ord(r[i]) > ord(b[i]):
			count_r += 1
		elif ord(r[i]) < ord(b[i]):
			count_b += 1
	if count_b > count_r:
		print('BLUE')
	elif count_r > count_b:
		print('RED')
	else:
		print('EQUAL')


for _ in [0] * int(input()):
	n = int(input())
	a = str(input())
	b = str(input())
	t = 0
	for i in range(n):
		if a[i] < b[i]:
			t += 1
		elif a[i] > b[i]:
			t -= 1
	if t > 0:
		print('BLUE')
	elif t == 0:
		print('EQUAL')
	else:
		print('RED')


for i in range(int(input())):
	n = int(input())
	r = input()
	b = input()
	r_str = list(map(str, r))
	b_str = list(map(str, b))
	b_score = 0
	r_score = 0
	for i in range(n):
		if r_str[i] > b_str[i]:
			r_score += 1
		elif b_str[i] > r_str[i]:
			b_score += 1
	if r_score > b_score:
		print('RED')
	elif r_score < b_score:
		print('BLUE')
	else:
		print('EQUAL')


for i in range(int(input())):
	(n, ans1, ans2) = (int(input()), 0, 0)
	(str1, str2) = (list(input()), list(input()))
	for j in range(n):
		if str1[j] > str2[j]:
			ans1 += 1
		elif str1[j] < str2[j]:
			ans2 += 1
	if ans1 == ans2:
		print('EQUAL')
	else:
		print('RED' if ans1 > ans2 else 'BLUE')


def main():
	t = int(input())
	for ti in range(t):
		sz = int(input())
		rs = input()
		rsz = len(rs) // sz
		r = 0
		bs = input()
		bsz = len(bs) // sz
		b = 0
		for ni in range(sz):
			ri = ni * rsz
			bi = ni * bsz
			diff = int(rs[ri:ri + rsz]) - int(bs[bi:bi + bsz])
			if diff > 0:
				r += 1
			elif diff < 0:
				b += 1
		print('RED' if r > b else 'BLUE' if r < b else 'EQUAL')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	rc = 0
	bc = 0
	r = input()
	b = input()
	for i in range(n):
		if r[i] > b[i]:
			rc += 1
		elif r[i] < b[i]:
			bc += 1
	if rc > bc:
		print('RED')
	elif rc < bc:
		print('BLUE')
	else:
		print('EQUAL')


def calc_prob(rd, bd):
	rc = 0
	bc = 0
	for i in range(len(rd)):
		if rd[i] > bd[i]:
			rc += 1
		elif rd[i] < bd[i]:
			bc += 1
		else:
			rc += 1
			bc += 1
	return (rc, bc)
t = int(input())
for i in range(t):
	n = int(input())
	red_digits = input()
	blue_digits = input()
	(p_r, p_b) = calc_prob(red_digits, blue_digits)
	if p_r > p_b:
		print('RED')
	if p_r < p_b:
		print('BLUE')
	if p_r == p_b:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	ar = input()
	br = input()
	a = 0
	b = 0
	for i in range(n):
		if ar[i] > br[i]:
			a += 1
		elif ar[i] < br[i]:
			b += 1
	if a > b:
		print('RED')
	elif a < b:
		print('BLUE')
	else:
		print('EQUAL')


def solve(n):
	r = input()
	b = input()
	if r == b:
		return 'EQUAL'
	d = {'r': 0, 'b': 0}
	for i in range(n):
		if r[i] > b[i]:
			d['r'] += 1
		elif b[i] > r[i]:
			d['b'] += 1
	if d['r'] > d['b']:
		return 'RED'
	elif d['b'] > d['r']:
		return 'BLUE'
	return 'EQUAL'
for _ in range(int(input())):
	print(solve(int(input())))


for _ in range(int(input())):
	m = int(input())
	s1 = input()
	s2 = input()
	c1 = 0
	d1 = 0
	for i in range(m):
		if s1[i] > s2[i]:
			c1 = c1 + 1
		elif s1[i] < s2[i]:
			d1 = d1 + 1
	if d1 > c1:
		print('BLUE')
	elif c1 > d1:
		print('RED')
	else:
		print('EQUAL')


def STR():
	return list(input())

def INT():
	return int(input())

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

def MAP2():
	return map(float, input().split())

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

def STRING():
	return input()
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter
from math import *
from itertools import permutations
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
for tt in range(INT()):
	n = INT()
	x1 = STR()
	x2 = STR()
	cnt1 = 0
	cnt2 = 0
	for i in range(n):
		if int(x1[i]) > int(x2[i]):
			cnt1 += 1
		elif int(x2[i]) > int(x1[i]):
			cnt2 += 1
		else:
			continue
	if cnt1 > cnt2:
		print('RED')
	elif cnt2 > cnt1:
		print('BLUE')
	else:
		print('EQUAL')


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	R = input().strip()
	B = input().strip()
	cnt1 = cnt2 = cnt3 = 0
	for i in range(n):
		if int(R[i]) > int(B[i]):
			cnt1 += 1
		elif int(R[i]) < int(B[i]):
			cnt2 += 1
		else:
			cnt3 += 1
	if cnt3 == n:
		return 'EQUAL'
	if cnt1 > cnt2:
		return 'RED'
	elif cnt1 < cnt2:
		return 'BLUE'
	else:
		return 'EQUAL'
for _ in range(int(input())):
	print(solve())


try:
	for _ in range(int(input())):
		n = int(input())
		r = input()
		b = input()
		rc = 0
		bc = 0
		eq = 0
		for i in range(n):
			if int(r[i]) > int(b[i]):
				rc += 1
			elif int(r[i]) < int(b[i]):
				bc += 1
			else:
				eq += 1
		if rc > bc:
			print('RED')
		elif bc > rc:
			print('BLUE')
		elif eq == n:
			print('EQUAL')
		elif bc == rc:
			print('EQUAL')
except EOFError as e:
	pass


t = int(input())
for i in range(t):
	n = input()
	red = input()
	blue = input()
	(p, j) = (0, 0)
	for char in red:
		if char > blue[j]:
			p += 1
		elif char < blue[j]:
			p -= 1
		else:
			pass
		j += 1
	if p > 0:
		print('RED')
	elif p < 0:
		print('BLUE')
	else:
		print('EQUAL')


def solve():
	pass
t = int(input())
for _ in range(t):
	n = int(input())
	red = list(map(int, list(input())))
	blue = list(map(int, list(input())))
	countRed = 0
	countBlue = 0
	for i in range(n):
		if red[i] > blue[i]:
			countRed += 1
		elif blue[i] > red[i]:
			countBlue += 1
	if countRed > countBlue:
		print('RED')
	elif countBlue > countRed:
		print('BLUE')
	else:
		print('EQUAL')


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
import functools
from operator import ixor
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
for _ in range(int(input())):
	n = int(input())
	w = input()
	e = input()
	r = 0
	b = 0
	for i in range(n):
		if int(w[i]) > int(e[i]):
			r += 1
		elif int(w[i]) < int(e[i]):
			b += 1
	if r > b:
		print('RED')
	elif r < b:
		print('BLUE')
	else:
		print('EQUAL')


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
from itertools import accumulate as ac
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')
t = ip()
for _ in range(t):
	n = ip()
	r = ips()
	b = ips()
	r = [int(i) for i in r]
	b = [int(i) for i in b]
	cr = 0
	cb = 0
	for i in range(n):
		if r[i] > b[i]:
			cr += 1
		elif b[i] > r[i]:
			cb += 1
	if cr == cb:
		ans = 'EQUAL'
	elif cr > cb:
		ans = 'RED'
	else:
		ans = 'BLUE'
	print(ans)


from itertools import permutations
t = int(input())
for e in range(t):
	red = 0
	blue = 0
	n = int(input())
	a = input()
	b = input()
	for i in range(n):
		if int(a[i]) > int(b[i]):
			red += 1
		elif int(b[i]) > int(a[i]):
			blue += 1
	if red > blue:
		print('RED')
	elif red < blue:
		print('BLUE')
	else:
		print('EQUAL')


for i in range(int(input())):
	n = int(input())
	s1 = input()
	s2 = input()
	a = 0
	b = 0
	e = 0
	for j in range(n):
		if s1[j] > s2[j]:
			a = a + 1
		elif s1[j] < s2[j]:
			b = b + 1
		else:
			e = e + 1
	if a < b:
		print('BLUE')
	elif a > b:
		print('RED')
	else:
		print('EQUAL')


import sys
input = sys.stdin.readline

def solve(n, redS, blueS):
	count = [0, 0]
	for i in range(n):
		if int(redS[i]) > int(blueS[i]):
			count[0] += 1
		elif int(redS[i]) < int(blueS[i]):
			count[1] += 1
	if count[0] == count[1]:
		print('EQUAL')
	elif count[0] > count[1]:
		print('RED')
	else:
		print('BLUE')
t = int(input())
for _ in range(t):
	l = int(input())
	red = str(input())
	blue = str(input())
	solve(l, red, blue)


t = int(input())
for i in range(1, t + 1):
	n = int(input())
	s1 = input()
	s2 = input()
	c1 = len([x for x in range(0, len(s1)) if s1[x] > s2[x]])
	c2 = len([x for x in range(0, len(s2)) if s2[x] > s1[x]])
	if c1 == c2:
		print('EQUAL')
	elif c1 > c2:
		print('RED')
	else:
		print('BLUE')


for i in range(int(input())):
	n = int(input())
	r = 0
	b = 0
	rl = input()
	bl = input()
	for i in range(n):
		if int(rl[i]) > int(bl[i]):
			r = r + 1
		elif int(rl[i]) < int(bl[i]):
			b = b + 1
	if r == b:
		print('EQUAL')
	elif r > b:
		print('RED')
	else:
		print('BLUE')


I = input
exec(int(I()) * "I();k=sum((x>y)-(y>x)for x,y in zip(I(),I()));print(('EQUAL','RED','BLUE')[(k>0)-(k<0)]);")


t = int(input())
for z in range(t):
	n = int(input())
	r = input()
	b = input()
	r = list(r)
	b = list(b)
	R = 0
	B = 0
	for i in range(n):
		if r[i] > b[i]:
			R += 1
		elif r[i] < b[i]:
			B += 1
	if R > B:
		print('RED')
	elif B > R:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
while t > 0:
	n = int(input())
	r = input()
	b = input()
	r1 = 0
	b1 = 0
	for i in range(n):
		if r[i] > b[i]:
			r1 += 1
		elif b[i] > r[i]:
			b1 += 1
	if r1 > b1:
		print('RED')
	elif b1 > r1:
		print('BLUE')
	else:
		print('EQUAL')
	t = t - 1


for _ in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	x = 0
	y = 0
	for i in range(n):
		if int(a[i]) > int(b[i]):
			x += 1
		elif int(a[i]) < int(b[i]):
			y += 1
	if x > y:
		print('RED')
	elif x < y:
		print('BLUE')
	else:
		print('EQUAL')


n = int(input())
for _ in range(n):
	k = input()
	r = list(map(int, input()))
	b = list(map(int, input()))
	tr = 0
	tb = 0
	for (i, j) in zip(r, b):
		if i > j:
			tr += 1
		elif j > i:
			tb += 1
	if tr > tb:
		print('RED')
	elif tb > tr:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for _ in range(t):
	n = int(input())
	r = input()
	b = input()
	r = list(r)
	b = list(b)
	cntr = 0
	cntb = 0
	for i in range(n):
		if int(r[i]) > int(b[i]):
			cntr += 1
		elif int(r[i]) < int(b[i]):
			cntb += 1
		else:
			pass
	if cntr > cntb:
		print('RED')
	elif cntb > cntr:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for i in range(t):
	n = input()
	s1 = input()
	s2 = input()
	nr = 0
	nb = 0
	for j in range(len(s1)):
		if s1[j] > s2[j]:
			nr += 1
		elif s1[j] < s2[j]:
			nb += 1
	if nr > nb:
		print('RED')
	elif nr < nb:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for i in range(t):
	digits = int(input())
	s1 = [int(data) for data in input()]
	s2 = [int(data) for data in input()]
	s11 = 0
	s22 = 0
	for j in range(digits):
		if s1[j] == s2[j]:
			continue
		elif s1[j] > s2[j]:
			s11 += 1
		else:
			s22 += 1
	if s11 == s22:
		print('EQUAL')
	elif s11 > s22:
		print('RED')
	else:
		print('BLUE')


t = int(input())
for i in range(t):
	n = int(input())
	s1 = input()
	s2 = input()
	if s1 == s2:
		print('EQUAL')
	else:
		(res1, res2) = (0, 0)
		for i in range(n):
			if s1[i] > s2[i]:
				res1 += 1
			elif s1[i] < s2[i]:
				res2 += 1
		if res1 == res2:
			print('EQUAL')
		elif res1 < res2:
			print('BLUE')
		else:
			print('RED')


for i in range(int(input())):
	n = int(input())
	n1 = input()
	n2 = input()
	r1 = r2 = 0
	for i in range(n):
		if n1[i] > n2[i]:
			r1 += 1
		elif n1[i] < n2[i]:
			r2 += 1
	if r1 == r2:
		print('EQUAL')
	elif r1 < r2:
		print('BLUE')
	else:
		print('RED')


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input()]
	b = [int(x) for x in input()]
	c = [(a[i] > b[i]) - (a[i] < b[i]) for i in range(0, n)]
	(x, y) = (c.count(1), c.count(-1))
	print(['BLUE', 'EQUAL', 'RED'][(x > y) - (x < y) + 1])


for _ in range(int(input())):
	n = int(input())
	ra = list(input())
	ba = list(input())
	c = 0
	cc = 0
	for i in range(n):
		if ra[i] > ba[i]:
			c += 1
		elif ra[i] < ba[i]:
			cc += 1
	if c == cc:
		print('EQUAL')
	elif cc > c:
		print('BLUE')
	else:
		print('RED')


import math
import sys
import itertools
import fractions
wtf = sys.stdin.read()
wtf = wtf.strip().split('\n')
GAP = 3
for t in [wtf[i:i + GAP] for i in range(1, len(wtf), GAP)]:
	n = int(t[0])
	R = list(map(int, [x for x in t[1]]))
	B = list(map(int, [x for x in t[2]]))
	Rm = 0
	Bm = 0
	for p in zip(R, B):
		if p[0] > p[1]:
			Rm += 1
		elif p[0] < p[1]:
			Bm += 1
	if Rm > Bm:
		print('RED')
	elif Rm < Bm:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for i in range(t):
	n = int(input())
	row1 = input()
	row2 = input()
	red = 0
	blue = 0
	for j in range(n):
		if row1[j] > row2[j]:
			red += 1
		elif row1[j] < row2[j]:
			blue += 1
		else:
			red += 1
			blue += 1
	if red > blue:
		print('RED')
	elif blue > red:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for _ in range(t):
	n = int(input())
	red_digits_str = input()
	blue_digits_str = input()
	greater_red_digit_count = 0
	greater_blue_digit_count = 0
	for digit_i in range(n):
		r_digit = int(red_digits_str[digit_i])
		b_digit = int(blue_digits_str[digit_i])
		if r_digit > b_digit:
			greater_red_digit_count += 1
		elif b_digit > r_digit:
			greater_blue_digit_count += 1
	if greater_red_digit_count > greater_blue_digit_count:
		print('RED')
	elif greater_blue_digit_count > greater_red_digit_count:
		print('BLUE')
	else:
		print('EQUAL')


import sys
try:
	(sys.stdin, sys.stdout) = (open('in.txt', 'r'), open('out.txt', 'w'))
except:
	pass
ii1 = lambda : int(sys.stdin.readline().strip())
is1 = lambda : sys.stdin.readline().strip()
iia = lambda : list(map(int, sys.stdin.readline().strip().split()))
isa = lambda : sys.stdin.readline().strip().split()
mod = int(1000000000.0 + 7)
from collections import *
from math import *
for _ in range(ii1()):
	n = ii1()
	arr = is1()
	ar = is1()
	r = 0
	b = 0
	for i in range(n):
		if arr[i] > ar[i]:
			r += 1
		elif arr[i] < ar[i]:
			b += 1
		else:
			b += 1
			r += 1
	if r == b:
		print('EQUAL')
	elif r > b:
		print('RED')
	else:
		print('BLUE')


try:
	for _ in range(int(input())):
		x = int(input())
		lr = str(input())
		lb = str(input())
		i = 0
		r = 0
		b = 0
		while i < x:
			if int(lb[i]) > int(lr[i]):
				b += 1
			elif int(lr[i]) > int(lb[i]):
				r += 1
			i += 1
		if r > b:
			print('RED')
		elif b > r:
			print('BLUE')
		else:
			print('EQUAL')
except:
	pass


for _ in range(int(input())):
	n = int(input())
	s1 = input()
	s2 = input()
	c1 = 0
	c2 = 0
	for i in range(n):
		if s1[i] > s2[i]:
			c1 += 1
		elif s2[i] > s1[i]:
			c2 += 1
	if c1 == c2:
		print('EQUAL')
	elif c1 > c2:
		print('RED')
	else:
		print('BLUE')


t = int(input())
arr = []
for i in range(t):
	x = int(input())
	r = input()
	b = input()
	arr.append([x, r, b])
for i in arr:
	re = 0
	blu = 0
	for j in range(i[0]):
		if i[1][j] > i[2][j]:
			re += 1
		elif i[2][j] > i[1][j]:
			blu += 1
	if re == blu:
		print('EQUAL')
	elif re > blu:
		print('RED')
	else:
		print('BLUE')


import sys, math
input = sys.stdin.readline
INF = int(1000000000.0) + 7
MOD = 998244353

def solve():
	n = int(input())
	s1 = input().rstrip()
	s2 = input().rstrip()
	cnt = 0
	for i in range(n):
		if s1[i] > s2[i]:
			cnt += 1
		elif s1[i] < s2[i]:
			cnt -= 1
	if cnt > 0:
		print('RED')
	elif cnt == 0:
		print('EQUAL')
	else:
		print('BLUE')
t = 1
t = int(input())
for i in range(1, t + 1):
	solve()


for _ in range(int(input())):
	n = int(input())
	(R, B) = (0, 0)
	A = input()
	C = input()
	if A == C:
		print('EQUAL')
	else:
		for i in range(len(A)):
			if int(A[i]) > int(C[i]):
				R += 1
			elif int(C[i]) > int(A[i]):
				B += 1
			else:
				continue
		if R > B:
			print('RED')
		elif B > R:
			print('BLUE')
		else:
			print('EQUAL')


t = int(input())
for _ in range(t):
	n = int(input())
	s1 = [i for i in input()]
	s2 = [i for i in input()]
	a1 = 0
	a2 = 0
	for i in range(n):
		if s1[i] > s2[i]:
			a1 += 1
		elif s1[i] < s2[i]:
			a2 += 1
	if a1 > a2:
		print('RED')
	elif a2 > a1:
		print('BLUE')
	else:
		print('EQUAL')


def redblueShuffle(arr1, arr2, n):
	score = 0
	for i in range(n):
		if arr1[i] > arr2[i]:
			score += 1
		elif arr1[i] < arr2[i]:
			score -= 1
		else:
			score += 0
	return score

def main():
	for _ in range(int(input())):
		n = int(input())
		arrNum1 = input()
		arrNum2 = input()
		result = redblueShuffle(arrNum1, arrNum2, n)
		if result > 0:
			print('RED')
		elif result < 0:
			print('BLUE')
		else:
			print('EQUAL')
main()


t = int(input())
for i in range(t):
	n = int(input())
	r = input()
	b = input()
	s = sum(list(map(lambda x, y: 1 if x > y else -1 if x < y else 0, r, b)))
	print('RED' if s > 0 else 'EQUAL' if s == 0 else 'BLUE')


t = int(input())
for ts in range(t):
	n = int(input())
	s1 = input()
	s2 = input()
	(r, b) = (0, 0)
	for i in range(n):
		if s1[i] > s2[i]:
			r = r + 1
		elif s1[i] < s2[i]:
			b = b + 1
	if r > b:
		print('RED')
	elif r < b:
		print('BLUE')
	else:
		print('EQUAL')


def solve():
	N = int(input())
	R = list(map(int, list(input())))
	B = list(map(int, list(input())))
	cmp = 0
	for i in range(N):
		if R[i] > B[i]:
			cmp += 1
		elif R[i] < B[i]:
			cmp -= 1
	if cmp == 0:
		print('EQUAL')
	elif cmp > 0:
		print('RED')
	else:
		print('BLUE')
T = int(input())
for _ in range(T):
	solve()


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
from decimal import *
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		r = str(input())
		b = str(input())
		cnt = 0
		for j in range(n):
			if int(r[j]) > int(b[j]):
				cnt += 1
			if int(r[j]) < int(b[j]):
				cnt -= 1
		if cnt > 0:
			print('RED')
		elif cnt == 0:
			print('EQUAL')
		else:
			print('BLUE')
main()


for _ in range(int(input())):
	n = int(input())
	t1 = list(input())
	t2 = list(input())
	(r, b) = (0, 0)
	for i in range(n):
		if t1[i] > t2[i]:
			r += 1
		elif t2[i] > t1[i]:
			b += 1
	if r == b:
		print('EQUAL')
	elif r > b:
		print('RED')
	else:
		print('BLUE')


for w in range(int(input())):
	n = int(input())
	r = str(input())
	b = str(input())
	x = 0
	y = 0
	z = 0
	for i in range(n):
		if r[i] == b[i]:
			z += 1
		elif r[i] > b[i]:
			x += 1
		else:
			y += 1
	if x > y:
		print('RED')
	elif y > x:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	cnt_a = 0
	cnt_b = 0
	for i in range(n):
		if int(a[i]) > int(b[i]):
			cnt_a += 1
		elif int(a[i]) < int(b[i]):
			cnt_b += 1
		else:
			continue
	if cnt_a > cnt_b:
		print('RED')
	elif cnt_a < cnt_b:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	s1 = input()
	s2 = input()
	L1 = []
	L2 = []
	for i in s1:
		L1.append(int(i))
	for i in s2:
		L2.append(int(i))
	c1 = 0
	c2 = 0
	for i in range(len(L1)):
		if L1[i] > L2[i]:
			c1 = c1 + 1
		elif L2[i] > L1[i]:
			c2 = c2 + 1
	if c1 > c2:
		print('RED')
	elif c2 > c1:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for _ in range(t):
	n = int(input())
	r = list(input())
	b = list(input())
	rw = bw = 0
	for i in range(n):
		if r[i] > b[i]:
			rw += 1
		elif r[i] < b[i]:
			bw += 1
	if rw == bw:
		print('EQUAL')
	else:
		print('RED' if rw > bw else 'BLUE')


from sys import stdin
input = stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	r = list(input())
	b = list(input())
	rr = 0
	bb = 0
	for i in range(n):
		if int(r[i]) > int(b[i]):
			rr = rr + 1
		elif int(b[i]) > int(r[i]):
			bb = bb + 1
	if rr > bb:
		print('RED')
	elif bb > rr:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	(res1, res2) = (0, 0)
	s = input()
	s1 = input()
	for _ in range(n):
		if int(s[_]) > int(s1[_]):
			res1 += 1
		if int(s[_]) < int(s1[_]):
			res2 += 1
	if res1 > res2:
		print('RED')
	elif res2 > res1:
		print('BLUE')
	else:
		print('EQUAL')


import sys
pin = sys.stdin.readline
for T in range(int(pin())):
	N = int(pin())
	Rs = [*map(int, list(pin().strip()))]
	Bs = [*map(int, list(pin().strip()))]
	Ds = [r - b for (r, b) in zip(Rs, Bs)]
	Ds.sort(key=lambda x: -abs(x))
	R = B = 0
	for d in Ds:
		if d > 0:
			R += 1
		elif d < 0:
			B += 1
		elif R > B:
			R += 1
		elif R < B:
			B += 1
	print('EQUAL' if R == B else ['RED', 'BLUE'][R < B])


t = int(input())
for _ in range(t):
	n = int(input())
	r = input()
	b = input()
	cnt = 0
	cnt2 = 0
	for i in range(n):
		if r[i] == b[i]:
			continue
		elif r[i] > b[i]:
			cnt += 1
		else:
			cnt2 += 1
	if cnt == cnt2:
		print('EQUAL')
	elif cnt > cnt2:
		print('RED')
	else:
		print('BLUE')


for _ in range(0, int(input())):
	input()
	x = list(map(int, input()))
	y = list(map(int, input()))
	sr = 0
	sb = 0
	for (r, b) in zip(x, y):
		sr += r > b
		sb += b > r
	print([['RED', 'EQUAL'][sr == sb], 'BLUE'][sb > sr])


t = int(input(''))
for i in range(0, t):
	n = int(input(''))
	p = list(input(''))
	q = list(input(''))
	r = 0
	b = 0
	for j in range(0, n):
		if p[j] > q[j]:
			r = r + 1
		elif q[j] > p[j]:
			b = b + 1
	if r == b:
		print('EQUAL')
	elif r < b:
		print('BLUE')
	elif r > b:
		print('RED')


zz = int(input())
for xx in range(0, zz):
	n = int(input())
	red = input()
	blue = input()
	red_count = 0
	blue_count = 0
	for i in range(0, n):
		if red[i] > blue[i]:
			red_count = red_count + 1
		elif red[i] < blue[i]:
			blue_count = blue_count + 1
	if red_count > blue_count:
		print('RED')
	elif red_count < blue_count:
		print('BLUE')
	else:
		print('EQUAL')


import sys
input = sys.stdin.readline
T = int(input())
for t in range(T):
	n = int(input())
	reds = input().split()[0]
	blues = input().split()[0]
	red_advs = 0
	for i in range(n):
		if reds[i] > blues[i]:
			red_advs += 1
		elif reds[i] < blues[i]:
			red_advs -= 1
	if red_advs > 0:
		print('RED')
	elif red_advs < 0:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	k = input()
	m = input()
	a = 0
	b = 0
	for i in range(n):
		if k[i] > m[i]:
			a += 1
		elif k[i] < m[i]:
			b += 1
	if a < b:
		print('BLUE')
	elif b < a:
		print('RED')
	else:
		print('EQUAL')


t = int(input())
while t > 0:
	n = int(input())
	r = input()
	b = input()
	i = 0
	rcount = 0
	bcount = 0
	while i < n:
		if r[i] > b[i]:
			rcount += 1
		elif r[i] < b[i]:
			bcount += 1
		i += 1
	if rcount > bcount:
		print('RED')
	elif bcount > rcount:
		print('BLUE')
	else:
		print('EQUAL')
	t -= 1


for e in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	s = 0
	bs = 0
	for i in range(len(a)):
		if a[i] > b[i]:
			s += 1
		elif a[i] < b[i]:
			bs += 1
	if s < bs:
		print('BLUE')
	elif s > bs:
		print('RED')
	else:
		print('EQUAL')


import sys
input = sys.stdin.readline
T = int(input())
for i in range(T):
	n = int(input())
	a = input().strip()
	b = input().strip()
	count = 0
	for j in range(len(a)):
		if a[j] > b[j]:
			count += 1
		elif a[j] < b[j]:
			count -= 1
	if count > 0:
		print('RED')
	elif count < 0:
		print('BLUE')
	else:
		print('EQUAL')


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
b = []
for _ in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	if a == b:
		print('EQUAL')
	else:
		cnt1 = cnt2 = 0
		for x in range(n):
			cnt1 += int(ord(a[x]) > ord(b[x]))
			cnt2 += int(ord(b[x]) > ord(a[x]))
		if cnt1 == cnt2:
			print('EQUAL')
		else:
			print(['BLUE', 'RED'][cnt1 > cnt2])


for _ in range(int(input())):
	n = int(input())
	r = 0
	b = 0
	for (ri, bi) in zip(input(), input()):
		if ri > bi:
			r += 1
		elif ri < bi:
			b += 1
	if r > b:
		print('RED')
	elif r < b:
		print('BLUE')
	else:
		print('EQUAL')


innum = lambda : int(input())
inmul = lambda : map(int, input().split())
instr = lambda : str(input())
inarr = lambda : list(map(int, input().split()))

def solve():
	n = innum()
	r = instr()
	b = instr()
	rg = 0
	bg = 0
	for (i, v) in enumerate(r):
		if v > b[i]:
			rg += 1
		elif v < b[i]:
			bg += 1
	if rg > bg:
		print('RED')
	elif rg < bg:
		print('BLUE')
	else:
		print('EQUAL')

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()
main()


import sys
input = sys.stdin.readline
import math
import copy
import collections
from collections import deque
for _ in range(int(input())):
	n = int(input())
	r = input().rstrip()
	b = input().rstrip()
	countr = 0
	countb = 0
	for i in range(n):
		ri = int(r[i])
		bi = int(b[i])
		if bi > ri:
			countb += 1
		elif ri > bi:
			countr += 1
	if countb > countr:
		print('BLUE')
	elif countr > countb:
		print('RED')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	a = list((int(x) for x in input()))
	b = list((int(x) for x in input()))
	r = 0
	s = 0
	if a == b:
		print('EQUAL')
	else:
		for i in range(n):
			if a[i] > b[i]:
				r = r + 1
			elif a[i] < b[i]:
				s = s + 1
		if r > s:
			print('RED')
		elif s > r:
			print('BLUE')
		else:
			print('EQUAL')


import sys, math, itertools, random, bisect
from collections import defaultdict
INF = 10 ** 18

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def input():
	return sys.stdin.readline().strip()
mod = 10 ** 9 + 7
for _ in range(int(input())):
	n = int(input())
	a = input()
	b = input()
	a_ = 0
	for i in range(n):
		if int(a[i]) > int(b[i]):
			a_ += 1
		elif int(a[i]) < int(b[i]):
			a_ -= 1
	if a_ > 0:
		print('RED')
	elif a_ == 0:
		print('EQUAL')
	else:
		print('BLUE')


for _ in range(int(input())):
	n = int(input())
	r = [int(x) for x in input()]
	b = [int(x) for x in input()]
	count = sum(((red > blue) - (blue > red) for (red, blue) in zip(r, b)))
	print(['EQUAL', 'RED', 'BLUE'][(count < 0) + (count != 0)])


for _ in range(int(input())):
	n = int(input())
	red = input()
	blue = input()
	ans = 0
	for i in range(n):
		if int(red[i]) > int(blue[i]):
			ans += 1
		elif int(red[i]) < int(blue[i]):
			ans -= 1
	if ans == 0:
		print('EQUAL')
	elif ans > 0:
		print('RED')
	else:
		print('BLUE')


for _ in range(int(input())):
	x = int(input())
	r = list(map(int, input().strip()))
	b = list(map(int, input().strip()))
	red = 0
	blue = 0
	for i in range(x):
		if r[i] > b[i]:
			red += 1
		elif b[i] > r[i]:
			blue += 1
	if red > blue:
		print('RED')
	elif blue > red:
		print('BLUE')
	else:
		print('EQUAL')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [0, 0, 0]
	s1 = input()
	s2 = input()
	for i in range(n):
		if s1[i] > s2[i]:
			a[0] += 1
		elif s1[i] < s2[i]:
			a[1] += 1
		else:
			a[2] += 1
	if a[0] > a[1]:
		print('RED')
	elif a[0] < a[1]:
		print('BLUE')
	else:
		print('EQUAL')


def sign(a):
	if a > 0:
		return 1
	elif a == 0:
		return 0
	else:
		return -1

def f(a, b):
	t = 0
	for i in range(len(a)):
		t += sign(int(a[i]) - int(b[i]))
	if t > 0:
		return 'RED'
	elif t == 0:
		return 'EQUAL'
	else:
		return 'BLUE'
t = int(input())
for _ in range(t):
	n = int(input())
	r = input()
	b = input()
	print(f(r, b))


t = int(input())
for tt in range(t):
	n = int(input())
	r = list(input())
	b = list(input())
	cr = 0
	cb = 0
	for (i, j) in zip(r, b):
		if i > j:
			cr += 1
		elif i < j:
			cb += 1
	if cr == cb:
		print('EQUAL')
	elif cr > cb:
		print('RED')
	else:
		print('BLUE')


test_case = int(input())
for tc in range(test_case):
	n = int(input())
	redNums = list(input())
	blueNums = list(input())
	(red, blue) = (0, 0)
	for i in range(n):
		blueNums[i] = int(blueNums[i])
		redNums[i] = int(redNums[i])
	for i in range(0, n):
		if redNums[i] > blueNums[i]:
			red += 1
		if redNums[i] < blueNums[i]:
			blue += 1
	if red > blue:
		print('RED')
	elif blue > red:
		print('BLUE')
	else:
		print('EQUAL')


buffer = ''

def test_case():
	N: int = int(input())
	A = [int(x) for x in input()]
	B = [int(x) for x in input()]
	Ares = 0
	Bres = 0
	for i in range(N):
		if A[i] > B[i]:
			Ares += 1
		elif B[i] > A[i]:
			Bres += 1
	global buffer
	if Ares > Bres:
		buffer += 'RED\n'
	elif Bres > Ares:
		buffer += 'BLUE\n'
	else:
		buffer += 'EQUAL\n'

def main():
	T: int = int(input())
	for i in range(T):
		test_case()
	print(buffer)
main()


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(int(input())):
	n = int(input())
	r = [int(i) for i in input()]
	b = [int(i) for i in input()]
	red = 0
	blue = 0
	for i in range(n):
		if r[i] == b[i]:
			continue
		elif r[i] > b[i]:
			red += 1
		else:
			blue += 1
	if red == blue:
		print('EQUAL')
	elif red > blue:
		print('RED')
	else:
		print('BLUE')


for t in range(0, int(input())):
	n = int(input())
	r = list(input())
	b = list(input())
	rscore = 0
	bscore = 0
	for (i, j) in zip(r, b):
		if i > j:
			rscore += 1
		elif i < j:
			bscore += 1
	if rscore > bscore:
		print('RED')
	elif bscore > rscore:
		print('BLUE')
	else:
		print('EQUAL')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	r = list(input().strip())
	b = list(input().strip())
	(x, y) = (0, 0)
	for i in range(len(r)):
		if int(r[i]) > int(b[i]):
			x += 1
		elif int(r[i]) < int(b[i]):
			y += 1
	if x > y:
		print('RED')
	elif y > x:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	w = list(map(int, list(input())))
	s = list(map(int, list(input())))
	(r, b) = (0, 0)
	for i in range(n):
		if w[i] > s[i]:
			r += 1
		elif s[i] > w[i]:
			b += 1
	if r > b:
		print('RED')
	elif r < b:
		print('BLUE')
	else:
		print('EQUAL')


for _ in range(int(input())):
	n = int(input())
	x = list(map(int, input()))
	y = list(map(int, input()))
	(r, b) = (0, 0)
	for i in range(n):
		if x[i] > y[i]:
			r += 1
		elif x[i] < y[i]:
			b += 1
	if r == b:
		print('EQUAL')
	elif r > b:
		print('RED')
	else:
		print('BLUE')


t = int(input())
while t:
	n = int(input())
	r = input()
	b = input()
	count_r = count_b = 0
	for i in range(len(r)):
		if r[i] > b[i]:
			count_r += 1
		elif r[i] < b[i]:
			count_b += 1
		else:
			count_r += 1
			count_b += 1
	if count_r > count_b:
		print('RED')
	elif count_b > count_r:
		print('BLUE')
	else:
		print('EQUAL')
	t -= 1


T = int(input())
for t in range(T):
	n = int(input())
	a = list(input())
	b = list(input())
	d = False
	if a == b:
		print('EQUAL')
		continue
	r = 0
	for i in range(n):
		if a[i] > b[i]:
			r += 1
		if a[i] < b[i]:
			r -= 1
	if r == 0:
		print('EQUAL')
	elif r < 0:
		print('BLUE')
	else:
		print('RED')


T = int(input())
for _ in range(T):
	n = int(input())
	r = [int(c) for c in input()]
	b = [int(c) for c in input()]
	A = sum([r[i] > b[i] for i in range(n)])
	B = sum([b[i] > r[i] for i in range(n)])
	C = n - A - B
	if A > B:
		print('RED')
	elif B > A:
		print('BLUE')
	else:
		print('EQUAL')


size = int(input())
red = [0] * size
blue = [0] * size
for i in range(size):
	h = input()
	red[i] = list(map(int, input()))
	blue[i] = list(map(int, input()))
for i in range(size):
	Red = red[i]
	Blue = blue[i]
	rN = 0
	bN = 0
	for (j, e1) in enumerate(Red):
		e2 = Blue[j]
		if e1 < e2:
			bN += 1
		elif e1 > e2:
			rN += 1
	if rN < bN:
		print('BLUE')
	elif rN > bN:
		print('RED')
	else:
		print('EQUAL')