There is a robot in a warehouse and $n$ packages he wants to collect. The warehouse can be represented as a coordinate grid. Initially, the robot stays at the point $(0, 0)$. The $i$-th package is at the point $(x_i, y_i)$. It is guaranteed that there are no two packages at the same point. It is also guaranteed that the point $(0, 0)$ doesn't contain a package.

The robot is semi-broken and only can move up ('U') and right ('R'). In other words, in one move the robot can go from the point $(x, y)$ to the point ($x + 1, y$) or to the point $(x, y + 1)$.

As we say above, the robot wants to collect all $n$ packages (in arbitrary order). He wants to do it with the minimum possible number of moves. If there are several possible traversals, the robot wants to choose the lexicographically smallest path.

The string $s$ of length $n$ is lexicographically less than the string $t$ of length $n$ if there is some index $1 \le j \le n$ that for all $i$ from $1$ to $j-1$ $s_i = t_i$ and $s_j < t_j$. It is the standard comparison of string, like in a dictionary. Most programming languages compare strings in this way.


-----Input-----

The first line of the input contains an integer $t$ ($1 \le t \le 100$) — the number of test cases. Then test cases follow.

The first line of a test case contains one integer $n$ ($1 \le n \le 1000$) — the number of packages.

The next $n$ lines contain descriptions of packages. The $i$-th package is given as two integers $x_i$ and $y_i$ ($0 \le x_i, y_i \le 1000$) — the $x$-coordinate of the package and the $y$-coordinate of the package.

It is guaranteed that there are no two packages at the same point. It is also guaranteed that the point $(0, 0)$ doesn't contain a package.

The sum of all values $n$ over test cases in the test doesn't exceed $1000$.


-----Output-----

Print the answer for each test case.

If it is impossible to collect all $n$ packages in some order starting from ($0,0$), print "NO" on the first line.

Otherwise, print "YES" in the first line. Then print the shortest path — a string consisting of characters 'R' and 'U'. Among all such paths choose the lexicographically smallest path.

Note that in this problem "YES" and "NO" can be only uppercase words, i.e. "Yes", "no" and "YeS" are not acceptable.


-----Example-----
Input
3
5
1 3
1 2
3 3
5 5
4 3
2
1 0
0 1
1
4 3

Output
YES
RUUURRRRUU
NO
YES
RRRRUUU



-----Note-----

For the first test case in the example the optimal path RUUURRRRUU is shown below:  [Image]

Difficulty: EASY

Solutions:
t = int(input())
while t > 0:
	s = ''
	main = []
	pair = []
	track = [0, 0]
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		pair.append(a)
		pair.append(b)
		main.append(pair)
		pair = []
	main.sort()
	flag = 0
	for i in range(n):
		val1 = main[i][0] - track[0]
		val2 = main[i][1] - track[1]
		if val1 < 0 or val2 < 0:
			flag = 1
			print('NO')
			break
		else:
			for j in range(val1):
				s += 'R'
			for k in range(val2):
				s += 'U'
		track[0] = main[i][0]
		track[1] = main[i][1]
	if flag == 0:
		print('YES')
		print(s)
	t -= 1


t = int(input())
for _ in range(t):
	l = [[] for _ in range(1010)]
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().split())
		l[x].append(y)
	for i in range(1001):
		l[i].sort()
	nowx = 0
	nowy = 0
	ans = True
	s = ''
	for x in range(1001):
		for y in l[x]:
			if y < nowy:
				ans = False
			s += 'R' * (x - nowx)
			nowx = x
			s += 'U' * (y - nowy)
			nowy = y
	if ans:
		print('YES')
		print(s)
	else:
		print('NO')


import sys
input = lambda : sys.stdin.readline()
int_arr = lambda : list(map(int, input().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().split())
get_int = lambda : map(int, input().split())
get_flo = lambda : map(float, input().split())
mod = 1000000007

def solve(ans):
	s = ''
	(x, y) = (0, 0)
	for i in range(len(ans)):
		(px, py) = ans[i]
		if py < y:
			print('NO')
			return
		else:
			while px != x:
				x += 1
				s += 'R'
			while py != y:
				y += 1
				s += 'U'
	print('YES')
	print(s)
for _ in range(int(input())):
	n = int(input())
	ans = []
	for i in range(n):
		ans.append(int_arr())
	ans.sort(key=lambda x: x[1])
	ans.sort(key=lambda x: x[0])
	solve(ans)


for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		(a, b) = list(map(int, input().split()))
		arr.append([a, b])
	arr.sort()
	f = 0
	for i in range(1, n):
		if arr[i][0] < arr[i - 1][0]:
			f = 1
			break
		if arr[i][1] < arr[i - 1][1]:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		print('YES')
		ans = ''
		(cx, cy) = (0, 0)
		for i in arr:
			(x, y) = (i[0], i[1])
			ans += 'R' * abs(x - cx)
			ans += 'U' * abs(y - cy)
			(cx, cy) = (x, y)
		print(ans)


for t in range(int(input())):
	a = []
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append([x, y])
	w = ''
	x = 0
	y = 0
	a.sort()
	i = 0
	while i < n:
		if x < a[i][0]:
			w = w + 'R'
			x += 1
		elif y < a[i][1]:
			w = w + 'U'
			y += 1
		elif x == a[i][0] and y == a[i][1]:
			i += 1
		else:
			break
	if i == n:
		print('YES')
		print(w)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	grid = [list(map(int, input().split())) for _ in range(n)]
	grid = sorted(grid)
	res = True
	ress = grid[0][0] * 'R'
	ress = ress + grid[0][1] * 'U'
	for i in range(len(grid) - 1):
		ress = ress + (grid[i + 1][0] - grid[i][0]) * 'R'
		ress = ress + (grid[i + 1][1] - grid[i][1]) * 'U'
		if grid[i][1] > grid[i + 1][1]:
			res = False
			break
	if res:
		print('YES')
		print(ress)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	ans = ''
	for j in range(n):
		a = list(map(int, input().split()))
		l.append(a)
	cre = []
	l = sorted(l, key=lambda x: x[0])
	temp = []
	temp.append(l[0])
	for k in range(1, len(l)):
		if l[k][0] == l[k - 1][0]:
			temp.append(l[k])
		else:
			temp = sorted(temp, key=lambda y: y[1])
			cre.extend(temp)
			temp = []
			temp.append(l[k])
	temp = sorted(temp, key=lambda z: z[1])
	cre.extend(temp)
	l = cre
	ans = ans + l[0][0] * 'R'
	ans = ans + l[0][1] * 'U'
	flag = True
	for j in range(1, len(l)):
		if l[j][1] < l[j - 1][1]:
			flag = False
			break
		else:
			ans = ans + (l[j][0] - l[j - 1][0]) * 'R'
			ans = ans + (l[j][1] - l[j - 1][1]) * 'U'
	if flag == False:
		print('NO')
	else:
		print('YES')
		print(ans)


numTestcases = int(input())
ans = []
packages = []
for i in range(numTestcases):
	del packages[:]
	cAns = []
	works = 'YES'
	numPackages = int(input())
	for c in range(numPackages):
		packages.append(list(map(int, input().split(' '))))
	packages.sort()
	cX = 0
	cY = 0
	for c in range(numPackages):
		pX = cX
		pY = cY
		cX = packages[c][0]
		cY = packages[c][1]
		if pY > cY or pX > cX:
			works = 'NO'
			break
		for x in range(cX - pX):
			cAns.append('R')
		for x in range(cY - pY):
			cAns.append('U')
	ans.append(works)
	if works == 'YES':
		ans.append(''.join(cAns))
print('\n'.join(ans))


for _ in range(int(input())):
	n = int(input())
	moves = []
	packages = []
	while n:
		packages.append(list(map(int, input().split())))
		n -= 1
	packages.sort()
	prev_x = 0
	prev_y = 0
	for (x, y) in packages:
		if y < prev_y:
			moves = 'NO'
			break
		right_till = abs(x - prev_x)
		up_till = abs(y - prev_y)
		while right_till:
			moves.append('R')
			right_till -= 1
		while up_till:
			moves.append('U')
			up_till -= 1
		prev_x = x
		prev_y = y
	if moves == 'NO':
		print(moves)
	else:
		print('YES')
		print(''.join(moves))


t = int(input())
for i in range(t):
	x = int(input())
	l1 = []
	for j in range(x):
		(a, b) = map(int, input().split())
		l2 = []
		l2.append(a)
		l2.append(b)
		l1.append(l2)
	l1 = sorted(l1, key=lambda k: [k[0], k[1]])
	b = []
	pe = 0
	b.append('R' * l1[0][0])
	b.append('U' * l1[0][1])
	for m in range(1, len(l1)):
		if l1[m][0] < l1[m - 1][0] or l1[m][1] < l1[m - 1][1]:
			pe = 1
			break
		f1 = l1[m][0] - l1[m - 1][0]
		b.append('R' * f1)
		f2 = l1[m][1] - l1[m - 1][1]
		b.append('U' * f2)
	if pe == 1:
		print('NO')
	else:
		print('YES')
		print(''.join(b))


def solve(A, n):
	s = ''
	for i in range(A[0][0]):
		s += 'R'
	for i in range(A[0][1]):
		s += 'U'
	for i in range(1, n):
		for j in range(A[i][0] - A[i - 1][0]):
			s += 'R'
		if A[i][1] < A[i - 1][1]:
			print('NO')
			return
		for j in range(A[i][1] - A[i - 1][1]):
			s += 'U'
	print('YES')
	print(s)
t = int(input())
for _ in range(t):
	n = int(input())
	A = []
	for i in range(n):
		A.append(list(map(int, input().split())))
	A = sorted(A)
	solve(A, n)


el = int(input())
for x in range(el):
	num = int(input())
	ar = []
	for i in range(num):
		row = []
		for j in input().split(' '):
			row.append(int(j))
		ar.append(row)
	ar = sorted(ar, key=lambda k: (k[0], k[1]))
	res = [item[0] for item in ar]
	if sorted(res) != res:
		print('NO')
	else:
		res = [item[1] for item in ar]
		if sorted(res) != res:
			print('NO')
		else:
			res = []
			currX = 0
			currY = 0
			for point in ar:
				if point[0] > currX:
					while currX != point[0]:
						res.append('R')
						currX = currX + 1
				if point[1] > currY:
					while currY != point[1]:
						res.append('U')
						currY = currY + 1
			print('YES')
			print(''.join(res))


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	grid = [[0, 0]]
	for i in range(n):
		grid.append([int(i) for i in input().split()])
	grid.sort()
	output = []
	ok = True
	for i in range(1, len(grid)):
		if grid[i][0] - grid[i - 1][0] >= 0:
			output.append('R' * (grid[i][0] - grid[i - 1][0]))
		else:
			ok = False
			print('NO')
			break
		if grid[i][1] - grid[i - 1][1] >= 0:
			output.append('U' * (grid[i][1] - grid[i - 1][1]))
		else:
			ok = False
			print('NO')
			break
	if ok == True:
		print('YES')
		print(''.join(output))


t = int(input())
for h in range(0, t):
	n = int(input())
	ans = ''
	li = [[] for i in range(1001)]
	for j in range(0, n):
		(a, b) = [int(x) for x in input().split()]
		li[a].append(b)
	inix = 0
	iniy = 0
	flg = 0
	mx = 0
	for i in range(0, 1001):
		if len(li[i]) != 0:
			li[i].sort()
			xdir = i - inix
			ydir = li[i][0] - iniy
			for pq in range(0, xdir):
				ans += 'R'
			for pq in range(0, ydir):
				ans += 'U'
			if li[i][0] < mx:
				flg = 1
				break
			lenli = len(li[i])
			for p in range(0, len(li[i]) - 1):
				countup = li[i][p + 1] - li[i][p]
				for jj in range(0, countup):
					ans += 'U'
			mx = li[i][lenli - 1]
			inix = i
			iniy = mx
	if flg == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for ii in range(t):
	n = int(input())
	a = []
	b = []
	for i in range(n):
		(p, q) = [int(x) for x in input().split()]
		a.append((p, q))
		b.append((q, p))
	a = sorted(a)
	b = sorted(b)
	c = []
	for i in b:
		c.append((i[1], i[0]))
	if a != c:
		print('NO')
	else:
		s = ''
		a = [(0, 0)] + a
		for i in range(1, len(a)):
			s = s + (a[i][0] - a[i - 1][0]) * 'R'
			s = s + (a[i][1] - a[i - 1][1]) * 'U'
		print('YES')
		print(s)


from collections import *
from sys import *
inp = stdin.readline
out = print
t = int(inp())
while t > 0:
	n = int(inp())
	l = []
	flag = 0
	while n > 0:
		(a, b) = map(int, inp().split())
		l.append([a, b])
		n -= 1
	l.sort()
	ans = ''
	r = 0
	u = 0
	for i in l:
		if i[0] < r or i[1] < u:
			flag = 1
			out('NO')
			break
		ans += (i[0] - r) * 'R' + (i[1] - u) * 'U'
		r = i[0]
		u = i[1]
	if flag == 0:
		out('YES')
		out(ans)
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	max_y = [-1] * 1001
	min_y = [-1] * 1001
	max_x = 0
	for j in range(n):
		(x, y) = map(int, input().split())
		max_x = max(max_x, x)
		if max_y[x] == -1:
			max_y[x] = y
			min_y[x] = y
		else:
			max_y[x] = max(max_y[x], y)
			min_y[x] = min(min_y[x], y)
	ans = ''
	cur_y = 0
	f = 0
	for x in range(max_x + 1):
		if min_y[x] == -1:
			ans += 'R'
		else:
			if cur_y > min_y[x]:
				print('NO')
				f = 1
				break
			ans += 'U' * (max_y[x] - cur_y)
			ans += 'R'
			cur_y = max_y[x]
	if f == 0:
		print('YES')
		print(ans[:-1])


for _ in range(int(input())):
	n = int(input())
	all = []
	(X, Y) = ([], [])
	for i in range(n):
		(x, y) = map(int, input().split())
		all.append([x, y])
		all.sort()
	for j in range(n):
		X.append(all[j][0])
		Y.append(all[j][1])
	Z = Y[0]
	Z1 = sorted(Y)
	if Z1 == Y and Y[0] == Z1[0]:
		a = X[0] * 'R' + Y[0] * 'U'
		for j in range(n - 1):
			a = a + (all[j + 1][0] - all[j][0]) * 'R'
			a = a + (all[j + 1][1] - all[j][1]) * 'U'
		print('YES')
		print(a)
	else:
		print('NO')


r = int(input())
for i in range(r):
	f = int(input())
	t = []
	u = 0
	for i in range(f):
		r = [0] * 2
		(x, y) = map(int, input().split())
		r[0] = x
		r[1] = y
		t.append(r)
	t.sort()
	ans = 'R' * t[0][0] + 'U' * t[0][1]
	for i in range(2, f + 1):
		if t[i - 1][0] - t[i - 2][0] >= 0 and t[i - 1][1] - t[i - 2][1] >= 0:
			ans += 'R' * (t[i - 1][0] - t[i - 2][0])
			ans += 'U' * (t[i - 1][1] - t[i - 2][1])
		else:
			u = 1
			print('NO')
			break
	if u == 0:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	point = []
	for _ in range(n):
		l = list(map(int, input().split()))
		point.append(l)
	point.sort()
	(x, y) = (0, 0)
	ans = ''
	flag = True
	for l in point:
		if l[0] >= x:
			ans = ans + (l[0] - x) * 'R'
		elif l[0] < x:
			flag = False
			break
		if l[1] > y:
			ans = ans + (l[1] - y) * 'U'
		elif l[1] < y:
			flag = False
			break
		(x, y) = (l[0], l[1])
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(x, y) = map(int, input().split())
		arr += [[x, y]]
	arr.sort()
	x = 0
	y = 0
	flag = 0
	ans = ''
	for i in range(0, len(arr)):
		if arr[i][0] < x or arr[i][1] < y:
			flag = 1
			break
		else:
			ans += 'R' * (arr[i][0] - x)
			ans += 'U' * (arr[i][1] - y)
		x = arr[i][0]
		y = arr[i][1]
	if flag == 0:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	test = False
	n = int(input())
	l = [[0, 0]]
	for j in range(n):
		xy = list(map(int, input().split()))
		l.append(xy)
	l.sort()
	for k in range(n):
		if l[k][1] > l[k + 1][1]:
			test = True
	if test:
		print('NO')
	else:
		print('YES')
		s = ''
		for h in range(n):
			s += 'R' * (l[h + 1][0] - l[h][0]) + 'U' * (l[h + 1][1] - l[h][1])
		print(s)


t = int(input())
while t:
	n = int(input())
	l = [[] for _ in range(1001)]
	for i in range(n):
		(a, b) = input().split()
		a = int(a)
		b = int(b)
		l[a].append(b)
	cur_pos = 0
	ans = ''
	check = True
	cnt = 0
	for i in range(1001):
		mx = max(l[i] or [-1])
		mi = min(l[i] or [101001])
		if mx >= mi:
			if mi >= cur_pos:
				ans += 'U' * (mx - cur_pos)
				cur_pos = mx
				cnt += len(l[i])
			else:
				check = False
				break
		if cnt == n:
			break
		ans += 'R'
	if check:
		print('YES')
		print(ans)
	else:
		print('NO')
	t -= 1


a = []
for i in range(int(input())):
	for j in range(int(input())):
		(m, n) = map(int, input().split())
		a.append((m, n))
	flag = 0
	x = 0
	y = 0
	s = ''
	for (k, l) in sorted(a):
		p = k - x
		q = l - y
		if p >= 0 and q >= 0:
			s = s + 'R' * p + 'U' * q
			x = k
			y = l
		else:
			print('NO')
			flag = 1
			break
	x = 0
	y = 0
	a.clear()
	if flag != 1:
		print('YES')
		print(s)


t = int(input())
rep = 0
while rep < t:
	n = int(input())
	packages = []
	k = 0
	while k < n:
		a = input().split(' ')
		a[0] = int(a[0])
		a[1] = int(a[1])
		i = 0
		var = True
		while var:
			if i == len(packages):
				packages.append(a)
				var = False
			elif packages[i][1] < a[1]:
				i += 1
			elif packages[i][0] < a[0]:
				i += 1
			else:
				packages.insert(i, a)
				var = False
		k += 1
	var = 'YES'
	answer = ''
	k = 0
	packages.insert(0, [0, 0])
	while k < n and var == 'YES':
		b = [0, 0]
		b[0] = packages[k + 1][0] - packages[k][0]
		b[1] = packages[k + 1][1] - packages[k][1]
		if b[0] < 0 or b[1] < 0:
			var = 'NO'
		else:
			p = 0
			while p < b[0]:
				answer += 'R'
				p += 1
			p = 0
			while p < b[1]:
				answer += 'U'
				p += 1
		k += 1
	print(var)
	if var == 'YES':
		print(answer)
	rep += 1


t = int(input())
for _ in range(t):
	n = int(input())
	p = []
	for i in range(n):
		p.append(tuple(map(int, input().split())))
	p.sort(key=lambda x: x[0])
	p.sort(key=lambda x: x[1])
	ok = True
	for i in range(1, n):
		if p[i - 1][0] > p[i][0] or p[i - 1][1] > p[i][1]:
			ok = False
			break
	if ok:
		s = 'R' * p[0][0] + 'U' * p[0][1]
		for i in range(1, n):
			s += 'R' * (p[i][0] - p[i - 1][0]) + 'U' * (p[i][1] - p[i - 1][1])
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	l = [[0, 0] for _ in range(n)]
	for j in range(n):
		(l[j][0], l[j][1]) = map(int, input().split())
	l.sort(key=lambda x: (x[0], x[1]))
	l.sort()
	ans = ''
	temp = [0, 0]
	for k in range(n):
		if l[k][1] < temp[1]:
			print('NO')
			break
		else:
			ans += 'R' * (l[k][0] - temp[0]) + 'U' * (l[k][1] - temp[1])
			temp = [l[k][0], l[k][1]]
	else:
		print('YES')
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = [[0, 0]]
	for j in range(n):
		a.append(list(map(int, input().strip().split())))
	a.sort()
	c = 0
	for j in range(n):
		if a[j][0] <= a[j + 1][0] and a[j][1] <= a[j + 1][1]:
			c = c + 1
	if c != n:
		print('NO')
	else:
		s = ''
		for j in range(n):
			c = abs(a[j][0] - a[j + 1][0])
			d = abs(a[j][1] - a[j + 1][1])
			s = s + 'R' * c + 'U' * d
		print('YES')
		print(s)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	ps = []
	for __ in range(n):
		ps.append(tuple(map(int, stdin.readline().split())))
	ps.sort()
	x = 0
	y = 0
	can = True
	path = ''
	for p in ps:
		if p[0] < x or p[1] < y:
			can = False
			break
		path += 'R' * (p[0] - x)
		path += 'U' * (p[1] - y)
		(x, y) = p
	if can:
		print('YES')
		print(path)
	else:
		print('NO')


def Answer(array):
	array.sort()
	(x, y) = (0, 0)
	found = True
	path = ''
	for ele in array:
		while 1:
			if ele[0] > x:
				path += 'R'
				x += 1
			elif ele[1] > y:
				path += 'U'
				y += 1
			elif x == ele[0] and y == ele[1]:
				break
			else:
				found = False
				break
		if not found:
			break
	if found:
		print('YES')
		print(path)
	else:
		print('NO')
queries = int(input())
for i in range(queries):
	array = []
	elements = int(input())
	for k in range(elements):
		(a, b) = map(int, input().split())
		array.append((a, b))
	Answer(array)


def find_packages(pkgs):
	(x, y) = (0, 0)
	dist = 0
	instr = ''
	for k in keys:
		column = pkgs[k]
		first = min(column)
		if first < y:
			print('NO')
			return
		dist += k - x + (first - y)
		instr += 'R' * (k - x) + 'U' * (first - y)
		(x, y) = (k, first)
		if len(pkgs[k]) > 1:
			(low, high) = (min(column), max(column))
			dist += high - low
			instr += 'U' * (high - low)
			(x, y) = (k, high)
	print('YES')
	print(instr)
t = int(input())
for i in range(t):
	pkgs = {}
	for i in range(int(input())):
		(key, val) = map(int, input().split(' '))
		if key in pkgs.keys():
			pkgs[key].append(val)
		else:
			pkgs[key] = [val]
	keys = sorted(list(pkgs.keys()))
	find_packages(pkgs)


t = int(input())
for i in range(t):
	n = int(input())
	ss = 0
	s = ''
	a = [[0, 0]]
	for j in range(n):
		b = list(map(int, input().split()))
		a.append(b)
	a.sort()
	for j in range(n):
		if a[j + 1][0] - a[j][0] < 0 or a[j + 1][1] - a[j][1] < 0:
			print('NO')
			s = [-5]
			break
		else:
			for k in range(a[j + 1][0] - a[j][0]):
				s = s + 'R'
			for k in range(a[j + 1][1] - a[j][1]):
				s = s + 'U'
	if s == [-5]:
		continue
	else:
		print('YES')
		print(s)


q = int(input())
for _ in range(q):
	n = int(input())
	l = [[0, 0]]
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	flag = 0
	for i in range(n):
		if l[i][1] > l[i + 1][1]:
			print('NO')
			flag = -1
			break
	if flag == 0:
		ans = ''
		for i in range(1, n + 1):
			r = l[i][0] - l[i - 1][0]
			u = l[i][1] - l[i - 1][1]
			for j in range(r):
				ans += 'R'
			for j in range(u):
				ans += 'U'
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		(x, y) = [int(x) for x in input().split()]
		arr.append([x, y])
	arr = sorted(arr)
	moves = []
	(ix, iy) = (0, 0)
	ans = True
	for (x, y) in arr:
		while ix != x:
			moves.append('R')
			ix += 1
		if iy <= y:
			while iy != y:
				moves.append('U')
				iy += 1
		else:
			ans = False
			break
	if ans:
		print('YES')
		print(*moves, sep='')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	coords = []
	for j in range(n):
		(x, y) = map(int, input().split())
		coords.append((x, y))
	coords.sort()
	pos = [0, 0]
	resp = ''
	yes = True
	for c in coords:
		if c[0] - pos[0] < 0 or c[1] - pos[1] < 0:
			print('NO')
			yes = False
			break
		for j in range(c[0] - pos[0]):
			resp += 'R'
		pos[0] = c[0]
		for j in range(c[1] - pos[1]):
			resp += 'U'
		pos[1] = c[1]
	if yes:
		print('YES')
		print(resp)


q = int(input())
for j in range(q):
	n = int(input())
	x = []
	y = []
	d = []
	s = ''
	flag = 0
	for i in range(n):
		l = list(map(int, input().split(' ')))
		d.append((l[0], l[1]))
	d.sort()
	s = 'R' * d[0][0] + 'U' * d[0][1]
	for i in range(1, n):
		if d[i][0] - d[i - 1][0] < 0 or d[i][1] - d[i - 1][1] < 0:
			flag = 1
			break
		s = s + 'R' * (d[i][0] - d[i - 1][0]) + 'U' * (d[i][1] - d[i - 1][1])
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append(list([x, y]))
	l = sorted(l)
	flag = 0
	for j in range(1, n):
		if l[j][1] < l[j - 1][1]:
			print('NO')
			flag = 1
			break
	if flag == 1:
		continue
	res = ''
	X = 0
	Y = 0
	for k in range(n):
		res += 'R' * (l[k][0] - X)
		res += 'U' * (l[k][1] - Y)
		X = l[k][0]
		Y = l[k][1]
	print('YES')
	print(res)


for _ in range(int(input())):
	n = int(input())
	points = [None] * n
	for i in range(n):
		(x, y) = map(int, input().split())
		points[i] = (y, x)
	points.sort()
	cur_x = 0
	cur_y = 0
	ans = 'YES'
	way = ''
	for pp in points:
		if pp[1] < cur_x:
			ans = 'NO'
			break
		if cur_x != pp[1]:
			way += 'R' * (pp[1] - cur_x)
			cur_x = pp[1]
		if cur_y != pp[0]:
			way += 'U' * (pp[0] - cur_y)
			cur_y = pp[0]
	print(ans)
	if ans == 'YES':
		print(way)


for _ in range(int(input())):
	n = int(input())
	obj = []
	for _ in range(n):
		obj.append(tuple([int(x) for x in input().split()]))
	obj = sorted(obj)
	obj_x = []
	obj_y = []
	for (i, j) in obj:
		obj_x.append(i)
		obj_y.append(j)
	robo_x = 0
	robo_y = 0
	k = ''
	while obj_x or obj_y:
		if robo_x in obj_x and robo_y in obj_y:
			print('NO')
			break
		else:
			traverse_x = obj_x[0] - robo_x
			traverse_y = obj_y[0] - robo_y
			if traverse_x < 0 or traverse_y < 0:
				print('NO')
				break
			k += 'R' * traverse_x + 'U' * traverse_y
			robo_x = obj_x[0]
			robo_y = obj_y[0]
			obj_x.pop(0)
			obj_y.pop(0)
	if len(obj_x) == 0 and len(obj_y) == 0:
		print('YES')
		print(k)


import math
from functools import reduce
t = int(input())
for cas in range(t):
	arr = []
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		arr.append([a, b])
	arr.sort()
	cnt = 0
	lst = [0, 0]
	ans = ''
	flag = 0
	for x in arr:
		if x[0] >= lst[0] and x[1] >= lst[1]:
			ans += 'R' * (x[0] - lst[0])
			ans += 'U' * (x[1] - lst[1])
			lst = x
		else:
			flag = 1
	if flag == 0:
		print('YES')
		print(ans)
	else:
		print('NO')


for t in range(int(input())):
	packages = sorted((tuple(map(int, input().split())) for i in range(int(input()))))
	path = ''
	(x, y) = (0, 0)
	ability = True
	for p in packages:
		path += 'R' * (p[0] - x)
		x = p[0]
		if p[1] - y < 0:
			ability = False
			break
		path += 'U' * (p[1] - y)
		y = p[1]
	if ability:
		print('YES')
		print(path)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	pos = []
	n = int(input())
	for i in range(n):
		k = list(map(int, input().split()))
		pos.append(k)
	ok = False
	ans = ''
	a = min(pos)
	ans += 'R' * a[0] + 'U' * a[1]
	while len(pos) > 1 and (not ok):
		a = min(pos)
		pos.remove(a)
		b = min(pos)
		c = a[0] - b[0]
		d = a[1] - b[1]
		if c <= 0 and d <= 0:
			ans += 'R' * abs(c) + 'U' * abs(d)
		else:
			ok = True
	if ok:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	li = []
	for i in range(n):
		x = list(map(int, input().split()))
		li.append(x)
	li.sort()
	s = 'R' * li[0][0] + 'U' * li[0][1]
	for i in range(1, n):
		if li[i - 1][0] > li[i][0] or li[i - 1][1] > li[i][1]:
			print('NO')
			break
		x = li[i][0] - li[i - 1][0]
		y = li[i][1] - li[i - 1][1]
		s = s + 'R' * x + 'U' * y
	else:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	packages = [tuple(map(int, input().split())) for _ in range(n)]
	packages = sorted(packages)
	done = False
	for (p1, p2) in zip(packages[:-1], packages[1:]):
		if p1[1] > p2[1]:
			print('NO')
			done = True
			break
	if done:
		continue
	x = 0
	y = 0
	steps = ''
	for (a, b) in packages:
		steps += 'R' * (a - x)
		steps += 'U' * (b - y)
		x = a
		y = b
	print('YES')
	print(steps)


from operator import itemgetter
T = int(input())
for _ in range(T):
	pack_no = int(input())
	pack_location = []
	location = [0, 0]
	string = []
	NO = False
	for i in range(pack_no):
		pack_location.append([int(i) for i in input().split(' ')])
	pack_location = sorted(pack_location, key=itemgetter(0, 1))
	for j in pack_location:
		f_X = j[0]
		f_Y = j[1]
		move_right = f_X - location[0]
		if move_right < 0:
			NO = True
			break
		else:
			string.append('R' * move_right)
			location[0] = f_X
		move_up = f_Y - location[1]
		if move_up < 0:
			NO = True
			break
		else:
			string.append('U' * move_up)
			location[1] = f_Y
	if NO:
		print('NO')
	else:
		print('YES')
		print(''.join(string))


for _ in range(int(input())):
	n = int(input())
	pts = []
	for i in range(n):
		l = list(map(int, input().split()))
		pts.append(l)
	pts.sort()
	flag = True
	for i in range(1, n):
		if pts[i][0] < pts[i - 1][0] or pts[i][1] < pts[i - 1][1]:
			flag = False
			break
	if not flag:
		print('NO')
		continue
	print('YES')
	ans = ''
	xd = pts[0][0] - 0
	yd = pts[0][1] - 0
	ans += 'R' * xd
	ans += 'U' * yd
	for i in range(1, n):
		xd = pts[i][0] - pts[i - 1][0]
		yd = pts[i][1] - pts[i - 1][1]
		ans += 'R' * xd
		ans += 'U' * yd
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	packages = [(0, 0)] * n
	for i in range(n):
		(x, y) = map(int, input().split())
		packages[i] = (x, y)
	packages.sort()
	possible = True
	for i in range(1, n):
		if packages[i][1] < packages[i - 1][1]:
			possible = False
			break
	if possible:
		print('YES')
		(x, y) = (0, 0)
		i = 0
		while i < n:
			while i < n and x < packages[i][0]:
				print('R', end='')
				x += 1
				if (x, y) == packages[i]:
					i += 1
			while i < n and y < packages[i][1]:
				print('U', end='')
				y += 1
				if (x, y) == packages[i]:
					i += 1
					break
		print()
	else:
		print('NO')


n = int(input())
for i in range(n):
	k = int(input())
	h = []
	for j in range(k):
		(x, y) = [int(z) for z in input().split()]
		h.append((x, y))
	h.sort(key=lambda p: p[0] + p[1])
	previous = (0, 0)
	answer = str()
	possible = True
	for p in h:
		if p[0] < previous[0] or p[1] < previous[1]:
			possible = False
			break
		answer += 'R' * (p[0] - previous[0])
		answer += 'U' * (p[1] - previous[1])
		previous = p
	if possible:
		print('YES')
		print(answer)
	else:
		print('NO')


for t in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		a = list(map(int, input().split()))
		l.append(a)
	l.sort()
	b = [0, 0]
	flag = 'YES'
	s = ''
	for i in l:
		if i[0] - b[0] >= 0 and i[1] - b[1] >= 0:
			s += 'R' * (i[0] - b[0]) + 'U' * (i[1] - b[1])
			b = i
		else:
			flag = 'NO'
	if flag == 'YES':
		print('YES')
		print(s)
	else:
		print(flag)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		p = list(map(int, input().split()))
		l.append(p)
	l.sort()
	prevx = 0
	prevy = 0
	ans = ''
	f = 0
	for j in l:
		if j[0] > prevx and j[1] < prevy or (j[0] < prevx and j[1] > prevy):
			f = 1
			break
		x = j[0]
		y = j[1]
		while x > prevx:
			ans += 'R'
			x = x - 1
		while y > prevy:
			ans += 'U'
			y = y - 1
		if j[1] > prevy:
			prevy = j[1]
		if j[0] > prevx:
			prevx = j[0]
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


for t in range(int(input())):
	n = int(input())
	nx = 0
	ny = 0
	st = ''
	k = True
	mas = []
	for i in range(n):
		l = []
		(y, x) = map(int, input().split())
		l.append(x)
		l.append(y)
		mas.append(l)
	mas = sorted(mas)
	for i in range(len(mas)):
		(mas[i][0], mas[i][1]) = (mas[i][1], mas[i][0])
	for i in range(len(mas)):
		while nx < mas[i][0]:
			nx += 1
			st += 'R'
		while ny < mas[i][1]:
			ny += 1
			st += 'U'
		if nx > mas[i][0] or ny > mas[i][1]:
			print('NO')
			k = False
			break
	if k == True:
		print('YES')
		print(st)


t = int(input())
while t:
	n = int(input())
	l = [(0, 0)]
	for i in range(n):
		(u, v) = map(int, input().split())
		l.append((u, v))
	l.sort()
	s = ''
	lol = 0
	for i in range(1, n + 1):
		if l[i - 1][1] > l[i][1]:
			lol = 1
			break
		s = s + 'R' * (l[i][0] - l[i - 1][0])
		s = s + 'U' * (l[i][1] - l[i - 1][1])
	if lol:
		print('NO')
	else:
		print('YES')
		print(s)
	t -= 1


for k in range(int(input())):
	a = int(input())
	t = [[0, 0]]
	for j in range(a):
		y = list(map(int, input().split()))
		t.append(y)
	t.sort()
	g = ''
	h = 0
	for i in range(1, len(t)):
		if t[i][0] >= t[i - 1][0] and t[i][1] >= t[i - 1][1]:
			g += (t[i][0] - t[i - 1][0]) * 'R' + (t[i][1] - t[i - 1][1]) * 'U'
		else:
			print('NO')
			h += 1
			break
	if h == 0:
		print('YES')
		print(g)


t = int(input())
for test in range(t):
	num = int(input())
	d = {}
	for i in range(num):
		(y, x) = [int(item) for item in input().split()]
		if y not in d:
			d[y] = []
		d[y].append(x)
	for col in d:
		d[col].sort()
	string = ''
	previousRow = None
	lastRow = 0
	lastCol = 0
	check = True
	for c in sorted(d):
		string += 'R' * (c - lastCol)
		lastCol = c
		if previousRow != None:
			thisRow = d[c][0]
			if thisRow < previousRow:
				print('NO')
				check = False
				break
		for row in d[c]:
			string += 'U' * (row - lastRow)
			lastRow = row
		previousRow = lastRow
	if check:
		print('YES')
		print(string)


t = int(input())
for _ in range(t):
	n = int(input())
	gifts = []
	for i in range(n):
		(x, y) = map(int, input().split())
		gifts.append([x, y])
	gifts.sort()
	s = ''
	curr = [0, 0]
	h = 0
	f = 0
	for i in range(n):
		pt = gifts[i]
		if pt[1] < h:
			f = -1
			print('NO')
			break
		else:
			h = pt[1]
			rs = pt[0] - curr[0]
			us = pt[1] - curr[1]
			for _ in range(rs):
				s += 'R'
			for _ in range(us):
				s += 'U'
			curr[0] = pt[0]
			curr[1] = pt[1]
	if f == 0:
		print('YES')
		print(s)


t = int(input())
for i in range(t):
	n = int(input())
	packages = []
	for j in range(n):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	res = ''
	(current_x, current_y) = (0, 0)
	packages = sorted(packages)
	while packages != []:
		while packages[0][0] > current_x:
			res += 'R'
			current_x += 1
		while packages[0][1] > current_y:
			res += 'U'
			current_y += 1
		if packages[0][0] < current_x or packages[0][1] < current_y:
			print('NO')
			break
		if packages[0][0] == current_x and packages[0][1] == current_y:
			packages.pop(0)
	if packages == []:
		print('YES')
		print(res)


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

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
for _ in range(I()):
	n = I()
	x = [0] * n
	y = [0] * n
	a = set()
	a.clear()
	d = [0] * 1010
	maxs = -1
	for i in range(n):
		(x[i], y[i]) = R()
		d[x[i]] += 1
		a.add(tuple([x[i], y[i]]))
		maxs = max(maxs, x[i] + y[i])
	ans = ''
	cnt = 0
	posx = 0
	posy = 0
	while cnt < n:
		if tuple([posx, posy]) in a:
			cnt += 1
			a.remove(tuple([posx, posy]))
			d[posx] -= 1
		if maxs < posx + posy or cnt == n:
			break
		if d[posx] == 0:
			ans += 'R'
			posx += 1
		else:
			ans += 'U'
			posy += 1
	if cnt == n:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
while t > 0:
	n = int(input())
	(x, y) = (0, 0)
	l = [list(map(int, input().split())) for i in range(n)]
	l.sort()
	i = 0
	s = ''
	z = True
	while x != l[n - 1][0] or y != l[n - 1][1]:
		if l[i][0] < x or l[i][1] < y:
			print('NO')
			z = False
			break
		if l[i][0] >= x:
			s += 'R' * (l[i][0] - x)
			x = x + (l[i][0] - x)
		if l[i][1] >= y:
			s += 'U' * (l[i][1] - y)
			y = y + (l[i][1] - y)
		i += 1
	if z:
		print('YES')
		print(s)
	t -= 1


for _ in range(int(input())):
	try:
		n = int(input())
		l = []
		x1 = 0
		y1 = 0
		for i in range(n):
			(x, y) = map(int, input().split())
			l.append([x, y])
		l.sort()
		for i in l:
			assert x1 <= i[0] and y1 <= i[1]
			x1 = i[0]
			y1 = i[1]
		r = 0
		u = 0
		s = ''
		for i in l:
			r = i[0] - r
			u = i[1] - u
			s += 'R' * r
			s += 'U' * u
			r = i[0]
			u = i[1]
		print('YES')
		print(s)
	except AssertionError:
		print('NO')


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def main():
	t = inin()
	for _ in range(t):
		n = inin()
		a = []
		for i in range(n):
			(x, y) = cin()
			a.append((x, y))
		a.sort()
		x = y = 0
		ans = 'YES'
		an = ''
		for i in a:
			j = i[0]
			k = i[1]
			if j < x or k < y:
				ans = 'NO'
				break
			while x < j:
				an += 'R'
				x += 1
			while y < k:
				an += 'U'
				y += 1
		print(ans)
		if ans == 'YES':
			print(an)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


test_cases = int(input())
for _ in range(test_cases):
	total_n = int(input())
	points = []
	for _ in range(total_n):
		points.append(list(map(int, input().split())))
	points = sorted(points)
	ans = ''
	curr_x = 0
	curr_y = 0
	exists = True
	for (a, b) in points:
		if a > curr_x:
			ans += 'R' * (a - curr_x)
			curr_x = a
		if b < curr_y:
			exists = False
			print('NO')
			break
		if b > curr_y:
			ans += 'U' * (b - curr_y)
			curr_y = b
	if exists:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	P = [None] * n
	for i in range(n):
		P[i] = list(map(int, input().split()))
	P = sorted(P, key=lambda x: x[1])
	P = sorted(P, key=lambda x: x[0])
	seq = 'R' * P[0][0] + 'U' * P[0][1]
	for i in range(n - 1):
		if P[i][1] > P[i + 1][1]:
			print('NO')
			break
		else:
			diff_x = P[i + 1][0] - P[i][0]
			diff_y = P[i + 1][1] - P[i][1]
			seq += 'R' * diff_x + 'U' * diff_y
	else:
		print('YES')
		print(seq)


import bisect
for i in range(int(input())):
	n = int(input())
	a = []
	for j in range(n):
		(x, y) = map(int, input().split())
		bisect.insort_right(a, (x, y))
	res = ''
	R = U = 0
	for j in range(n):
		if a[j][1] < U:
			res = 'NO'
			break
		else:
			res += (a[j][0] - R) * 'R'
			R = a[j][0]
			res += (a[j][1] - U) * 'U'
			U = a[j][1]
	if res != 'NO':
		print('YES')
	print(res)


from operator import itemgetter
t = int(input())
while t > 0:
	n = int(input())
	points = []
	for i in range(n):
		points.append([int(i) for i in input().split()])
	points = sorted(points, key=itemgetter(0, 1))
	x = y = 0
	flag = 1
	ans = ''
	for p in points:
		if p[1] < y:
			flag = 0
			break
		ans += 'R' * (p[0] - x)
		ans += 'U' * (p[1] - y)
		x = p[0]
		y = p[1]
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')
	t -= 1


from collections import defaultdict

def fun(d, n):
	x = 0
	y = 0
	count = 0
	res = ''
	lst = d[0]
	if lst != []:
		mx = max(lst)
		count += len(lst)
		res += 'R' * (mx - x)
		x = mx
		y = 0
	i = 1
	while count < n:
		lst = d[i]
		if lst != []:
			mx = max(lst)
			mn = min(lst)
			if x <= mn:
				count += len(lst)
				res += 'R' * (mn - x)
				res += 'U' * (i - y)
				res += 'R' * (mx - mn)
				x = mx
				y = i
			else:
				return (False, '')
		i += 1
	return (True, res)
t = int(input())
for _ in range(t):
	n = int(input())
	d = defaultdict(list)
	for i in range(n):
		(x, y) = map(int, input().strip().split(' '))
		d[y].append(x)
	(res, s) = fun(d, n)
	if res:
		print('YES')
		print(s)
	else:
		print('NO')


res = ''
t = int(input())
for i in range(t):
	n = int(input())
	a = [[0] * 2 for j in range(n)]
	for j in range(n):
		q = input().split(' ')
		(a[j][0], a[j][1]) = (int(q[0]), int(q[1]))
	a.sort()
	x = 0
	y = 0
	pre_res = ''
	for step in a:
		if y > step[1]:
			pre_res = 'NO\n'
			break
		else:
			while x < step[0]:
				x += 1
				pre_res = pre_res + 'R'
			while y < step[1]:
				y += 1
				pre_res = pre_res + 'U'
	if not pre_res == 'NO\n':
		res = res + 'YES\n' + pre_res + '\n'
	else:
		res = res + pre_res
print(res)


t = int(input())
for l in range(t):
	n = int(input())
	a = []
	for x in range(n):
		temp = list(map(int, input().split()))
		li = [temp[0], temp[1]]
		a.append(li)
	a.sort()
	check = True
	res = 'R' * a[0][0] + 'U' * a[0][1]
	for i in range(n - 1):
		if a[i][0] > a[i + 1][0] or a[i][1] > a[i + 1][1]:
			check = False
			break
		res = res + 'R' * (a[i + 1][0] - a[i][0]) + 'U' * (a[i + 1][1] - a[i][1])
	if check:
		print('YES')
		print(res)
	else:
		print('NO')


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
for _ in range(RI()):
	nb_pts = RI()
	points = [RMI() for _ in range(nb_pts)]
	points = sorted(points)
	curr = [0, 0]
	answ = 'YES'
	anss = ''
	for i in range(nb_pts):
		r = points[i][0] - curr[0]
		u = points[i][1] - curr[1]
		if r < 0 or u < 0:
			answ = 'NO'
			break
		anss += 'R' * r
		anss += 'U' * u
		curr = points[i]
	print(answ)
	if answ == 'YES':
		print(anss)


t = int(input())
for i in range(t):
	n = int(input())
	li = [[0, 0, 0]]
	s = ''
	flag = 1
	for i in range(n):
		(x, y) = map(int, input().split())
		li.append([x, y, x + y])
	my_li = sorted(li, key=lambda k: [k[2], k[0], k[1]])
	for i in range(1, len(my_li)):
		nx = my_li[i][0] - my_li[i - 1][0]
		ny = my_li[i][1] - my_li[i - 1][1]
		if ny < 0 or nx < 0:
			print('NO')
			flag = 0
			break
		s = s + nx * 'R' + ny * 'U'
	if flag:
		print('YES')
		print(s)


T = int(input())
answer = ''
for t in range(T):
	poly = [[False] * 1001 for i in range(1001)]
	lines = [0] * 1001
	hor = [0] * 1001
	ys = dict()
	path = ''
	end = False
	n = int(input())
	for i in range(n):
		(x, y) = list(map(int, input().split(' ')))
		poly[x][y] = True
		lines[x] += 1
		hor[y] += 1
	x = y = 0
	while n > 0:
		if lines[x] == 0:
			path += 'R'
			x += 1
			if x == 1001:
				answer += 'NO\n'
				break
				end = True
		elif poly[x][y]:
			lines[x] -= 1
			hor[y] -= 1
			n -= 1
			if lines[x] != 0 and hor[y] != 0:
				answer += 'NO\n'
				end = True
				break
			elif lines[x] != 0:
				y += 1
				path += 'U'
		else:
			y += 1
			path += 'U'
			if y == 1001:
				answer += 'NO\n'
				end = True
				break
	if not end:
		answer += 'YES\n' + path + '\n'
print(answer)


for _ in range(int(input())):
	n = int(input())
	a = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		a.append(x * 10000 + y)
	a.sort()
	ans = False
	for i in range(1, n):
		num1 = a[i] // 10000
		num2 = a[i] % 10000
		nump1 = a[i - 1] // 10000
		nump2 = a[i - 1] % 10000
		if num1 < nump1 or num2 < nump2:
			ans = True
			print('NO')
			break
	if ans:
		continue
	else:
		print('YES')
		s = ''
		xi = yi = 0
		for j in a:
			num1 = j // 10000
			num2 = j % 10000
			while xi < num1:
				s += 'R'
				xi += 1
			while yi < num2:
				s += 'U'
				yi += 1
		print(s)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	p = [(0, 0)]
	for j in range(n):
		(x, y) = map(int, input().split())
		p.append((x, y))
	p.sort()
	a = ''
	ans = 'YES'
	for k in range(1, n + 1):
		if p[k][1] >= p[k - 1][1]:
			a += 'R' * (p[k][0] - p[k - 1][0]) + 'U' * (p[k][1] - p[k - 1][1])
		else:
			ans = 'NO'
			break
	if ans == 'YES':
		print(ans)
		print(a)
	else:
		print(ans)


test = int(input())
for _ in range(test):
	n = int(input())
	arr = []
	for _ in range(n):
		(a, b) = map(int, input().split())
		arr.append([a, b])
	arr.sort(key=lambda x: (x[0], x[1]))
	ans = True
	py = float('-inf')
	for (x, y) in arr:
		if y < py:
			ans = False
			break
		py = y
	if ans == False:
		print('NO')
	else:
		ans = ''
		px = py = 0
		for (x, y) in arr:
			dx = x - px
			dy = y - py
			px = x
			py = y
			ans += 'R' * dx
			ans += 'U' * dy
		print('YES')
		print(ans)


for i in range(int(input())):
	a = int(input())
	b = []
	b.append([0, 0])
	for j in range(a):
		c = list(map(int, input().strip().split()))[:2]
		b.append(c)
	b.sort()
	d = []
	e = []
	for k in range(len(b) - 1):
		e.append(b[k + 1][1] - b[k][1])
		d.append(b[k + 1][0] - b[k][0])
	if min(d) < 0 or min(e) < 0:
		print('NO')
	else:
		print('YES')
		r = ''
		for n in range(len(d)):
			for m in range(d[n]):
				r += 'R'
			for f in range(e[n]):
				r += 'U'
		print(r)


from sys import stdin, stdout
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import *
input = stdin.readline
prin = stdout.write
from random import sample
t = int(input())
from collections import Counter, deque
from math import sqrt, ceil, log2, gcd
mod = 10 ** 9 + 7

class DisjSet:

	def __init__(self, n):
		self.rank = [1] * n
		self.parent = [i for i in range(n)]

	def find(self, x):
		if self.parent[x] != x:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, x, y):
		xset = self.find(x)
		yset = self.find(y)
		if xset == yset:
			return
		if self.rank[xset] < self.rank[yset]:
			self.parent[xset] = yset
		elif self.rank[xset] > self.rank[yset]:
			self.parent[yset] = xset
		else:
			self.parent[yset] = xset
			self.rank[xset] = self.rank[xset] + 1

def f(arr, i, j, d, dist):
	if i == j:
		return
	nn = max(arr[i:j])
	for tl in range(i, j):
		if arr[tl] == nn:
			dist[tl] = d
			f(arr, i, tl, d + 1, dist)
			f(arr, tl + 1, j, d + 1, dist)

def ps(n):
	cp = 0
	while n % 2 == 0:
		n = n // 2
		cp += 1
	for ps in range(3, ceil(sqrt(n)) + 1, 2):
		while n % ps == 0:
			n = n // ps
			cp += 1
	if n != 1:
		return False
	return True

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def factorials(n, r):
	slr = n
	dpr = r
	qlr = 1
	qs = 1
	mod = 10 ** 9 + 7
	for ip in range(n - r + 1, n + 1):
		qlr = qlr * ip % mod
	for ij in range(1, r + 1):
		qs = qs * ij % mod
	ans = qlr * modInverse(qs) % mod
	return ans

def modInverse(b):
	qr = 10 ** 9 + 7
	return pow(b, qr - 2, qr)
tt = [xa ** 3 for xa in range(0, 10 ** 4 + 1)]
qq = set(tt)

def digits(k, rp):
	n = len(k)
	pq = k[::-1]
	jq = ''
	for ij in pq:
		if ij == '1':
			jq += '1'
		elif ij == '2':
			jq += '5'
		elif ij == '4' or ij == '7' or ij == '3' or (ij == '6') or (ij == '9'):
			jq += '-'
		elif ij == '5':
			jq += '2'
		elif ij == '8':
			jq += '8'
		elif ij == '0':
			jq += '0'
	if jq.find('-') != -1:
		return -1
	else:
		jl = int(jq)
		if jl >= rp:
			return -1
		else:
			return jq

def fr(a, b, h, m):
	kl = int(b)
	kl = (kl + 1) % m
	b = '0' * (2 - len(str(kl))) + str(kl)
	if b == '0' * 2:
		kj = (int(a) + 1) % h
		a = '0' * (2 - len(str(kj))) + str(kj)
	return [a, b]

def ilist():
	return [int(x) for x in input().strip().split()]

def outstrlist(array: list) -> str:
	array = [str(x) for x in array]
	return ' '.join(array)

def islist():
	return list(map(str, input().split().rstrip()))

def outfast(arr: list) -> str:
	ss = ''
	for ip in arr:
		ss += str(ip) + ' '
	return prin.write(ss)
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
for jj in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(x, y) = ilist()
		arr.append([x, y])
	tt = True
	for i in range(n - 1):
		for j in range(i + 1, n):
			if arr[i][0] > arr[j][0] and arr[i][1] < arr[j][1] or (arr[i][0] < arr[j][0] and arr[i][1] > arr[j][1]):
				tt = False
				break
	if not tt:
		print('NO')
		continue
	print('YES')
	arr = sorted(arr, key=lambda x: x[0] * 10001 + x[1])
	ks = set()
	ss = ''
	row = 0
	col = 0
	for itt in arr:
		if itt[0] in ks:
			ss += 'U' * (itt[1] - row)
			row = itt[1]
		else:
			ss += 'R' * (itt[0] - col)
			ss += 'U' * (itt[1] - row)
			col = itt[0]
			row = itt[1]
			ks.add(itt[0])
	print(ss)


import sys

def cplist(x, y):
	plist = [(0, 0)] * (len(x) + 1)
	for i in range(0, len(x)):
		plist[i + 1] = (x[i], y[i])
	plist.sort(key=lambda x: (x[0], x[1]))
	return plist

def answer(n, x, y):
	plist = cplist(x, y)
	dir_list = []
	for i in range(1, len(plist)):
		xd = plist[i][0] - plist[i - 1][0]
		yd = plist[i][1] - plist[i - 1][1]
		if xd >= 0 and yd >= 0:
			for j in range(xd):
				dir_list.append('R')
			for j in range(yd):
				dir_list.append('U')
		else:
			print('NO')
			return
	print('YES')
	print(''.join(map(str, dir_list)))
	return

def main():
	t = int(input())
	while t:
		n = int(input())
		x = [0] * n
		y = [0] * n
		for j in range(n):
			(x[j], y[j]) = [int(i) for i in sys.stdin.readline().split()]
		answer(n, x, y)
		t -= 1
	return
main()


for _ in range(int(input())):
	something = []
	max_x = 0
	max_y = 0
	answer = ''
	for _ in range(int(input())):
		something.append([int(x) for x in input().split(' ')])
	something.sort()
	for i in something:
		if max_x > i[0] or max_y > i[1]:
			print('NO')
			answer = 'nothing'
			break
		for _ in range(i[0] - max_x):
			answer += 'R'
		for _ in range(i[1] - max_y):
			answer += 'U'
		max_x = i[0]
		max_y = i[1]
	if answer != 'nothing':
		print('YES')
		print(answer)


t = int(input())
for i in range(t):
	n = int(input())
	xy = []
	for j in range(n):
		xy += [list(map(int, input().split(' ')))]
	xy = sorted(xy, key=lambda a: a[0] + a[1])
	outp = ''
	p = [0, 0]
	passs = True
	for j in range(n):
		if xy[j][0] < p[0] or xy[j][1] < p[1]:
			print('NO')
			passs = False
			break
		else:
			outp += ''.join(['R' for k in range(xy[j][0] - p[0])])
			outp += ''.join(['U' for k in range(xy[j][1] - p[1])])
			p = xy[j]
	if passs:
		print('YES')
		print(outp)


def is_yes():
	n = int(input())
	k = []
	mx = 0
	my = 0
	for i in range(n):
		inp = list(map(int, input().split()))
		mx = max(mx, inp[0])
		my = max(my, inp[1])
		k.append(inp)
	k.sort()
	px = 0
	py = 0
	p = ''
	y = 0
	for i in k:
		if i[1] >= y:
			p += 'R' * (i[0] - px)
			p += 'U' * (i[1] - py)
			y = i[1]
		else:
			print('NO')
			return
		px = i[0]
		py = i[1]
	print('YES')
	print(p)
t = int(input())
for i in range(t):
	is_yes()


t = int(input())
for i in range(t):
	n = int(input())
	nums = [[0, 0]]
	nums.extend([list(map(int, input().split())) for i in range(n)])
	nums.sort()
	ans = ''
	can = True
	for i in range(n):
		(dx, dy) = (nums[i + 1][0] - nums[i][0], nums[i + 1][1] - nums[i][1])
		if dx < 0 or dy < 0:
			can = False
			break
		else:
			ans += dx * 'R'
			ans += dy * 'U'
	if can:
		print('YES')
		print(ans)
	else:
		print('NO')


list_ans = []
for _ in range(int(input())):
	n = int(input())
	list1 = [[0, 0]]
	for i in range(n):
		list1.append(list(map(int, input().split())))
	list1.sort()
	ans = ''
	for i in range(n):
		if list1[i + 1][1] >= list1[i][1]:
			ans += 'R' * (list1[i + 1][0] - list1[i][0]) + 'U' * (list1[i + 1][1] - list1[i][1])
		else:
			list_ans.append('NO')
			break
	else:
		list_ans.append('YES')
		list_ans.append(ans)
for item in list_ans:
	print(item)


t = int(input())
while t > 0:
	n = int(input())
	x = []
	while n > 0:
		x.append(list(map(int, input().split())))
		n -= 1
	x = sorted(x)
	(vujs, kotis) = ([], [])
	for xy in x:
		vujs.append(xy[0])
		kotis.append(xy[1])
	if vujs == sorted(vujs) and kotis == sorted(kotis):
		print('YES')
		pos = [0, 0]
		command = ''
		for xy in x:
			while pos[0] != xy[0]:
				pos[0] += 1
				command += 'R'
			while pos[1] != xy[1]:
				pos[1] += 1
				command += 'U'
		print(command)
	else:
		print('NO')
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	packages = [[int(k) for k in input().split()] for _ in range(n)]
	packages.sort(key=lambda p: p[0] + p[1])
	ret = []
	position = [0, 0]
	for p in packages:
		if p[0] < position[0] or p[1] < position[1]:
			break
		ret.append('R' * (p[0] - position[0]) + 'U' * (p[1] - position[1]))
		position = p
	if len(ret) == len(packages):
		print('YES')
		print(''.join(ret))
	else:
		print('NO')


t = int(input())
for I in range(t):
	n = int(input())
	a = []
	for i in range(n):
		x = [int(i) for i in input().split()]
		a.append(x)
	a.sort()
	(cx, cy) = (0, 0)
	poss = 1
	ans = ''
	for i in range(len(a)):
		if a[i][0] - cx < 0 or a[i][1] - cy < 0:
			poss = 0
			break
		else:
			right = a[i][0] - cx
			up = a[i][1] - cy
			ans += 'R' * right
			ans += 'U' * up
			cx = a[i][0]
			cy = a[i][1]
	if poss:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	s = ''
	inir = 0
	iniu = 0
	flag = 0
	l = []
	for i in range(n):
		(x, y) = [int(j) for j in input().split()]
		l.append([x, y])
	l.sort()
	for i in range(n):
		x = l[i][0]
		y = l[i][1]
		if x >= inir and y >= iniu:
			right = x - inir
			s += 'R' * right
			inir = x
			up = y - iniu
			s += 'U' * up
			iniu = y
		else:
			print('NO')
			flag = 1
			break
	if flag == 0:
		print('YES')
		print(s)


for t in range(int(input())):
	n = int(input())
	l = []
	for j in range(n):
		(a, b) = map(int, input().split())
		l.append((a, b))
	l.sort(key=lambda x: (x[0], x[1]))
	s = ''
	(x, y, f) = (0, 0, 1)
	for i in range(n):
		if l[i][1] < y:
			print('NO')
			f = 0
			break
		if x != l[i][0]:
			s += 'R' * (l[i][0] - x)
			x = l[i][0]
		if y < l[i][1]:
			s += 'U' * (l[i][1] - y)
			y = l[i][1]
	if f:
		print('YES')
		print(s)


for _ in range(int(input())):
	a = []
	for _ in range(int(input())):
		a.append(tuple(map(int, input().split())))
	a.sort()
	flag = True
	ans = ''
	ans = ans + 'R' * a[0][0] + 'U' * a[0][1]
	for j in range(1, len(a)):
		if a[j][1] >= a[j - 1][1]:
			ans = ans + 'R' * (a[j][0] - a[j - 1][0]) + 'U' * (a[j][1] - a[j - 1][1])
		else:
			flag = False
			break
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	li = []
	s = ''
	k = ''
	l = True
	for j in range(n):
		(x, y) = map(int, input().split())
		li.append([x, y])
	li.sort()
	for j in range(len(li)):
		if j != 0:
			if li[j][1] < li[j - 1][1]:
				print('NO')
				l = False
				break
			else:
				s += 'R' * (li[j][0] - li[j - 1][0])
				s += 'U' * (li[j][1] - li[j - 1][1])
	if l == True:
		k += 'R' * li[0][0]
		k += 'U' * li[0][1]
		print('YES')
		print(k + s)


t = int(input())
while t:
	x = []
	l = []
	s = ''
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append(a)
		l.append(b)
		x.append(l)
		l = []
	x.sort()
	r = [0, 0]
	for i in range(n):
		m = x[i][0] - r[0]
		q = x[i][1] - r[1]
		if m < 0 or q < 0:
			print('NO')
			break
		else:
			for _ in range(m):
				s += 'R'
			for _ in range(q):
				s += 'U'
		r = x[i]
	else:
		print('YES')
		print(s)
	x = []
	t -= 1


def run():
	pack = int(input())
	packs = []
	for i in range(pack):
		packs.append([int(i) for i in input().split()])
	packs.sort(key=lambda x: sum(x))
	ret = ''
	me = [0, 0]
	next_pos = 0
	while me != packs[-1]:
		while me != packs[next_pos]:
			if me[0] < packs[next_pos][0]:
				me[0] += 1
				ret += 'R'
			elif me[1] < packs[next_pos][1]:
				me[1] += 1
				ret += 'U'
			else:
				print('NO')
				return
		next_pos += 1
	print('YES')
	print(ret)
n = int(input())
for i in range(n):
	run()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(a, b) = list(map(int, input('').split()))
		ls = [a, b]
		arr.append(ls)
	arr.sort()
	st = ''
	prev = [0, 0]
	pos = True
	for i in range(len(arr)):
		if arr[i][1] < prev[1]:
			pos = False
			break
		else:
			st = st + 'R' * (arr[i][0] - prev[0])
			st += 'U' * (arr[i][1] - prev[1])
		prev = arr[i]
	if pos == True:
		print('YES')
		print(st)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	answer = ''
	xx = 0
	yy = 0
	for j in range(n):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.sort(key=lambda x: (x[0], x[1]))
	for j in range(n):
		if a[j][0] >= xx:
			answer += 'R' * (a[j][0] - xx)
			xx = a[j][0]
			if a[j][1] >= yy:
				answer += 'U' * (a[j][1] - yy)
				yy = a[j][1]
			else:
				print('NO')
				break
		else:
			print('NO')
			break
	else:
		print('YES')
		print(answer)


t = int(input())
for i in range(t):
	pr = 0
	s = ''
	a = []
	n = int(input())
	for j in range(n):
		a.append([int(i) for i in input().split()])
	a.sort()
	for j in range(1, n):
		if a[j][1] < a[j - 1][1]:
			pr = 1
			print('NO')
			break
	if pr != 1:
		s += 'R' * a[0][0] + 'U' * a[0][1]
		for j in range(1, n):
			s += 'R' * (a[j][0] - a[j - 1][0])
			s += 'U' * (a[j][1] - a[j - 1][1])
		print('YES')
		print(s)


t = int(input())
while t > 0:
	n = int(input())
	lst = []
	while n > 0:
		l = [int(ele) for ele in input().split()]
		lst.append(l)
		n -= 1
	lst.sort()
	flg = 0
	for i in range(len(lst) - 1):
		if lst[i][1] > lst[i + 1][1]:
			flg = 1
			break
	if flg == 1:
		print('NO')
	else:
		s = ''
		x = 0
		y = 0
		for ele in lst:
			s += 'R' * (ele[0] - x)
			s += 'U' * (ele[1] - y)
			x = ele[0]
			y = ele[1]
		print('YES')
		print(s)
	t -= 1


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	mp = []
	for i in range(n):
		(a, b) = [int(x) for x in input().split()]
		mp.append([a, b])
	mp.sort(key=lambda a: (a[0], a[1]))
	ans = ''
	pre = [0, 0]
	flag = 1
	for point in mp:
		if pre[0] <= point[0] and pre[1] <= point[1]:
			for i in range(point[0] - pre[0]):
				ans = ans + 'R'
			for i in range(point[1] - pre[1]):
				ans = ans + 'U'
			pre = point
		else:
			flag = 0
			break
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	n = int(input())
	p = []
	for i in range(n):
		p.append(list(map(int, input().split())))
	dist = [((i[0] ** 2 + i[1] ** 2) ** 0.5, ind) for (ind, i) in enumerate(p)]
	dist.sort()
	path = ''
	cur_x = 0
	cur_y = 0
	done = False
	for i in dist:
		mov_r = p[i[1]][0] - cur_x
		mov_u = p[i[1]][1] - cur_y
		if mov_r >= 0 and mov_u >= 0:
			path += 'R' * mov_r
			path += 'U' * mov_u
			cur_x = p[i[1]][0]
			cur_y = p[i[1]][1]
		else:
			print('NO')
			done = True
			break
	if not done:
		print('YES')
		print(path)


import sys
sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

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

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

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
n = II()
for i in range(n):
	l = II()
	c = [[0, 0]] + sorted(LLI(l))
	ans = list()
	f = 0
	for j in range(l):
		if c[j][0] > c[j + 1][0] or c[j][1] > c[j + 1][1]:
			print('NO')
			f = 1
			break
		ans += ['R'] * (c[j + 1][0] - c[j][0])
		ans += ['U'] * (c[j + 1][1] - c[j][1])
	if not f:
		print('YES')
		print(''.join(ans))


n = int(input())
ans = []
final_ans = []
for i in range(n):
	ans_if_yes = ''
	flag = 1
	m = int(input())
	p = []
	for i in range(m):
		p.append([int(i) for i in input().split()])
	p.append([0, 0])
	p = sorted(p)
	for i in range(len(p) - 1):
		x_dif = p[i + 1][0] - p[i][0]
		y_dif = p[i + 1][1] - p[i][1]
		ans_if_yes = ''
		if x_dif < 0 or y_dif < 0:
			flag = 0
			break
		elif flag:
			ans_if_yes += 'R' * x_dif
			ans_if_yes += 'U' * y_dif
			ans.append(ans_if_yes)
	if flag:
		final_ans.append('YES')
		final_ans.append(ans)
		ans = []
	else:
		final_ans.append('NO')
		ans = []
for i in final_ans:
	i = ''.join(i)
	print(i)


t = int(input())

def solve(l):
	l = sorted(l)
	s = ''
	for j in range(1, n + 1):
		x = l[j][0]
		y = l[j][1]
		x1 = l[j - 1][0]
		y1 = l[j - 1][1]
		if x - x1 < 0 or y - y1 < 0:
			return 'NO'
		else:
			s += 'R' * (x - x1) + 'U' * (y - y1)
	return 'YES\n' + s
for _ in range(t):
	n = int(input())
	l = [[0, 0]]
	for i in range(n):
		l.append(list(map(int, input().split())))
	print(solve(l))


for i in range(int(input())):
	t = int(input())
	a = []
	for i in range(t):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.sort()
	ans = ''
	x = 0
	y = 0
	f = 0
	for i in range(len(a) - 1):
		if a[i + 1][0] < a[i][0] or a[i + 1][1] < a[i][1]:
			print('NO')
			f = 1
			break
	if f == 1:
		continue
	for i in range(len(a)):
		a[i][0] -= x
		x += a[i][0]
		a[i][1] -= y
		y += a[i][1]
		f = 'R' * a[i][0]
		ans += f
		f1 = 'U' * a[i][1]
		ans += f1
	print('YES')
	print(ans)


import sys
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(sys.stdin.readline())
	list_package = [list(map(int, sys.stdin.readline().split())) for _ in range(n)]
	list_package.sort()
	res = ''
	former = [0, 0]
	for now in list_package:
		if now[0] >= former[0] and now[1] >= former[1]:
			res += 'R' * (now[0] - former[0])
			res += 'U' * (now[1] - former[1])
		else:
			res = ''
			break
		former = now
	if res:
		print('YES')
		print(res)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = [[0, 0]]
	for j in range(n):
		x = list(map(int, input().split()))
		a.append(x)
	a.sort()
	s = ''
	for i in range(len(a) - 1):
		if a[i + 1][0] - a[i][0] < 0 or a[i + 1][1] - a[i][1] < 0:
			s = 'NO'
			break
		else:
			s = s + (a[i + 1][0] - a[i][0]) * 'R'
			s = s + (a[i + 1][1] - a[i][1]) * 'U'
	if s == 'NO':
		print(s)
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	arr = [[0, 0]]
	for i in range(n):
		arr.append(list(map(int, input().split())))
	arr.sort()
	s = ''
	flag = 0
	for i in range(1, n + 1):
		if arr[i][1] < arr[i - 1][1]:
			flag = 1
			break
		else:
			s += (arr[i][0] - arr[i - 1][0]) * 'R' + (arr[i][1] - arr[i - 1][1]) * 'U'
	if flag == 0:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())

def solve():
	n = int(input())
	packages = []
	ans = ''
	for _ in range(n):
		(a, b) = map(int, input().split())
		packages.append((a, b))
	packages.sort()
	x = 0
	y = 0
	for (px, py) in packages:
		while x != px or y != py:
			if px > x:
				x += 1
				ans += 'R'
			elif py > y:
				y += 1
				ans += 'U'
			else:
				print('NO')
				return
	print('YES')
	print(ans)
for _ in range(t):
	solve()


T = int(input())
for i in range(T):
	j = int(input())
	ll = []
	for x in range(j):
		inp = list(map(int, input().split()))
		l = [inp[0], inp[1]]
		ll.append(l)
	ll.sort()
	x = 0
	y = 0
	qwe = ''
	for q in ll:
		if q[0] - x >= 0 and q[1] - y >= 0:
			p = (q[0] - x) * 'R'
			o = (q[1] - y) * 'U'
			x = q[0]
			y = q[1]
			qwe += p + o
		else:
			print('NO')
			break
	if x == ll[-1][0] and y == ll[-1][1]:
		print('YES')
		print(qwe)


def solve(a):
	max_y = a[0][1]
	for i in range(1, n):
		if a[i][1] >= max_y:
			max_y = a[i][1]
		else:
			return 0
	return 1
for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append([y, x])
	a.sort()
	if solve(a):
		print('YES')
		last = [0, 0]
		ans = ''
		for i in range(n):
			ans += 'R' * (a[i][1] - last[1]) + 'U' * (a[i][0] - last[0])
			last = a[i]
		print(ans)
	else:
		print('NO')


test = int(input())
for t in range(test):
	n = int(input())
	points = []
	for i in range(n):
		p = input().split()
		points.append((int(p[0]), int(p[1])))
	points.sort()
	ki = 0
	vi = 0
	x = 0
	for (k, v) in points:
		if k > ki and v < vi:
			print('NO')
			x = 5
			break
		ki = k
		vi = v
	if x == 0:
		print('YES')
		ke = 0
		ve = 0
		ans = ''
		for (k, v) in points:
			for r in range(k - ke):
				ans += 'R'
			for u in range(v - ve):
				ans += 'U'
			ke = k
			ve = v
		print(ans)


from sys import stdin as IN
from sys import stdout as OUT

def SortOd(val):
	return val[0] * 1001 + val[1]
t = int(IN.readline())
for _ in range(t):
	n = int(IN.readline())
	a = [list(map(int, IN.readline().split())) for _loopCounter in range(n)]
	a.sort(key=SortOd)
	ans_Exist = True
	for i in range(1, n):
		if a[i][0] >= a[i - 1][0] and a[i][1] >= a[i - 1][1]:
			pass
		else:
			ans_Exist = False
	if not ans_Exist:
		print('NO')
		continue
	print('YES')
	ans = ''
	base = [0, 0]
	for i in a:
		ans += (i[0] - base[0]) * 'R' + (i[1] - base[1]) * 'U'
		base = i
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	m = []
	for j in range(n):
		m.append(list(map(int, input().split())))
	c = 0
	l = [0, 0]
	z = []
	m.sort()
	m.sort(key=lambda x: x[1])
	for j in range(n):
		x = m[j][0] - l[0]
		y = m[j][1] - l[1]
		if x < 0 or y < 0:
			c = 1
			break
		else:
			z.append(x * 'R' + y * 'U')
			l = [m[j][0], m[j][1]]
	if c == 1:
		print('NO')
	else:
		print('YES')
		listToStr = ''.join(map(str, z))
		print(listToStr)


from sys import stdin, stdout
rl = lambda : stdin.readline()
rll = lambda : stdin.readline().split()

def main():
	T = int(rl())
	for _ in range(T):
		n = int(rl())
		pts = []
		for _ in range(n):
			pts.append([int(x) for x in rll()])
		pts.sort()
		(path, prevx, prevy) = ([], 0, 0)
		for (x, y) in pts:
			if y < prevy:
				pts = []
				break
			(xdiff, ydiff) = (x - prevx, y - prevy)
			path.extend(['R'] * xdiff)
			path.extend(['U'] * ydiff)
			(prevx, prevy) = (x, y)
		if pts:
			stdout.write('YES\n')
			stdout.write(''.join(path))
			stdout.write('\n')
		else:
			stdout.write('NO\n')
main()


for _ in range(int(input())):
	n = int(input())
	coords = list()
	for _ in range(n):
		coords.append(list(map(int, input().split())))
	coords.sort()
	ans = False
	output = list()
	(cur_x, cur_y) = (0, 0)
	for i in range(n):
		(x, y) = coords[i]
		x_diff = x - cur_x
		y_diff = y - cur_y
		if x_diff < 0 or y_diff < 0:
			break
		else:
			output += 'R' * x_diff
			output += 'U' * y_diff
		(cur_x, cur_y) = (x, y)
	else:
		ans = True
	if ans:
		print('YES')
		print(''.join(output))
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(tuple(map(int, input().split())))
	a.sort()
	(lst, mx, lsty) = (0, 0, 0)
	bad = False
	ans = []
	for i in a:
		x = i[0]
		y = i[1]
		if y < mx:
			bad = True
			break
		mx = max(mx, y)
		ans.append('R' * (x - lst))
		ans.append('U' * (mx - lsty))
		lsty = y
		lst = x
	if not bad:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


from functools import cmp_to_key

def comparator(a, b):
	if a[0] > b[0]:
		return 1
	elif a[0] < b[0]:
		return -1
	else:
		if a[1] > b[1]:
			return 1
		if a[1] < b[1]:
			return -1
		if a[1] == b[1]:
			return 0
for _ in range(int(input())):
	n = int(input())
	l = list()
	l.append([0, 0])
	for i in range(n):
		l.append(list(map(int, input().split())))
	l = sorted(l, key=cmp_to_key(comparator))
	s = list()
	flag = True
	for i in range(len(l) - 1):
		r = int(l[i + 1][0] - l[i][0])
		u = int(l[i + 1][1] - l[i][1])
		if r >= 0 and u >= 0:
			s.append('R' * r + 'U' * u)
		else:
			flag = False
			print('NO')
			break
	if flag:
		print('YES')
		print(''.join(map(str, s)))


import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = pow(10, 9) + 7

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

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

def solve():
	n = int(inp())
	points = []
	for i in range(0, n):
		(a, b) = sep()
		points.append([a, b])
	points = sorted(points)
	f = 0
	chck = points[0][1]
	for i in range(1, n):
		if points[i][1] < chck:
			f = 1
			break
		else:
			chck = points[i][1]
	if f == 1:
		out('NO')
		nextline()
	else:
		out('YES')
		nextline()
		ans = ''
		for i in range(0, n):
			if i == 0:
				ans += 'R' * points[0][0]
				ans += 'U' * points[0][1]
			else:
				ans += 'R' * (points[i][0] - points[i - 1][0])
				ans += 'U' * (points[i][1] - points[i - 1][1])
		out(ans)
		nextline()
testcase(int(inp()))


t = int(input())
while t:
	t -= 1
	n = int(input())
	(x, y) = (0, 0)
	co = 0
	f = []
	for i in range(n):
		(a, b) = map(int, input().split())
		f.append([a, b])
	f.sort()
	s = ''
	flag = 0
	for i in f:
		if i[1] == y:
			s += 'R' * (i[0] - x)
			x = i[0]
		elif i[0] == x:
			s += 'U' * (i[1] - y)
			y = i[1]
		elif x <= i[0] and y <= i[1]:
			s += 'R' * (i[0] - x)
			s += 'U' * (i[1] - y)
			x = i[0]
			y = i[1]
		else:
			flag = 1
			break
	if flag == 0:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	cor = [list(map(int, input().split())) for i in range(int(input()))]
	cor.sort()
	x_cur = 0
	y_cur = 0
	ans = []
	for (x, y) in cor:
		if x < x_cur or y < y_cur:
			print('NO')
			break
		ans.extend(['R'] * (x - x_cur) + ['U'] * (y - y_cur))
		x_cur = x
		y_cur = y
	else:
		print('YES')
		print(''.join((x for x in ans)))


t = int(input())
for _ in range(t):
	ans = ''
	f = 0
	x = 0
	y = 0
	s = []
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		s.append((a, b))
		s.sort()
	for i in s:
		if i[0] >= x and i[1] >= y:
			ans += 'R' * (i[0] - x)
			ans += 'U' * (i[1] - y)
			x = i[0]
			y = i[1]
		else:
			f = 1
			break
	if f:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		a.append(list(map(int, input().split())))
	a = sorted(a)
	ans = ''
	prevy = 0
	prevx = 0
	flag = 0
	for val in a:
		if val[1] >= prevy:
			for j in range(abs(prevx - val[0])):
				ans += 'R'
			for j in range(abs(prevy - val[1])):
				ans += 'U'
		else:
			print('NO')
			flag = 1
			break
		prevx = val[0]
		prevy = val[1]
	if flag == 1:
		continue
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	N = int(input())
	val = ''
	A = []
	for i in range(N):
		(x, y) = map(int, input().split())
		A.append([x, y])
	A.sort()
	t = [0, 0]
	temp = 0
	for i in range(len(A)):
		if A[i][0] - t[0] < 0 or A[i][1] - t[1] < 0:
			print('NO')
			temp = 1
			break
		else:
			z = 'R' * (A[i][0] - t[0])
			z += 'U' * (A[i][1] - t[1])
			val += z
			t[0] = A[i][0]
			t[1] = A[i][1]
	if temp == 0:
		print('YES')
		print(val)


import sys

def fastio():
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep=' ', end='\n'):
	print(*var, file=sys.stderr, end=end, sep=sep)
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
(t,) = I()
while t:
	t -= 1
	(n,) = I()
	a = []
	for i in range(n):
		a.append(tuple(I()))
	a.sort()
	ans = 'YES'
	res = ''
	(x, y) = (0, 0)
	for (u, v) in a:
		if u < x or v < y:
			print('NO')
			break
		res += (u - x) * 'R' + (v - y) * 'U'
		(x, y) = (u, v)
	else:
		print(ans)
		print(res)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	xy = []
	for j in range(n):
		(x, y) = map(int, input().split())
		xy.append((min(x, y), x, y))
	xy.sort()
	cur_xy = (0, 0)
	ans = ''
	flag = True
	for (key, x, y) in xy:
		(cur_x, cur_y) = cur_xy
		if cur_x <= x:
			ans += 'R' * (x - cur_x)
			cur_x = x
		else:
			flag = False
		if cur_y <= y:
			ans += 'U' * (y - cur_y)
			cur_y = y
		else:
			flag = False
		if not flag:
			break
		cur_xy = (cur_x, cur_y)
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	l = []
	for j in range(n):
		x = list(map(int, input().split()))
		l.append(x)
	l.sort(key=lambda x: (x[0], x[1]))
	pos = [0, 0]
	st = ''
	alert = 0
	for t in l:
		if pos[1] > t[1]:
			alert = 1
			print('NO')
			break
		st += 'R' * (t[0] - pos[0])
		st += 'U' * (t[1] - pos[1])
		pos[0] = t[0]
		pos[1] = t[1]
	if alert == 1:
		continue
	print('YES')
	print(st)


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.sort(key=lambda x: x[0] + x[1])
	s = ''
	a = [[0, 0]] + a
	n += 1
	ans = 'YES'
	for i in range(n - 1):
		if a[i + 1][1] >= a[i][1] and a[i + 1][0] >= a[i][0]:
			s += (a[i + 1][0] - a[i][0]) * 'R' + (a[i + 1][1] - a[i][1]) * 'U'
		else:
			ans = 'NO'
	if ans == 'YES':
		print(ans)
		print(s)
	else:
		print(ans)


import math

def distance(x1, y1, x2, y2):
	return math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))
t = int(input())
while t:
	t -= 1
	n = int(input())
	l = []
	for i in range(0, n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	s = ''
	(lx, ly) = (0, 0)
	(tx, ty) = (0, 0)
	u = 0
	o = 0
	for i in range(0, n):
		u = -1
		mi = 1000000000
		for i in range(0, n):
			if l[i][0] != -1 and l[i][1] != -1:
				if distance(lx, ly, l[i][0], l[i][1]) <= mi:
					mi = distance(lx, ly, l[i][0], l[i][1])
					tx = l[i][0]
					ty = l[i][1]
					u = i
		l[u][0] = -1
		l[u][1] = -1
		if tx > lx and ty >= ly or (tx >= lx and ty > ly):
			s += 'R' * (tx - lx)
			s += 'U' * (ty - ly)
			lx = tx
			ly = ty
		else:
			o = 1
			break
	p = 0
	for i in range(0, n):
		if l[i][0] != -1 or l[i][1] != -1:
			p = 1
	if o == 1 or p == 1:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(0, int(t)):
	paquetes = int(input())
	packs = []
	x = [0]
	y = [0]
	for paquete in range(0, paquetes):
		packetito = [int(x) for x in input().split()]
		packs.append((packetito[0], packetito[1]))
		x.append(packetito[0])
		y.append(packetito[1])
	x.sort()
	y.sort()
	error = 0
	contador = 1
	palabra = ''
	while error == 0 and contador < paquetes + 1:
		a = x[contador]
		b = y[contador]
		if (a, b) in packs and b - x[contador - 1] + a - y[contador - 1] != 0:
			palabra = palabra + 'R' * (x[contador] - x[contador - 1]) + 'U' * (y[contador] - y[contador - 1])
			contador += 1
		else:
			error += 1
	if error == 0:
		print('YES')
		print(palabra)
	else:
		print('NO')


t = int(input())
while t > 0:
	n = int(input())
	dic = {}
	row = []
	s = ''
	for i in range(n):
		(x, y) = map(int, input().split())
		if x not in dic:
			dic[x] = (y, y)
		else:
			dic[x] = (min(dic[x][0], y), max(dic[x][1], y))
		if x not in row:
			row.append(x)
	u = v = 0
	flag = 1
	row.sort()
	for i in range(len(row)):
		if u > row[i] or v > dic[row[i]][0]:
			print('NO')
			flag = -1
			break
		for j in range(row[i] - u):
			s += 'R'
		for j in range(dic[row[i]][1] - v):
			s += 'U'
		u = row[i]
		v = dic[row[i]][1]
	if flag != -1:
		print('YES')
		print(s)
	t -= 1


T = int(input())
for i in range(T):
	n = int(input())
	l = []
	f = 0
	m = ''
	for j in range(n):
		(x, y) = input().split()
		x = int(x)
		y = int(y)
		l.append([x, y])
	l.sort()
	if l[0][0] != 0:
		m = m + 'R' * l[0][0]
	if l[0][1] != 0:
		m = m + 'U' * l[0][1]
	p = l[0][0]
	q = l[0][1]
	for j in range(1, len(l)):
		if l[j][0] == p:
			if l[j][1] >= q:
				m = m + 'U' * (l[j][1] - q)
				q = l[j][1]
		else:
			m = m + 'R' * (l[j][0] - p)
			p = l[j][0]
			if l[j][1] >= q:
				m = m + 'U' * (l[j][1] - q)
				q = l[j][1]
			else:
				f = 1
				break
	if f == 0:
		print('YES', m, sep='\n')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	lst = []
	for i in range(n):
		(i, j) = map(int, input().split())
		lst += [[i, j]]
	lst = sorted(lst, key=lambda k: [k[0], k[1]])
	ans = 'R' * lst[0][0] + 'U' * lst[0][1]
	flag = 0
	for i in range(n - 1):
		if lst[i][1] > lst[i + 1][1] and lst[i][0] < lst[i + 1][0]:
			print('NO')
			flag = 1
			break
		elif lst[i][1] < lst[i + 1][1] and lst[i][0] < lst[i + 1][0]:
			r_c = lst[i + 1][0] - lst[i][0]
			u_c = lst[i + 1][1] - lst[i][1]
			ans += 'R' * r_c + 'U' * u_c
		elif lst[i][0] == lst[i + 1][0]:
			u_c = lst[i + 1][1] - lst[i][1]
			ans += 'U' * u_c
		elif lst[i][1] == lst[i + 1][1]:
			r_c = lst[i + 1][0] - lst[i][0]
			ans += 'R' * r_c
	if flag == 0:
		print('YES')
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	flg = 0
	x = 0
	y = 0
	ans = ''
	for j in range(n):
		(xx, yy) = map(int, input().split())
		a.append([xx, yy])
	a.sort()
	for (j, k) in a:
		if k < y:
			flg = 1
			break
		ans += 'R' * (j - x) + 'U' * (k - y)
		x = j
		y = k
	if flg == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


n = int(input())
for i in range(n):
	t = int(input())
	r = 0
	u = 0
	h = 0
	s = ''
	a = []
	for i in range(t):
		(p, q) = map(int, input().split())
		a.append([p, q])
	a.sort()
	for i in range(t):
		if a[i][0] > r:
			m = a[i][0] - r
			st = 'R' * m
			s = s + st
			r += a[i][0] - r
		if a[i][1] > u:
			s += 'U' * (a[i][1] - u)
			u += a[i][1] - u
		if a[i][0] < r:
			h = 1
			print('NO')
			break
		if a[i][1] < u:
			h = 1
			print('NO')
			break
	if h == 0:
		print('YES')
		print(s)


def solve():
	n = int(input())
	a = [[0, 0]]
	for _ in range(n):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.sort()
	(ans, path) = ('YES', '')
	for i in range(n):
		if a[i][0] <= a[i + 1][0] and a[i][1] <= a[i + 1][1]:
			path += 'R' * (a[i + 1][0] - a[i][0]) + 'U' * (a[i + 1][1] - a[i][1])
		else:
			ans = 'NO'
			break
	print(ans)
	if ans == 'YES':
		print(path)
t = int(input())
for _ in range(t):
	solve()


def cal(a, b, c, d):
	if c < a or d < b:
		return 'shit'
	s = ''
	s = s + 'R' * (c - a)
	s = s + 'U' * (d - b)
	return s
for _ in range(int(input())):
	n = int(input())
	j = []
	for _ in range(n):
		(a, b) = list(map(int, input().split()))
		j.append((a, b))
	j.sort(key=lambda x: x[1])
	j.sort(key=lambda x: x[0])
	(q, w) = (0, 0)
	s = ''
	flag = 0
	for x in j:
		(q1, w1) = (x[0], x[1])
		j = cal(q, w, q1, w1)
		s = s + j
		q = q1
		w = w1
		if j == 'shit':
			flag = 1
			break
	if flag == 0:
		print('YES')
		print(s)
	else:
		print('NO')


q = int(input())
for rwre in range(q):
	n = int(input())
	l = []
	for i in range(n):
		k = list(map(int, input().split()))
		l.append(k)
	l.sort()
	tak = 1
	for i in range(1, n):
		if l[i][1] < l[i - 1][1]:
			tak = 0
			break
	if tak == 0:
		print('NO')
	else:
		pos = [0, 0]
		goal = 0
		ans = []
		while goal < n:
			if l[goal][0] > pos[0]:
				ans.append('R')
				pos[0] += 1
			elif l[goal][1] > pos[1]:
				ans.append('U')
				pos[1] += 1
			else:
				goal += 1
		print('YES')
		print(''.join(ans))


from sys import stdin, stdout

def main():
	t = int(input())
	for z in range(t):
		n = int(input())
		arr = []
		for i in range(n):
			(x, y) = map(int, input().split())
			arr.append((x, y))
		arr.sort()
		x = 0
		y = 0
		ans = ''
		sw = 1
		for i in arr:
			if i[0] >= x and i[1] >= y:
				for j in range(i[0] - x):
					ans += 'R'
				for j in range(i[1] - y):
					ans += 'U'
				x = i[0]
				y = i[1]
			else:
				sw = 0
				break
		if sw == 1:
			print('YES\n' + ans)
		else:
			print('NO')
main()


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	xC = defaultdict(list)
	for i in range(n):
		(x, y) = map(int, input().split())
		xC[x].append(y)
	reachedX = 0
	reachedY = 0
	path = ''
	itemsCovered = 0
	for x in sorted(xC.keys()):
		yC = sorted(xC[x])
		path += 'R' * (x - reachedX)
		reachedX = x
		for y in yC:
			if y >= reachedY:
				path += 'U' * (y - reachedY)
				reachedY = y
				itemsCovered += 1
	if itemsCovered == n:
		print('YES')
		print(path)
	else:
		print('NO')


t = int(input())
for ti in range(t):
	n = int(input())
	coords = []
	for ni in range(n):
		(xi, yi) = input().split()
		coords.append((int(xi), int(yi)))
	coords1 = sorted(coords, key=lambda x: (x[0], x[1]))
	coords2 = sorted(coords, key=lambda x: (x[1], x[0]))
	if coords1 != coords2:
		print('NO')
	else:
		print('YES')
		ans = ''
		x = 0
		y = 0
		for c in coords2:
			for j in range(c[0] - x):
				ans += 'R'
				x += 1
			for j in range(c[1] - y):
				ans += 'U'
				y += 1
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	d = []
	for j in range(n):
		d.append(list(map(int, input().split())))
	d.sort()
	(x, y) = (0, 0)
	h = 0
	s = ''
	f = 0
	for g in range(n):
		p = d[g][h] - x
		q = d[g][h + 1] - y
		if p < 0 or q < 0:
			f = 1
			break
		else:
			x += p
			y += q
			s += 'R' * p
			s += 'U' * q
	if f == 0:
		print('YES')
		print(s)
	else:
		print('NO')


for u in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(list(map(int, input().split())))
	l.sort()
	r = ''
	(x, y) = (0, 0)
	f = 0
	for i in range(n):
		if l[i][0] >= x and l[i][1] >= y:
			xx = l[i][0] - x
			r = r + 'R' * xx
			yy = l[i][1] - y
			r = r + 'U' * yy
			(x, y) = (l[i][0], l[i][1])
		else:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(r)


t = int(input())
for qqq in range(t):
	n = int(input())
	pt = [list(map(int, input().split())) for i in range(n)]
	first = list(set([pt[i][0] for i in range(n)]))
	first.sort()
	M = 0
	c = 0
	s = ''
	k = 0
	for i in first:
		s += 'R' * (i - k)
		k = i
		second = [pt[j][1] for j in range(n) if pt[j][0] == i]
		second.sort()
		if second[0] < M:
			print('NO')
			c = 0
			break
		else:
			s += 'U' * (second[-1] - M)
			M = second[-1]
			c += 1
	if c > 0:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	q = int(input())
	(x, y) = (0, 0)
	s = ''
	f = False
	a = []
	for i in range(q):
		(n, m) = map(int, input().split())
		a.append([n, m])
	a.sort()
	a.sort(key=lambda x: x[1])
	for (n, m) in a:
		if n - x >= 0 and m - y >= 0:
			s += 'R' * (n - x)
			s += 'U' * (m - y)
			(x, y) = (n, m)
		else:
			f = True
	if not f:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for i in range(t):
	b = int(input())
	arr1 = []
	for k in range(b):
		l = tuple(map(int, input().split()))
		arr1.append(l)
	arr = sorted(arr1)
	x = 0
	y = 0
	res = []
	check = 0
	for k in range(b):
		d1 = arr[k][0]
		d2 = arr[k][1]
		v1 = d1 - x
		v2 = d2 - y
		if v1 < 0 or v2 < 0:
			check = 1
			print('NO')
			break
		for y in range(v1):
			res.append('R')
		for y in range(v2):
			res.append('U')
		x = d1
		y = d2
	if check == 0:
		res1 = ''.join(res)
		print('YES')
		print(res1)


import sys
input = sys.stdin.readline

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

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

def collecting_packages(n, coords):
	coords = sorted(coords, key=lambda k: [k[0], k[1]])
	path = ''
	cur = (0, 0)
	for i in range(0, n):
		x_steps = coords[i][0] - cur[0]
		y_steps = coords[i][1] - cur[1]
		if x_steps < 0 or y_steps < 0:
			print('NO')
			return
		if x_steps > 0:
			path += 'R' * x_steps
		if y_steps > 0:
			path += 'U' * y_steps
		cur = (coords[i][0], coords[i][1])
	print('YES')
	print(path)
	return
t = inp()
n_list = []
coords_list = []
for i in range(0, t):
	n = inp()
	n_list.append(n)
	coords = []
	for j in range(0, n):
		coords.append(inlt())
	coords_list.append(coords)
for i in range(0, t):
	collecting_packages(n_list[i], coords_list[i])


t = int(input())
for q in range(t):
	n = int(input())
	a = [list(map(int, input().split())) for i in range(n)]
	a.sort()
	ans = ''
	(x, y) = (0, 0)
	f = 0
	for i in range(n):
		if a[i][0] >= x and a[i][1] >= y:
			ans += 'R' * (a[i][0] - x)
			x = a[i][0]
			ans += 'U' * (a[i][1] - y)
			y = a[i][1]
		else:
			f = 1
			print('NO')
			break
	if f == 0:
		print('YES')
		print(ans)


n = int(input())
for i in range(n):
	m = int(input())
	pos = [list(map(int, input().split())) for j in range(m)]
	pos.sort(key=lambda x: x[1])
	pos.sort(key=lambda x: x[0])
	now = [0, 0]
	flag = True
	ans = ''
	for (x, y) in pos:
		(x0, y0) = now
		if x0 <= x and y0 <= y:
			now = [x, y]
			ans += 'R' * (x - x0) + 'U' * (y - y0)
		else:
			flag = False
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = map(int, input().split(' '))
		l.append([x, y])
	l.append([0, 0])
	l.sort()
	if len(l) == 2:
		print('YES')
		r = l[1][0] - 0
		t = l[1][1] - 0
		y = 'R' * r + 'U' * t
		print(y)
	else:
		p = []
		count = 0
		for i in range(1, len(l)):
			if l[i][0] < l[i - 1][0] or l[i][1] < l[i - 1][1]:
				count += 1
		if count != 0:
			print('NO')
		else:
			for i in range(1, n + 1):
				r = l[i][0] - l[i - 1][0]
				t = l[i][1] - l[i - 1][1]
				y = 'R' * r + 'U' * t
				p.append(y)
			print('YES')
			print(''.join(p))


def solve():
	n = int(input())
	l = 1001
	(y_min, y_max) = ([1001] * l, [-1] * l)
	x_max = -1
	for i in range(n):
		(x, y) = map(int, input().split())
		y_min[x] = min(y_min[x], y)
		y_max[x] = max(y_max[x], y)
		x_max = max(x_max, x)
	steps = ''
	y_current = 0
	sol = True
	for i in range(x_max + 1):
		if y_max[i] != -1:
			if y_min[i] < y_current:
				sol = False
				break
			steps += 'U' * (y_max[i] - y_current)
			y_current = y_max[i]
		steps += 'R'
	if sol:
		print('YES')
		print(steps[:-1])
	else:
		print('NO')

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


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(x, y) = map(int, input().split())
		arr.append((x, y))
	arr.sort()
	st = ''
	x = 0
	y = 0
	flag = True
	for i in range(n):
		x1 = arr[i][0] - x
		y1 = arr[i][1] - y
		if x1 < 0 or y1 < 0:
			flag = False
			break
		for j in range(x1):
			st += 'R'
		for j in range(y1):
			st += 'U'
		(x, y) = (x + x1, y + y1)
	if flag == False:
		print('NO')
	else:
		print('YES')
		print(st)


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
import itertools

def Int():
	return int(sys.stdin.readline())

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

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

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

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def solution():
	for i in range(Int()):
		n = Int()
		l = [[0, 0]]
		for i in range(n):
			(x, y) = Mint()
			l.append([x, y])
		l.sort()
		ans = ''
		p = 0
		for i in range(1, n + 1):
			if l[i - 1][0] <= l[i][0] and l[i - 1][1] <= l[i][1]:
				ans += 'R' * (l[i][0] - l[i - 1][0])
				ans += 'U' * (l[i][1] - l[i - 1][1])
			else:
				p = 1
				break
		if p == 1:
			print('NO')
		else:
			print('YES')
			print(ans)
solution()


t = int(input())
ans_sum = []
for i in range(t):
	n = int(input())
	data = []
	for j in range(n):
		data.append(list(map(int, input().split())))
	data.sort()
	preY = 0
	preX = 0
	ans = []
	flag = False
	for j in range(n):
		ans += ['R'] * (data[j][0] - preX)
		preX = data[j][0]
		if preY > data[j][1]:
			print('NO')
			flag = True
			break
		ans += ['U'] * (data[j][1] - preY)
		preY = data[j][1]
	if not flag:
		print('YES')
		print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	x = []
	y = []
	for i in range(n):
		(xt, yt) = map(int, input().split())
		x.append(xt)
		y.append(yt)
	posx = 0
	posy = 0
	seq = []
	pos = []
	for i in range(n):
		if len(seq) == 0:
			seq.append(x[i] + y[i])
			pos.append([x[i], y[i]])
		else:
			f = 0
			for j in range(len(seq)):
				if seq[j] > x[i] + y[i]:
					seq.insert(j, x[i] + y[i])
					pos.insert(j, [x[i], y[i]])
					f = 1
					break
			if f == 0:
				if seq[j] <= x[i] + y[i]:
					seq.append(x[i] + y[i])
					pos.append([x[i], y[i]])
	posx = 0
	poy = 0
	ans = ''
	f1 = 1
	for i in pos:
		if i[0] - posx >= 0 and i[1] - poy >= 0:
			ans += 'R' * (i[0] - posx) + 'U' * (i[1] - poy)
			posx = i[0]
			poy = i[1]
		else:
			f1 = 0
			break
	if f1 == 0:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
while t:
	n = int(input())
	d = {}
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		if d.get(x, -1) == -1:
			d[x] = []
		d[x].append(y)
		l.append(x)
	l = list(set(l))
	l.sort()
	n1 = len(l)
	s = ''
	up = 0
	r = 0
	ch = {}
	for i in range(n1):
		d[l[i]].sort()
		for i1 in range(r, l[i]):
			s += 'R'
			r += 1
		ch[r] = []
		for i2 in range(len(d[l[i]])):
			for j in range(up, d[l[i]][i2]):
				s += 'U'
				up += 1
			ch[l[i]].append(up)
	c = 0
	for i in range(n1):
		for i1 in range(len(d[l[i]])):
			if d[l[i]][i1] != ch[l[i]][i1]:
				c = 1
				break
		if c == 1:
			break
	if c == 0:
		print('YES')
		print(s)
	else:
		print('NO')
	t -= 1


def srt(t: tuple):
	return t[0]

def srt2(t2: tuple):
	return t2[1]
for _ in range(int(input())):
	n = int(input())
	lstx = []
	lsty = []
	lst = []
	for _ in range(n):
		lst.append(tuple(map(int, input().split())))
	lst.sort(key=srt)
	lst.sort(key=srt2)
	str = ''
	x = lst[0][0]
	y = lst[0][1]
	str = 'R' * x + 'U' * y
	for i in range(1, n):
		xi = lst[i][0]
		yi = lst[i][1]
		if x <= xi and y <= yi:
			if x == xi:
				str = str + 'U' * (yi - y)
			elif y == yi:
				str = str + 'R' * (xi - x)
			else:
				str = str + 'R' * (xi - x) + 'U' * (yi - y)
		else:
			print('NO')
			break
		x = xi
		y = yi
	else:
		print('YES', str, sep='\n')


for _ in range(int(input())):
	s = ''
	i = j = 0
	for (x, y) in sorted((tuple(map(int, input().split())) for _ in range(int(input())))):
		if y < j:
			print('NO')
			break
		s += 'R' * (x - i) + 'U' * (y - j)
		(i, j) = (x, y)
	else:
		print('YES', s, sep='\n')


for _ in range(int(input())):
	n = int(input())
	prsnts = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		if prsnts.get(x) == None:
			prsnts[x] = [y]
		else:
			prsnts[x].append(y)
	ans = ''
	f = True
	(x, y) = (0, 0)
	miny = -1
	for i in sorted(list(prsnts.keys())):
		ans += 'R' * (i - x)
		x = i
		if miny > min(prsnts[i]):
			f = False
			break
		mx = max(prsnts[i])
		ans += 'U' * (mx - y)
		y = mx
		miny = mx
	if f:
		print('YES')
		print(ans)
	else:
		print('NO')


from bisect import *

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		s = ''
		q = []
		for i in range(n):
			(a, b) = map(int, input().split())
			insort(q, [a, b])
		(x, y) = (0, 0)
		f = 1
		for i in range(n):
			(a, b) = (q[i][0], q[i][1])
			(distx, disty) = (a - x, b - y)
			if distx >= 0 and disty >= 0:
				f = 1
			else:
				f = 0
				break
			s += 'R' * distx + 'U' * disty
			(x, y) = (a, b)
		if f:
			print(f'YES\n{s}')
		else:
			print('NO')
main()


def f(a, n):
	a.sort()
	ans = ''
	c = 0
	x = 0
	y = 0
	no = 0
	for i in range(n):
		if a[i][0] >= x and a[i][1] >= y:
			ans += 'R' * (a[i][0] - x)
			ans += 'U' * (a[i][1] - y)
			c += 1
			x = a[i][0]
			y = a[i][1]
		else:
			no = 1
			break
	if no == 1:
		print('NO')
	else:
		print('YES')
		print(ans)
t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		xy = list(map(int, input().split()))
		a.append(xy)
	f(a, n)


from sys import stdin, stdout
import sys
INF = 1000000000.0
import bisect

def get_int():
	return int(stdin.readline().strip())

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

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

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
for _ in range(int(stdin.readline())):
	n = get_int()
	ans = ''
	(x, y) = (0, 0)
	f = 0
	ar = []
	for i in range(n):
		ar.append(tuple(get_ints()))
	ar.sort()
	for j in range(n):
		(a, b) = (ar[j][0], ar[j][1])
		if a >= x:
			for i in range(a - x):
				ans += 'R'
			x = a
		if b >= y:
			for i in range(b - y):
				ans += 'U'
			y = b
		else:
			f = 1
	if f == 1:
		print('NO')
		continue
	print('YES')
	print(ans)


def input2():
	a = [[0, 0]]
	for i in range(int(input())):
		(x, y) = map(int, input().split())
		a.append([x, y])
	return sorted(a, key=lambda x: x[0] + x[1])

def kkk(a):
	for i in range(1, len(a)):
		if a[i][0] + a[i][1] == a[i - 1][0] + a[i - 1][1] or a[i][0] < a[i - 1][0] or a[i][1] < a[i - 1][1]:
			return False
	return True

def ans(a):
	s = ''
	for i in range(1, len(a)):
		s = s + 'R' * (a[i][0] - a[i - 1][0]) + 'U' * (a[i][1] - a[i - 1][1])
	return s
for i in range(int(input())):
	a = input2()
	if kkk(a):
		print('YES')
		print(ans(a))
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	a.sort(key=lambda x: (x[0], x[1]))
	i = 1
	s = 'R' * a[0][0] + 'U' * a[0][1]
	x = a[0][0]
	y = a[0][1]
	flag = True
	while i < n:
		if a[i][0] - x >= 0 and a[i][1] - y >= 0:
			s = s + 'R' * (a[i][0] - x) + 'U' * (a[i][1] - y)
			x = a[i][0]
			y = a[i][1]
			i += 1
		else:
			flag = False
			break
	if flag == True:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	q = []
	n = int(input())
	for i in range(n):
		q.append(list(map(int, input().split())))
	q.sort()
	f = 0
	for i in range(n - 1):
		if q[i][1] > q[i + 1][1]:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		print('YES')
		s = 'R' * q[0][0] + 'U' * q[0][1]
		for i in range(1, n):
			s = s + 'R' * (q[i][0] - q[i - 1][0]) + 'U' * (q[i][1] - q[i - 1][1])
		print(s)


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	for j in range(n):
		a.append(0)
	for j in range(n):
		(kk, kj) = map(int, input().split())
		a[j] = (kk, kj)
	a.sort()
	s = ''
	x = 0
	y = 0
	f = 0
	for j in range(n):
		s = s + (a[j][0] - x) * 'R'
		if a[j][1] < y:
			if a[j][0] != x:
				print('NO')
				f = 1
				break
		else:
			s = s + (a[j][1] - y) * 'U'
			y = a[j][1]
		x = a[j][0]
	if f == 0:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = [tuple(map(int, input().split())) for i in range(n)]
	l.sort(key=lambda x: x[0] + x[1])
	count = 0
	r = 0
	u = 0
	ans = ''
	for i in range(len(l)):
		x = l[i][0] - r
		y = l[i][1] - u
		if x >= 0 and y >= 0:
			r = r + x
			u = u + y
			ans = ans + x * 'R' + y * 'U'
			count += 1
		else:
			break
	if count == n:
		print('YES')
		print(ans)
	else:
		print('NO')


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	x = 0
	y = 0
	l = []
	for i in range(n):
		(xi, yi) = map(int, input().split())
		l.append((xi, yi))
	l.sort(key=lambda x: x[0])
	ok = True
	visited = dict()
	visited = defaultdict(lambda : False, visited)
	for i in range(n):
		if visited[l[i][0], l[i][1]]:
			continue
		if l[i][0] < x:
			ok = False
			break
		elif l[i][1] - y < 0:
			ok = False
			break
		else:
			j = l[i][0]
			while j - x > 0:
				visited[j, y] = True
				j -= 1
			j = l[i][1]
			x = l[i][0]
			while j - y > 0:
				visited[x, j] = True
				j -= 1
			y = l[i][1]
	if not ok:
		print('NO')
	else:
		x = 0
		y = 0
		print('YES')
		while visited[x + 1, y] or visited[x, y + 1]:
			if visited[x + 1, y]:
				print('R', end='')
				x += 1
			elif visited[x, y + 1]:
				print('U', end='')
				y += 1
		print()


def solve(points):
	points = sorted(points, key=lambda item: (item[0], item[1]))
	x = 0
	y = 0
	path = ''
	for p in points:
		if x <= p[0]:
			d = p[0] - x
			x += 1 * d
			path += 'R' * d
		else:
			return ['NO']
		if y <= p[1]:
			d = p[1] - y
			y += 1 * d
			path += 'U' * d
		else:
			return ['NO']
	return ['YES', path]
t = int(input())
for _ in range(t):
	n = int(input())
	points = []
	for _ in range(n):
		points.append([int(x) for x in input().split()])
	res = solve(points)
	print(res[0])
	if res[0] == 'YES':
		print(res[1])


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		a.append(list(map(int, input().split())))
	a = sorted(a)
	x = 0
	y = 0
	ans = []
	bad = False
	for c in a:
		while x < c[0]:
			x += 1
			ans.append('R')
		while y < c[1]:
			y += 1
			ans.append('U')
		if x > c[0] or y > c[1]:
			bad = True
	if bad:
		print('NO')
	else:
		print('YES')
		print(''.join(ans))


t = int(input())
for test in range(t):
	n = int(input())
	xy = list()
	for i in range(n):
		coor = input()
		(x, y) = coor.split()
		xy.append((int(x), int(y)))
	xy.sort()
	f = 1
	for i in range(n - 1):
		if xy[i][0] <= xy[i + 1][0] and xy[i][1] <= xy[i + 1][1]:
			continue
		print('NO')
		f = 0
		break
	if f == 0:
		continue
	print('YES')
	for h in range(xy[0][0]):
		print('R', end='')
	for h in range(xy[0][1]):
		print('U', end='')
	for i in range(n - 1):
		for h in range(xy[i + 1][0] - xy[i][0]):
			print('R', end='')
		for h in range(xy[i + 1][1] - xy[i][1]):
			print('U', end='')
	print('')


t = int(input())
for q in range(t):
	n = int(input())
	greedy = []
	for i in range(n):
		greedy.append([int(j) for j in input().split()])
	greedy.sort()
	prevR = 0
	prevU = 0
	ans = ''
	bolAns = True
	for i in range(n):
		if greedy[i][0] < prevR:
			bolAns = False
			break
		if greedy[i][1] < prevU:
			bolAns = False
			break
		ans += 'R' * (greedy[i][0] - prevR)
		prevR = prevR + (greedy[i][0] - prevR)
		ans += 'U' * (greedy[i][1] - prevU)
		prevU = prevU + (greedy[i][1] - prevU)
	if not bolAns:
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	N = int(input())
	A = []
	p = 0
	q = 0
	flag = 0
	for i in range(N):
		(x, y) = map(int, input().split())
		X = []
		Y = []
		A.append((x, y))
	A.sort()
	str1 = ''
	for i in range(len(A)):
		if A[i][1] >= q:
			str1 += (A[i][0] - p) * 'R'
			str1 += (A[i][1] - q) * 'U'
			p = A[i][0]
			q = A[i][1]
		else:
			flag = 1
	if flag == 0:
		print('YES')
		print(str1)
	else:
		print('NO')


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	xy = [tuple(map(int, input().split())) for _ in range(n)]
	xy.sort(key=lambda k: (k[0], k[1]))
	flag = False
	for i in range(n - 1):
		(xi, yi) = xy[i]
		(xj, yj) = xy[i + 1]
		if xi < xj and yi > yj:
			print('NO')
			flag = True
			break
	if flag:
		continue
	ans = []
	(xs, ys) = (0, 0)
	for i in range(n):
		(xg, yg) = xy[i]
		ans.append('R' * (xg - xs))
		ans.append('U' * (yg - ys))
		(xs, ys) = (xg, yg)
	print('YES')
	print(''.join(ans))


from sys import stdin
r = stdin.readline

def main():
	cases = int(r())
	for case in range(cases):
		n = int(r())
		points = []
		for i in range(n):
			points.append(tuple(map(int, r().strip().split())))
		points.sort()
		path = str()
		(curr, poss) = ((0, 0), True)
		for i in range(n - 1):
			if points[i][0] > points[i + 1][0]:
				poss = False
				break
			if points[i][1] > points[i + 1][1]:
				poss = False
				break
		if not poss:
			print('NO')
		else:
			for (x, y) in points:
				path += (x - curr[0]) * 'R'
				path += (y - curr[1]) * 'U'
				curr = (x, y)
			print('YES')
			print(path)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for _ in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	st = ''
	(px, py) = (0, 0)
	flag = 1
	cnt = 0
	for i in l:
		nx = i[0] - px
		ny = i[1] - py
		if nx < 0 or ny < 0:
			print('NO')
			flag = 0
			break
		st = st + 'R' * nx + 'U' * ny
		px = i[0]
		py = i[1]
		cnt += 1
	if flag == 0:
		continue
	if cnt == n:
		print('YES')
		print(st)
	else:
		print('NO')


import math

def robo(A, n):
	for i in range(n):
		d = math.sqrt(A[i][0] ** 2 + A[i][1] ** 2)
		A[i].append(d)
	A.sort(key=lambda x: x[2])
	s = ''
	x = 0
	y = 0
	for i in range(n):
		a = A[i][0]
		b = A[i][1]
		r = a - x
		u = b - y
		if r < 0 or u < 0:
			return 'NO'
		else:
			s += 'R' * r
			s += 'U' * u
			x = a
			y = b
	return ['YES', s]
t = int(input())
for i in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(a, b) = map(int, input().split())
		arr.append([a, b])
	if robo(arr, n) == 'NO':
		print('NO')
	else:
		k = robo(arr, n)
		print(k[0])
		print(k[1])


for _ in range(int(input())):
	(posx, posy) = (0, 0)
	path = ''
	dirs = []
	(tx, ty) = (0, 0)
	ok = True
	for i in range(int(input())):
		temp = list(map(int, input().split()))
		dirs.append(temp)
	dirs = sorted(dirs)
	for i in dirs:
		tx = i[0] - posx
		ty = i[1] - posy
		if tx < 0 or ty < 0:
			print('NO')
			ok = False
			break
		path += 'R' * tx
		path += 'U' * ty
		posx = i[0]
		posy = i[1]
	if ok:
		print('YES')
		print(path)


t = int(input())
for _ in range(t):
	a = []
	n = int(input())
	for i in range(n):
		a.append(list(map(int, input().split())))
	a.sort()
	x = 0
	y = 0
	breaking = 0
	for i in range(n - 1):
		if a[i][1] > a[i + 1][1]:
			breaking = 1
			break
	if breaking == 0:
		print('YES')
		for i in range(n):
			ans = a[i][0] - x
			for j in range(ans):
				print('R', end='')
			x = a[i][0]
			ans2 = a[i][1] - y
			for j in range(ans2):
				print('U', end='')
			y = a[i][1]
		print()
	if breaking == 1:
		print('NO')


import sys
import heapq
import math
from collections import deque
from collections import defaultdict
from collections import Counter
modH = int(10 ** 9) + 7
I = lambda : list(map(int, input().split(' ')))

def PRINT(lst, sep=' '):
	print(sep.join(map(str, lst)))
for _ in range(int(input())):
	n = int(input())
	ll = [I() for i in range(n)]
	ll.sort()
	flag = 1
	for i in range(len(ll)):
		for j in range(i + 1, len(ll)):
			if ll[j][0] < ll[i][0] or ll[j][1] < ll[i][1]:
				flag = 0
				break
	if not flag:
		print('NO')
	else:
		print('YES')
		cur = (0, 0)
		ans = []
		for (xx, yy) in ll:
			ans.append((-cur[0] + xx) * 'R' + (-cur[1] + yy) * 'U')
			cur = (xx, yy)
		PRINT(ans, sep='')


from math import ceil, gcd, inf, sqrt
from bisect import bisect_left
from collections import Counter
mod = 1000000007

def pro(arr):
	arr.sort()
	n = len(arr)
	ans = ''
	(currx, curry) = (0, 0)
	for i in range(n):
		(x, y) = arr[i]
		if x - currx < 0:
			print('YES')
			return
		ans += 'R' * (x - currx)
		if y - curry < 0:
			print('NO')
			return
		ans += 'U' * (y - curry)
		(currx, curry) = (x, y)
	print('YES')
	print(ans)
t = int(input())
for i in range(t):
	n = int(input())
	arr = []
	for j in range(n):
		arr.append(list(map(int, input().split())))
	pro(arr)


t = int(input())
for i in range(t):
	n = int(input())
	ls = [list(map(int, input().split())) for i in range(n)]
	s = [i + j for (i, j) in ls]
	for i in range(n):
		ls[i].append(s[i])
	x = 0
	y = 0
	path = ''
	flag = True
	ls.sort(key=lambda x: x[2])
	for i in range(n):
		r = ls[i][0] - x
		u = ls[i][1] - y
		x = ls[i][0]
		y = ls[i][1]
		if r >= 0 and u >= 0:
			path += 'R' * r + 'U' * u
		else:
			flag = False
	if flag:
		print('YES')
		print(path)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list()
	for i in range(n):
		a.append(tuple(map(int, input().split())))
	a.sort()
	done = False
	for i in range(1, n):
		if not a[i][1] >= a[i - 1][1]:
			print('NO')
			done = True
			break
	if done:
		continue
	ans = 'R' * a[0][0] + 'U' * a[0][1]
	for i in range(1, n):
		r = a[i][0] - a[i - 1][0]
		u = a[i][1] - a[i - 1][1]
		ans += 'R' * r + 'U' * u
	print('YES')
	print(ans)


import sys
t = int(sys.stdin.readline())
for _t in range(t):
	n = int(sys.stdin.readline())
	points = []
	for i in range(n):
		point = [int(e) for e in sys.stdin.readline().split()]
		points.append(tuple(point))
	points.sort()
	previousX = 0
	previousY = 0
	doable = True
	path = ''
	for point in points:
		if point[1] < previousY:
			doable = False
			break
		path += (point[0] - previousX) * 'R'
		path += (point[1] - previousY) * 'U'
		previousX = point[0]
		previousY = point[1]
	if doable:
		print('YES')
		print(path)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = [[0, 0]]
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append([x, y])
	l.sort()
	p = 'YES'
	ans = ''
	for i in range(n):
		x = l[i + 1][0] - l[i][0]
		y = l[i + 1][1] - l[i][1]
		if x < 0 or y < 0:
			p = 'NO'
			break
		ans += 'R' * x + 'U' * y
	print(p)
	if p == 'YES':
		print(ans)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		sl = [int(i) for i in input().split()]
		l.append(sl)
	l.sort()
	s = ''
	c = [0, 0]
	flag = 0
	for i in range(n):
		if l[i][0] >= c[0] and l[i][1] >= c[1]:
			for k in range(l[i][0] - c[0]):
				s += 'R'
			for j in range(l[i][1] - c[1]):
				s += 'U'
			c[0] = l[i][0]
			c[1] = l[i][1]
		else:
			flag = 1
			print('NO')
			break
	if flag == 0:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		l.append([x, y])
	s = ''
	l.sort()
	(i, x, y) = (0, 0, 0)
	while i < n:
		if l[i][0] < x or l[i][1] < y:
			break
		elif l[i][0] == x:
			s += 'U'
			y += 1
		else:
			s += 'R'
			x += 1
		if l[i][0] == x and l[i][1] == y:
			i += 1
	if i < n:
		print('NO')
	else:
		print('YES', s, sep='\n')


for _ in range(int(input())):
	ps = []
	for _ in range(int(input())):
		ps.append(list(map(int, input().split())))
	ps.sort()
	tp = [0, 0]
	mov = ''
	for pair in ps:
		if pair[1] < tp[1]:
			mov = ''
			break
		else:
			mov += 'R' * (pair[0] - tp[0])
			mov += 'U' * (pair[1] - tp[1])
			tp = pair
	if mov == '':
		print('NO')
	else:
		print('YES', mov, sep='\n')


t = int(input())
for _ in range(t):
	n = int(input())
	packs = []
	for _ in range(n):
		packs.append(tuple(map(int, input().split(' '))))
	s = sorted(packs)
	moves = ''
	pos = (0, 0)
	while len(s) != 0:
		diff = [a - b for (a, b) in zip(s[0], pos)]
		if diff[0] < 0 or diff[1] < 0:
			pos = None
			break
		moves += diff[0] * 'R' + diff[1] * 'U'
		pos = s[0]
		s = s[1:]
	if pos:
		print('YES')
		print(moves)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for z in range(n):
		(x, y) = map(int, input().split())
		l.append((x, y))
	a = sorted(l, key=lambda x: (x[0], x[1]))
	p = q = f = 0
	s = ''
	for i in range(n):
		if a[i][0] >= p and a[i][1] >= q:
			s += 'R' * (a[i][0] - p) + 'U' * (a[i][1] - q)
			p = a[i][0]
			q = a[i][1]
		else:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(s)


import sys
t = int(sys.stdin.readline().rstrip())
for _ in range(t):
	n = int(sys.stdin.readline().rstrip())
	pa = []
	for i in range(n):
		(x, y) = list(map(int, sys.stdin.readline().rstrip().split(' ')))
		pa.append((x, y))
	pa.sort()
	x = 0
	y = 0
	s = ''
	for (a, b) in pa:
		if a - x >= 0 and b - y >= 0:
			s += 'R' * (a - x)
			s += 'U' * (b - y)
			x = a
			y = b
		else:
			print('NO')
			break
	else:
		print('YES')
		print(s)


for q in range(int(input())):
	n = int(input())
	d = [tuple([int(j) for j in input().split()]) for i in range(n)]
	d.sort()
	bad = False
	for i in range(n - 1):
		if d[i][0] > d[i + 1][0] or d[i][1] > d[i + 1][1]:
			bad = True
			break
	if bad:
		print('NO')
	else:
		print('YES')
		(x, y) = (0, 0)
		for i in range(n):
			if d[i][0] > x:
				print('R' * (d[i][0] - x), end='')
				x = d[i][0]
			if d[i][1] > y:
				print('U' * (d[i][1] - y), end='')
				y = d[i][1]
		print()


import sys
reader = (line.rstrip() for line in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	n = int(input())
	pack = []
	for i in range(n):
		(xi, yi) = list(map(int, input().split()))
		pack.append((xi, yi))
	pack.sort()
	(x_prev, y_prev) = (0, 0)
	ans = []
	for (x, y) in pack:
		if y < y_prev:
			print('NO')
			break
		ans.append('R' * (x - x_prev) + 'U' * (y - y_prev))
		(x_prev, y_prev) = (x, y)
	else:
		print('YES')
		print(''.join(ans))


def sortSecond(val):
	return val[1]

def sortFirst(val):
	return val[0]
t = int(input())
for q in range(t):
	n = int(input())
	l = []
	for i in range(n):
		s = input().split()
		l.append(s)
		l[i][0] = int(l[i][0])
		l[i][1] = int(l[i][1])
	l.sort(key=sortSecond)
	l.sort(key=sortFirst)
	s = []
	for i in range(l[0][0]):
		s.append('R')
	for i in range(l[0][1]):
		s.append('U')
	flag = 0
	for i in range(n - 1):
		if l[i + 1][0] < l[i][0] or l[i + 1][1] < l[i][1]:
			print('NO')
			flag = 1
			break
		else:
			for j in range(l[i + 1][0] - l[i][0]):
				s.append('R')
			for j in range(l[i + 1][1] - l[i][1]):
				s.append('U')
	if flag == 0:
		print('YES')
		for i in range(len(s)):
			print(s[i], end='')
		print()


t = int(input())
for _ in range(t):
	n = int(input())
	dic = {}
	l = []
	string = ''
	flag = False
	(min_x, min_y) = (0, 0)
	for k in range(n):
		(x, y) = map(int, input().split())
		if x + y in dic:
			flag = True
		else:
			dic[x + y] = (x, y)
			l.append(x + y)
	if flag == True:
		print('NO')
	else:
		l.sort()
		(last_x, last_y) = (0, 0)
		for i in l:
			if dic[i][0] >= last_x and dic[i][1] >= last_y:
				string = string + 'R' * (dic[i][0] - last_x) + 'U' * (dic[i][1] - last_y)
				last_x = dic[i][0]
				last_y = dic[i][1]
			else:
				flag = True
				break
		if flag == True:
			print('NO')
		else:
			print('YES')
			print(string)


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for j in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	f = 0
	c = l[0][0] * 'R' + l[0][1] * 'U'
	for i in range(n - 1):
		if l[i][1] > l[i + 1][1]:
			f = 1
			break
		else:
			c = c + (l[i + 1][0] - l[i][0]) * 'R' + (l[i + 1][1] - l[i][1]) * 'U'
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(c)


from collections import deque
import sys

def inp():
	return sys.stdin.readline().strip()
for _ in range(int(inp())):
	n = int(inp())
	coin = []
	for i in range(n):
		(xi, yi) = map(int, inp().split())
		coin.append((xi, yi))
	coin.sort()
	f = True
	mx = 0
	x = 0
	ans = ''
	for i in range(n):
		if mx > coin[i][1]:
			f = False
			break
		ans += 'R' * (coin[i][0] - x) + 'U' * (coin[i][1] - mx)
		mx = coin[i][1]
		x = coin[i][0]
	if f:
		print('YES')
		print(ans)
	else:
		print('NO')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
import datetime, math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(int(input())):
		n = int(input())
		(p, q) = (0, 0)
		coordinates = []
		for i in range(n):
			inp = [int(x) for x in input().split()]
			coordinates.append(inp)
		coordinates = sorted(coordinates, key=lambda x: (x[0], x[1]))
		ans = 'YES'
		path = ''
		for i in coordinates:
			(x, y) = (i[0], i[1])
			if i[0] >= p and i[1] >= q:
				z = (i[0] - p) * 'R' + (i[1] - q) * 'U'
				path += z
				p = i[0]
				q = i[1]
			else:
				ans = 'NO'
				break
		print(ans)
		if ans == 'YES':
			print(path)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	packages = int(input())
	storing_array = [[0, 0]]
	for i in range(packages):
		coordinate = list(map(int, input().split()))
		storing_array.append(coordinate)
	storing_array.sort()
	case = True
	l = ''
	for j in range(len(storing_array) - 1):
		x = storing_array[j + 1][0] - storing_array[j][0]
		y = storing_array[j + 1][1] - storing_array[j][1]
		if x < 0 or y < 0:
			print('NO')
			case = False
			break
		else:
			l += 'R' * x + 'U' * y
	if case:
		print('YES')
		print(l)


for i in range(int(input())):
	n = int(input())
	a = []
	for j in range(n):
		a.append([int(k) for k in input().split()])
	a.sort()
	(curx, cury) = (0, 0)
	s = ''
	for j in a:
		if j[0] < curx or j[1] < cury:
			print('NO')
			break
		s = s + (j[0] - curx) * 'R' + (j[1] - cury) * 'U'
		(curx, cury) = j
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(0, t):
	u = 0
	s = ''
	x = []
	k = int(input())
	for j in range(0, k):
		x.append(list(map(int, input().split())))
	x = sorted(x, key=lambda ll: ll[0] + ll[1])
	x = sorted(x, key=lambda ll: ll[0])
	for p in range(0, x[0][0]):
		s += 'R'
	for p in range(0, x[0][1]):
		s += 'U'
	for j in range(0, k - 1):
		if x[j][1] > x[j + 1][1]:
			print('NO')
			u = 1
			break
		else:
			for p in range(0, x[j + 1][0] - x[j][0]):
				s += 'R'
			for p in range(0, x[j + 1][1] - x[j][1]):
				s += 'U'
	if u == 0:
		print('YES')
		print(s)


n = int(input())
for _ in range(n):
	m = int(input())
	dots = []
	for __ in range(m):
		(x, y) = map(int, input().strip().split())
		dots.append([x, y])
	sorted_dots = sorted(dots, key=lambda x: x[1])
	sorted_dots = sorted(sorted_dots, key=lambda x: x[0])
	xx = yy = 0
	ans = ''
	for dot in sorted_dots:
		if dot[0] > xx:
			ans += 'R' * (dot[0] - xx)
			xx = dot[0]
		if dot[1] > yy:
			ans += 'U' * (dot[1] - yy)
			yy = dot[1]
		if dot[1] < yy:
			ans = 'NO'
			break
	if ans != 'NO':
		print('YES')
	print(ans)


def rint():
	return int(input())

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

def case():
	n = rint()
	p = sorted((tuple(rints()) for _ in range(n)))
	maxy = 0
	for (x, y) in p:
		if y < maxy:
			print('NO')
			return
		maxy = y
	(cx, cy) = (0, 0)
	s = ''
	for (x, y) in p:
		while cx < x:
			s += 'R'
			cx += 1
		while cy < y:
			s += 'U'
			cy += 1
	print('YES')
	print(s)
t = rint()
for _ in range(t):
	case()


t = int(input())
for i in range(t):
	n = int(input())
	cood1 = []
	for j in range(n):
		(x, y) = map(int, input().split())
		cood1.append([x, y])
	cood1.sort()
	miny = cood1[0][1]
	t = 0
	for k in cood1:
		if k[1] < miny:
			print('NO')
			t = 1
			break
		elif k[1] > miny:
			miny = k[1]
	if not t:
		res = ''
		xod = 0
		yod = 0
		for m in cood1:
			res += 'R' * (m[0] - xod)
			xod = m[0]
			res += 'U' * (m[1] - yod)
			yod = m[1]
		print('YES')
		print(res)


def find_path(coordinate):
	path = ''
	sorted_coordinate = sorted(coordinate, key=lambda coordinate: (coordinate[0], coordinate[1]))
	prev_coordinate = (0, 0)
	for curr_coordinate in sorted_coordinate:
		if curr_coordinate[1] < prev_coordinate[1]:
			return 'NO'
		right_path = 'R' * (curr_coordinate[0] - prev_coordinate[0])
		top_path = 'U' * (curr_coordinate[1] - prev_coordinate[1])
		path += right_path + top_path
		prev_coordinate = curr_coordinate
	return 'YES' + '\n' + path
all_coordinate = []
for _ in range(int(input())):
	coordinate = []
	for _ in range(int(input())):
		pair = [int(s) for s in input().split()]
		coordinate.append(pair)
	all_coordinate.append(coordinate)
for c in all_coordinate:
	print(find_path(c))


a = int(input())
for i in range(a):
	t = int(input())
	ans = []
	for i in range(t):
		(a, b) = map(int, input().split())
		ans.append([a, b])
	ra = ans.copy()
	ans.sort(key=lambda x: (x[1], x[0]))
	ra.sort(key=lambda x: (x[0], x[1]))
	flag = 0
	for i in range(len(ans)):
		if ans[i][0] != ra[i][0] or ans[i][1] != ra[i][1]:
			flag = 1
			break
	if flag == 1:
		print('NO')
		continue
	else:
		bufr = 0
		bufu = 0
		kap = ''
		for i in range(len(ans)):
			if ans[i][0] != bufr:
				for j in range(ans[i][0] - bufr):
					kap = kap + 'R'
					bufr = bufr + 1
			if ans[i][1] != bufu:
				for t in range(ans[i][1] - bufu):
					kap = kap + 'U'
					bufu = bufu + 1
		print('YES')
		print(kap)


for _ in range(int(input())):
	n = int(input())
	pp = 0
	l = [[] for i in range(1000 + 1)]
	for _ in range(n):
		(u, v) = map(int, input().split())
		pp = max(pp, u)
		l[u].append(v)
	for j in range(pp + 1):
		l[j].sort()
	d = []
	for j in l:
		for m in j:
			d.append(m)
	if d == sorted(d):
		print('YES')
		d = []
		ans = 0
		for i in range(pp + 1):
			k = len(l[i])
			if k > 0:
				d.append('U' * (l[i][-1] - ans))
				ans = l[i][-1]
			d.append('R')
		d.pop()
		print(''.join(d))
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = list(map(int, input().split()))
		l.append([a, b])
	l.sort()
	x = 0
	y = 0
	flag = 0
	t = ''
	for i in l:
		if i[0] == x:
			if i[1] > y:
				t += 'U' * (i[1] - y)
				y = i[1]
			else:
				flag = 1
				break
		elif i[1] == y:
			if i[0] > x:
				t += 'R' * (i[0] - x)
				x = i[0]
			else:
				flag = 1
				break
		elif i[0] > x and i[1] > y:
			t += 'R' * (i[0] - x)
			t += 'U' * (i[1] - y)
			x = i[0]
			y = i[1]
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(t)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	(a, out, flag) = ([], [], 0)
	for __ in range(n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	a.sort()
	st = ''
	(cx, cy) = (0, 0)
	for (i, j) in a:
		if cx > i:
			flag = 1
			break
		else:
			st += 'R' * (i - cx)
			cx = i
		if cy > j:
			flag = 1
			break
		else:
			st += 'U' * (j - cy)
			cy = j
	if flag == 0:
		print('YES')
		print(st)
	else:
		print('NO')


t = int(input())
for qwe in range(t):
	n = int(input())
	listt = []
	for i in range(n):
		temp = tuple(map(int, input().split()))
		listt.append(temp)

	def key1(a):
		return (a[0], a[1])
	listt.sort(key=key1)
	(x, y) = (0, 0)
	ans = ''
	flag = True
	for i in range(n):
		(xn, yn) = (listt[i][0], listt[i][1])
		if xn - x < 0 or yn - y < 0:
			print('NO')
			flag = False
			break
		ans += 'R' * (xn - x) + 'U' * (yn - y)
		(x, y) = (xn, yn)
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for _ in range(n):
		a.append([int(x) for x in input().split()])
	a.sort()
	now = [0, 0]
	b = True
	s = ''
	for i in a:
		if i[1] < now[1]:
			b = False
			break
		else:
			s += 'R' * (i[0] - now[0]) + 'U' * (i[1] - now[1])
			now = i
	print(['NO', 'YES'][b])
	if b:
		print(s)


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

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

def get_int():
	return int(sys.stdin.readline())

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

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def myceil(x, y):
	return (x + y - 1) // y

def Solution(grid, n):
	package = 0
	grid = sorted(grid)
	path = []
	x = 0
	y = 0
	flag = True
	for cord in grid:
		xi = cord[0]
		yi = cord[1]
		if xi < x or yi < y:
			flag = False
			break
		for _ in range(xi - x):
			path.append('R')
		for _ in range(yi - y):
			path.append('U')
		package += 1
		(x, y) = (xi, yi)
	if flag and package == n:
		print('YES')
		print(''.join(path))
	else:
		print('NO')

def main():
	for _ in range(get_int()):
		n = get_int()
		grid = get_list_of_list(n)
		Solution(grid, n)
main()


t = int(input())
while t:
	t += -1
	n = int(input())
	l = []
	for i in range(n):
		temp = list(map(int, input().split()))
		l.append(temp)
	l.sort()
	ans = ''
	r = 0
	u = 0
	ch = 1
	for i in l:
		if i[0] < r or i[1] < u:
			ch = 0
			break
		if i[0] >= r:
			ans += 'R' * (i[0] - r)
			r = i[0]
		if i[1] >= u:
			ans += 'U' * (i[1] - u)
			u = i[1]
	if ch:
		print('YES')
		print(ans)
	else:
		print('NO')


rr = lambda : input().strip()
rri = lambda : int(rr())
rrm = lambda : [int(x) for x in rr().split()]

def sol():
	n = rri()
	lis = list()
	for i in range(n):
		(a, b) = rrm()
		lis.append((a, b))
	lis.sort()
	q = True
	(a, b) = (0, 0)
	res = ''
	for (x, y) in lis:
		if b > y:
			q = False
			print('NO')
			break
		res += 'R' * (x - a)
		res += 'U' * (y - b)
		(a, b) = (x, y)
	if q:
		print('YES')
		print(res)
t = rri()
for _ in range(t):
	ans = sol()


import math

def dist(x1, y1, x2, y2):
	return math.sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2))
t = int(input())
for i in range(t):
	n = int(input())
	q = []
	for j in range(n):
		xe = list(map(int, input().split()))
		q.append(xe)
	q.sort()
	liste = []
	start = [0, 0]
	flag = 0
	for j in range(n):
		x = q[j][0] - start[0]
		y = q[j][1] - start[1]
		if x >= 0 and y >= 0:
			liste.append(x * 'R' + y * 'U')
			start = [q[j][0], q[j][1]]
		else:
			print('NO')
			flag = 1
			break
	if flag == 0:
		print('YES')
		print(''.join(liste))


for i in range(int(input())):
	flag = 0
	arr = []
	for j in range(int(input())):
		(x, y) = map(int, input().split())
		arr.append([x, y])
	arr.sort()
	(X, Y) = (0, 0)
	path = ''
	for k in arr:
		if k[0] < X or k[1] < Y:
			flag = 1
			break
		path += 'R' * (k[0] - X)
		path += 'U' * (k[1] - Y)
		(X, Y) = k
	if flag:
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
while t:
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = input().split()
		x = int(x)
		y = int(y)
		l.append((x, y))
	l.sort(key=lambda tup: (tup[0], tup[1]))
	(cx, cy) = (0, 0)
	output = ''
	flag = True
	for i in range(n):
		if l[i][0] < cx or l[i][1] < cy:
			print('NO')
			flag = False
			break
		tx = l[i][0] - cx
		ty = l[i][1] - cy
		cx = l[i][0]
		cy = l[i][1]
		output += 'R' * tx
		output += 'U' * ty
	if flag:
		print('YES')
		print(output)
	t -= 1


for t in range(int(input())):
	n = int(input())
	packages = []
	for i in range(n):
		package = list(map(int, input().split(' ')))
		packages += [package]
	packages.sort()
	path = ''
	y = 0
	x = 0
	success = True
	for p in packages:
		if p[1] < y:
			success = False
			break
		path += (p[0] - x) * 'R'
		x = p[0]
		path += (p[1] - y) * 'U'
		y = p[1]
	if success:
		print('YES')
		print(path)
	else:
		print('NO')


for i in range(int(input())):
	k = []
	for i in range(int(input())):
		k.append(list(map(int, input().split())))
	k = sorted(k)
	l = 0
	m = 0
	w = 0
	e = 0
	t = 1
	q = ''
	for i in k:
		l = max(l, i[0])
		m = max(m, i[1])
		if i[0] < l or i[1] < m:
			print('NO')
			t = 0
			break
		if i[0] - w > 0:
			q += 'R' * (i[0] - w)
		if i[1] - e > 0:
			q += 'U' * (i[1] - e)
		w = l
		e = m
	if t == 1:
		print('YES')
		print(q)


tests = int(input())
flag = True
answers = []
for i in range(tests):
	vectors = []
	ans_string = []
	iters = int(input())
	for j in range(iters):
		(x, y) = map(int, input().split())
		vectors.append((x, y))
	vectors.sort(key=lambda vec: vec[1])
	vectors.sort(key=lambda vec: vec[0])
	prev_vec = (0, 0)
	for vec in vectors:
		if prev_vec[0] > vec[0] or prev_vec[1] > vec[1]:
			flag = False
			break
		x_diff = vec[0] - prev_vec[0]
		y_diff = vec[1] - prev_vec[1]
		for d in range(x_diff):
			ans_string.extend('R')
		for d in range(y_diff):
			ans_string.extend('U')
		prev_vec = vec
	if not flag:
		answers.append('NO')
		flag = True
	else:
		answers.append('YES')
		answers.append(''.join(ans_string))
for ans in answers:
	print(ans)


import sys
T = int(sys.stdin.readline())
while T:
	n = int(sys.stdin.readline())
	packages = []
	for i in range(n):
		packages.append(list(map(int, sys.stdin.readline().rstrip().split())))
	for pack in packages:
		pack.append(pack[0] + pack[1])
	packages.sort(key=lambda x: x[2])
	prev = [0, 0]
	flag = True
	answer = ''
	for pack in packages:
		if pack[0] < prev[0] or pack[1] < prev[1]:
			flag = False
			break
		right = pack[0] - prev[0]
		up = pack[1] - prev[1]
		answer += right * 'R' + up * 'U'
		prev[0] = pack[0]
		prev[1] = pack[1]
	if flag:
		print('YES')
		print(answer)
	else:
		print('NO')
	T -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	path = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		path.append([x ** 2 + y ** 2, x, y])
	path.sort()

	def helper():
		res = ''
		x = 0
		y = 0
		for pack in path:
			if pack[1] < x or pack[2] < y:
				return (False, None)
			res += 'R' * (pack[1] - x) + 'U' * (pack[2] - y)
			(x, y) = (pack[1], pack[2])
		return (True, res)
	(pre, res) = helper()
	if pre:
		print('YES')
		print(res)
	else:
		print('NO')


t = int(input())
for q in range(t):
	pack = []
	n = int(input())
	for m in range(n):
		package = [int(x) for x in input().split()]
		pack.append(package)
	pack.sort()
	lastx = pack[0][0]
	lasty = pack[0][1]
	moves = 'R' * pack[0][0] + 'U' * pack[0][1]
	flag = True
	for x in pack[1:]:
		if x[0] != lastx:
			if x[1] < lasty:
				flag = False
				break
			else:
				moves += 'R' * (x[0] - lastx) + 'U' * (x[1] - lasty)
		else:
			moves += 'U' * (x[1] - lasty)
		lastx = x[0]
		lasty = x[1]
	if flag == False:
		print('NO')
	else:
		print('YES')
		print(moves)


def check(a, b, x, y):
	dis = ((a[0][0] - x) ** 2 + (a[0][1] - y) ** 2) ** 0.5
	t = 0
	for i in range(1, b):
		temp = ((a[i][0] - x) ** 2 + (a[i][1] - y) ** 2) ** 0.5
		if temp != 0 and temp < dis:
			dis = temp
			t = i
		elif dis == 0:
			dis = temp
			t = i
		else:
			pass
	return t
t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	s = ''
	(sx, sy) = (0, 0)
	nxt = 0
	flag = 0
	tmp = n
	for _ in range(n):
		l1 = list(map(int, input().split()))
		l.append(l1)
	for _ in range(n):
		nxt = check(l, tmp, sx, sy)
		nx = l[nxt][0]
		ny = l[nxt][1]
		dx = nx - sx
		dy = ny - sy
		if dx < 0 or dy < 0:
			print('NO')
			flag = 1
			break
		else:
			s = s + ''.join('R' * dx)
			s = s + ''.join('U' * dy)
			sx = nx
			sy = ny
			del l[nxt]
			tmp -= 1
	if flag == 0:
		print('YES')
		print(s)


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	packages = []
	for _ in range(n):
		(x, y) = map(int, sys.stdin.readline().split())
		packages.append([x, y])
	packages.sort(key=lambda x: (x[0] ** 2 + x[1] ** 2) ** 0.5)
	yes = True
	x = 0
	y = 0
	answer = ''
	for i in range(n):
		xi = packages[i][0]
		yi = packages[i][1]
		if xi >= x and yi >= y:
			answer += 'R' * (xi - x)
			answer += 'U' * (yi - y)
			x = xi
			y = yi
		else:
			yes = False
		if not yes:
			answer = 'NO'
			break
	if yes:
		print('YES')
	print(answer)


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		x = list(map(int, input().split()))
		l.append(x)
	li = sorted(l, key=lambda k: [k[0], k[1]])
	s = 'R' * li[0][0] + 'U' * li[0][1]
	f = True
	for i in range(1, n):
		if li[i][0] - li[i - 1][0] >= 0 and li[i][1] - li[i - 1][1] >= 0:
			x = li[i][0] - li[i - 1][0]
			y = li[i][1] - li[i - 1][1]
			s = s + 'R' * x
			s += 'U' * y
		else:
			f = False
			break
	if f == True:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for i in range(t):
	can = True
	s = ''
	currentx = 0
	currenty = 0
	packages = []
	n = int(input())
	for k in range(n):
		packages.append(list(map(int, input().split())))
	packages = sorted(packages)
	for m in range(len(packages)):
		if m + 1 < len(packages):
			if packages[m + 1][0] < packages[m][0]:
				can = False
				break
			if packages[m + 1][1] < packages[m][1]:
				can = False
				break
		s += 'R' * (packages[m][0] - currentx)
		s += 'U' * (packages[m][1] - currenty)
		currentx = packages[m][0]
		currenty = packages[m][1]
	if can:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())

def proverka(A, n):
	p = True
	for i in range(1, n):
		if A[i - 1][0] > A[i][0] or A[i - 1][1] > A[i][1]:
			p = False
		if not p:
			break
	return p
for i in range(t):
	n = int(input())
	A = [tuple(map(int, input().split())) for i in range(n)]
	for i in range(n):
		for j in range(n - i - 1):
			if A[j][0] > A[j + 1][0]:
				(A[j], A[j + 1]) = (A[j + 1], A[j])
	for i in range(n):
		for j in range(n - i - 1):
			if A[j][1] > A[j + 1][1]:
				(A[j], A[j + 1]) = (A[j + 1], A[j])
	if proverka(A, n):
		print('YES')
		s = ''
		(x, y) = (0, 0)
		for i in range(n):
			if x < A[i][0]:
				s += 'R' * (A[i][0] - x)
			if y < A[i][1]:
				s += 'U' * (A[i][1] - y)
			(x, y) = (A[i][0], A[i][1])
		print(s)
	else:
		print('NO')


def solution():
	(_range, _int, _tuple, _max, _set, _sorted, _min) = (range, int, tuple, max, set, sorted, min)
	from sys import stdout, stdin
	(_input, _print) = (stdin.readline, stdout.write)
	for _ in _range(_int(_input())):
		n = _int(_input())
		from collections import defaultdict
		arr = defaultdict(_set)
		for _ in _range(n):
			(x, y) = [_int(i) for i in _input().split()]
			arr[x].add(y)
		ret_str = ''
		(x, y) = (0, 0)
		f = True
		for i in _sorted(arr.keys()):
			ret_str += 'R' * (i - x)
			x = i
			if y > _min(arr[i]):
				_print('NO\n')
				f = False
				break
			ret_str += 'U' * (_max(arr[i]) - y)
			y = _max(arr[i])
		if f:
			_print('YES\n' + ret_str + '\n')
solution()


m = int(input())
from collections import defaultdict
for i in range(m):
	n = int(input())
	points = defaultdict(list)
	for i in range(n):
		(x, y) = map(int, input().split())
		points[x].append(y)
	final = ''
	prevmax = None
	curmax = 0
	flag = False
	prevkey = 0
	for (key, value) in sorted(points.items()):
		if any((i < curmax for i in value)):
			flag = True
			break
		else:
			prevmax = curmax
			curmax = max(value)
		final += 'R' * (key - prevkey) + 'U' * (curmax - prevmax)
		prevkey = key
	if flag:
		print('NO')
	else:
		print('YES')
		print(final)


t = int(input())

def merge(arr, l, m, r):
	n1 = m - l + 1
	n2 = r - m
	L = [[0, 0]] * n1
	R = [[0, 0]] * n2
	for i in range(0, n1):
		L[i] = arr[l + i]
	for j in range(0, n2):
		R[j] = arr[m + 1 + j]
	i = 0
	j = 0
	k = l
	while i < n1 and j < n2:
		if L[i][0] <= R[j][0]:
			if L[i][0] == R[j][0] and L[i][1] < R[j][1]:
				arr[k] = L[i]
				i += 1
			elif L[i][0] == R[j][0] and L[i][1] > R[j][1]:
				arr[k] = R[j]
				j += 1
			else:
				arr[k] = L[i]
				i += 1
		else:
			arr[k] = R[j]
			j += 1
		k += 1
	while i < n1:
		arr[k] = L[i]
		i += 1
		k += 1
	while j < n2:
		arr[k] = R[j]
		j += 1
		k += 1

def mergeSort(arr, l, r):
	if l < r:
		m = (l + (r - 1)) // 2
		mergeSort(arr, l, m)
		mergeSort(arr, m + 1, r)
		merge(arr, l, m, r)
while t:
	n = int(input())
	grid = []
	for i in range(n):
		temp = list(map(lambda x: int(x), input().split()))
		grid.append([temp[0], temp[1]])
	mergeSort(grid, 0, n - 1)
	(x, y) = (0, 0)
	i = 0
	flag = True
	ans = []
	while i < n:
		if x > grid[i][0] or y > grid[i][1]:
			flag = False
			break
		ans += ['R'] * (grid[i][0] - x)
		ans += ['U'] * (grid[i][1] - y)
		x = grid[i][0]
		y = grid[i][1]
		i += 1
	if flag:
		print('YES')
		for i in ans:
			print(i, end='')
		print()
	else:
		print('NO')
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = [[0, 0]]
	for i in range(n):
		(l, r) = map(int, input().split())
		a.append([l, r])
	a.sort()
	s = ''
	c = 0
	for i in range(n):
		x = a[i]
		y = a[i + 1]
		if y[0] >= x[0]:
			yy = 'R' * (y[0] - x[0])
			s += yy
			if y[1] >= x[1]:
				xx = 'U' * (y[1] - x[1])
				s += xx
				c += 1
			else:
				break
		else:
			break
	if c == n:
		print('YES')
		print(s)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	z = []
	for i in range(n):
		z.append(list(map(int, input().split())))
	z.sort()
	ans = ''
	(cx, cy) = (0, 0)
	flag = True
	for i in z:
		if i[0] >= cx and i[1] >= cy:
			ans += 'R' * (i[0] - cx)
			ans += 'U' * (i[1] - cy)
			cx = i[0]
			cy = i[1]
		else:
			flag = False
		if not flag:
			break
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	xy = [[0, 0] for i in range(n)]
	for i in range(n):
		(xy[i][0], xy[i][1]) = map(int, input().split())
	xy.sort()
	ans = 'R' * (xy[0][0] - 0) + 'U' * (xy[0][1] - 0)
	flag = True
	for i in range(1, n):
		if xy[i][1] - xy[i - 1][1] < 0 or xy[i][0] - xy[i - 1][0] < 0:
			print('NO')
			flag = False
			break
		ans += 'R' * (xy[i][0] - xy[i - 1][0]) + 'U' * (xy[i][1] - xy[i - 1][1])
	if flag:
		print('YES')
		print(ans)


t = int(input())
for testcase in range(t):
	n = int(input())
	l = []
	for i in range(n):
		c = list(map(int, input().split()))
		l.append(c)
	l.sort()
	T = False
	s = 'R' * l[0][0] + 'U' * l[0][1]
	for i in range(n - 1):
		x = l[i + 1][0] - l[i][0]
		y = l[i + 1][1] - l[i][1]
		if x >= 0 and y >= 0:
			s = s + 'R' * x + 'U' * y
		else:
			T = True
			break
	if T:
		print('NO')
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	packages = set()
	(xm, ym) = (0, 0)
	xpack = [[] for i in range(1069)]
	for i in range(n):
		(x, y) = map(int, input().split())
		xpack[x] += [y]
	(x, y) = (0, 0)
	ans = ''
	poss = True
	extra = ''
	for i in range(1001):
		if not xpack[i]:
			extra += 'R'
			y += 1
		else:
			ans += extra
			extra = ''
			for each in sorted(xpack[i]):
				if x > each:
					poss = False
					break
				else:
					ans += 'U' * (each - x)
					x = each
			ans += 'R'
			y += 1
	if poss:
		print('YES')
		print(ans[:-1])
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	cords = [[0, 0]]
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		cords.append([x, y])
	cords.sort()
	ans = ''
	flag = 1
	for i in range(len(cords) - 1):
		if cords[i + 1][0] - cords[i][0] >= 0 and cords[i + 1][1] - cords[i][1] >= 0:
			ans = ans + (cords[i + 1][0] - cords[i][0]) * 'R'
			ans = ans + (cords[i + 1][1] - cords[i][1]) * 'U'
		else:
			flag = 0
			break
	if flag == 0:
		print('NO')
		continue
	else:
		print('YES')
		print(ans)


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	pos = []
	for j in range(n):
		(x, y) = map(int, input().split())
		pos.append((x, y))
	pos.sort()
	x = 0
	y = 0
	s = ''
	for (xx, yy) in pos:
		if xx - x < 0 or yy - y < 0:
			ans.append('NO')
			s = ''
			break
		s += (xx - x) * 'R' + (yy - y) * 'U'
		x += xx - x
		y += yy - y
	if len(s) > 0:
		ans.append(s)
for a in ans:
	if a != 'NO':
		print('YES')
		print(a)
	else:
		print(a)


for _ in range(int(input())):
	a = [(0, 0)]
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	a.sort()
	s = str()
	for k in range(1, n + 1):
		if a[k][0] < a[k - 1][0] or a[k][1] < a[k - 1][1]:
			print('NO')
			break
		else:
			p = a[k][0] - a[k - 1][0]
			q = a[k][1] - a[k - 1][1]
			s += p * 'R' + q * 'U'
	else:
		print('YES')
		print(s)


import sys
from collections import defaultdict
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(tuple(map(int, input().split())))
	l.sort(key=lambda x: (x[0], x[1]))
	for i in range(1, n):
		if l[i][1] < l[i - 1][1]:
			break
	else:
		res = []
		x = 0
		y = 0
		for (i, j) in l:
			res.append('R' * (i - x))
			res.append('U' * (j - y))
			x = i
			y = j
		print('YES')
		print(''.join(res))
		continue
	print('NO')


def sortkey(val):
	return val[0]
t = int(input())
for _ in range(t):
	n = int(input())
	ls = []
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		ls.append([x, y])
	ls.sort()
	flag = 0
	for i in range(n - 1):
		if ls[i][1] > ls[i + 1][1]:
			flag = 1
			break
	path = ''
	path += 'R' * (ls[0][0] - 0)
	path += 'U' * (ls[0][1] - 0)
	for i in range(n - 1):
		path += 'R' * (ls[i + 1][0] - ls[i][0])
		path += 'U' * (ls[i + 1][1] - ls[i][1])
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(path)


from collections import defaultdict as dd
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	d = dd(list)
	e = dd(list)
	for i in range(n):
		(a, b) = map(int, input().split())
		d[a].append(b)
		e[b].append(a)
	for i in d.keys():
		d[i] = sorted(d[i])
	for i in e.keys():
		e[i] = sorted(e[i])
	da = sorted(d.keys())
	ea = sorted(e.keys())
	x = []
	for i in ea:
		x += e[i]
	if x != sorted(x):
		print('NO')
		continue
	print('YES')
	r = l = 0
	ans = ''
	for i in da:
		ans += 'R' * (i - r)
		ans += 'U' * (d[i][-1] - l)
		r = i
		l = d[i][-1]
	print(ans)


import copy
import sys
from collections import defaultdict, Counter

def input():
	return sys.stdin.readline()

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

def maps():
	return map(str, input().split())

def print(arg, *argv, end=None):
	sys.stdout.write(str(arg))
	for i in argv:
		sys.stdout.write(' ' + str(i))
	sys.stdout.write(end) if end else sys.stdout.write('\n')

def GCD(x, y):
	return GCD(y, x % y) if y else x

def modPow(x, y, p):
	(res, x) = (1, x % p)
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		(y, x) = (y >> 1, x * x % p)
	return res

def modInv(s, mod):
	return modPow(s, mod - 2, mod)

def solve():
	t = 1
	t = int(input())
	while t:
		t -= 1
		n = int(input())
		a = []
		for i in range(n):
			(x, y) = mapi()
			a.append([x, y])
		a.sort(key=lambda x: (x[0], x[1]))
		res = ''
		xx = 0
		yy = 0
		flag = 0
		for i in a:
			if xx > i[0] or yy > i[1]:
				flag = 1
				break
			for j in range(xx, i[0]):
				res += 'R'
				xx += 1
			for j in range(yy, i[1]):
				res += 'U'
				yy += 1
		if flag == 0:
			print('YES')
			print(res)
		else:
			print('NO')
solve()


t = int(input())
while t > 0:
	tuples = []
	n = int(input())
	while n > 0:
		tup = []
		p = input().split()
		a = int(p[0])
		b = int(p[1])
		tup.append(a)
		tup.append(b)
		tuples.append(tup)
		n = n - 1
	tuples.sort(key=lambda x: (x[1], x[0]))
	a = 0
	b = 0
	ans = ''
	do = 'YES'
	for tup in tuples:
		(a, b) = (tup[0] - a, tup[1] - b)
		if a < 0 or b < 0:
			do = 'NO'
			break
		for i in range(a):
			ans += 'R'
		for i in range(b):
			ans += 'U'
		a = tup[0]
		b = tup[1]
	if do == 'NO':
		print('NO')
	else:
		print(do)
		print(ans)
	t = t - 1


t = int(input())
for i in range(t):
	n = int(input())
	l1 = []
	l2 = []
	l3 = []
	l4 = []
	for j in range(n):
		(x, y) = map(int, input().split(' '))
		l1.append(x)
		l2.append(y)
		l3.append([x, y])
	l1.sort()
	l2.sort()
	for k in range(len(l1)):
		l4.append([l1[k], l2[k]])
	l4.sort()
	l3.sort()
	if l4 != l3:
		print('NO')
	else:
		print('YES')
		pos = [0, 0]
		for m in range(len(l3)):
			print('R' * (l3[m][0] - pos[0]), end='')
			print('U' * (l3[m][1] - pos[1]), end='')
			pos = l3[m]
			if m == len(l3) - 1:
				print('')


num = int(input())
ans = []
for x in range(num):
	trip = []
	location = []
	n = int(input())
	start_i = 0
	start_j = 0
	judge = 1
	for m in range(n):
		location.append(tuple(map(int, input().split())))
	location.sort()
	for (i, j) in location:
		if int(i) >= start_i and int(j) >= start_j:
			trip.extend(['R'] * (int(i) - start_i))
			trip.extend(['U'] * (int(j) - start_j))
			start_i = int(i)
			start_j = int(j)
		else:
			print('NO')
			break
	else:
		print('YES')
		print(''.join(trip))


t = int(input())
for _ in range(0, t):
	n = int(input())
	s = []
	for _ in range(0, n):
		(x, y) = map(int, input().split())
		s.append((x, y))
	s = sorted(s)
	ss = 'YES'
	ans = ''
	(cx, cy) = (0, 0)
	for i in s:
		(ox, oy) = (i[0], i[1])
		ans += (ox - cx) * 'R'
		if oy - cy < 0:
			ss = 'NO'
			break
		else:
			ans += (oy - cy) * 'U'
		(cx, cy) = (ox, oy)
	if ss == 'YES':
		print(ss)
		print(ans)
	else:
		print(ss)


num = int(input())
tests = []
out = []
for i in range(num):
	packages = int(input())
	packages_li = []
	for j in range(packages):
		line = input()
		line_spl = line.split()
		result = (int(line_spl[0]), int(line_spl[1]))
		packages_li.append(result)
	packages_li.sort()
	tests.append(packages_li)
for t in tests:
	x = 0
	y = 0
	path = ''
	possiable = True
	for p in t:
		temp_x = p[0]
		temp_y = p[1]
		if temp_x < x:
			possiable = False
			break
		elif temp_x > x:
			path += (temp_x - x) * 'R'
			x = temp_x
		if temp_y < y:
			possiable = False
			break
		elif temp_y > y:
			path += (temp_y - y) * 'U'
			y = temp_y
	if possiable:
		out.append('YES')
		out.append(path)
	else:
		out.append('NO')
for line in out:
	print(line)


for _ in range(int(input())):
	n = int(input())
	caixas = []
	for i in range(n):
		caixas.append([int(x) for x in input().split()])
	caixas.sort()
	ans = ''
	cur = [0, 0]
	for i in caixas:
		a = i[0] - cur[0]
		b = i[1] - cur[1]
		ans += 'R' * a
		ans += 'U' * b
		if a < 0 or b < 0:
			ans = 'NO'
			break
		cur = i
	if ans != 'NO':
		print('YES')
	print(ans)


for _ in range(int(input())):
	n = int(input())
	d = []
	for i in range(n):
		(x, y) = map(int, input().split())
		d.append((x, y))
	d.sort()
	p = []
	cur = (0, 0)
	for i in d:
		if i[0] - cur[0] < 0 or i[1] - cur[1] < 0:
			print('NO')
			break
		else:
			for _ in range(i[0] - cur[0]):
				p.append('R')
			for _ in range(i[1] - cur[1]):
				p.append('U')
		cur = i
	else:
		print('YES')
		print(''.join(p))


def main():
	t = int(input())
	for i in range(t):
		li = []
		f = 0
		n = int(input())
		for i in range(n):
			c = list(map(int, input().split()))
			c.append(c[0] + c[1])
			li.append(c)
		li_len = len(li)
		s = len(set([i[2] for i in li]))
		if li_len != s:
			print('NO')
			continue
		li.sort(key=lambda x: x[2])
		for i in range(n - 1, 0, -1):
			li[i][0] -= li[i - 1][0]
			if li[i][0] < 0:
				print('NO')
				f = 1
				break
			li[i][1] -= li[i - 1][1]
			if li[i][1] < 0:
				print('NO')
				f = 1
				break
		if f == 1:
			continue
		ans = []
		for i in li:
			ans.append('R' * i[0])
			ans.append('U' * i[1])
		print('YES')
		print(''.join(ans))
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	Fail = False
	n = int(input())
	T = ((0, 0),)
	for __ in range(n):
		(x, y) = map(int, input().split())
		T += ((x, y),)
	T = sorted(T)
	path = ''
	for i in range(1, len(T)):
		diffX = T[i][0] - T[i - 1][0]
		diffY = T[i][1] - T[i - 1][1]
		if diffX < 0 or diffY < 0:
			Fail = True
		path += 'R' * (T[i][0] - T[i - 1][0])
		path += 'U' * (T[i][1] - T[i - 1][1])
	if Fail:
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
for _ in range(t):
	n = int(input())
	data = [[0, 0, 0]]
	for i in range(n):
		(x, y) = map(int, input().split())
		z = x * x + y * y
		data.append([x, y, z])
	flag = False
	data.sort(key=lambda tup: tup[-1])
	path = ''
	for i in range(1, len(data)):
		(x1, y1, z) = data[i]
		(x2, y2, z) = data[i - 1]
		if x1 < x2 or y1 < y2:
			flag = True
			break
		path += 'R' * abs(x2 - x1)
		path += 'U' * abs(y2 - y1)
	if flag:
		print('NO')
		continue
	print('YES')
	print(path)


for _ in range(int(input())):
	n = int(input())
	ar = [[0, 0]]
	for i in range(n):
		ar.append(list(map(int, input().split())))
	ar.sort()
	flag = True
	st = ''
	for i in range(1, n + 1):
		x1 = ar[i][0] - ar[i - 1][0]
		y1 = ar[i][1] - ar[i - 1][1]
		if x1 < 0 or y1 < 0:
			print('NO')
			flag = False
			break
		else:
			st += x1 * 'R'
			st += y1 * 'U'
	if flag:
		print('YES')
		print(st)


t = int(input())
for wirfb in range(t):
	n = int(input())
	li = [[0, 0]]
	for i in range(n):
		li.append(list(map(int, input().split())))
	li.sort()
	c = 0
	le = len(li)
	s = ''
	f = 0
	for i in range(1, le):
		str = ''
		r = li[i][0] - li[i - 1][0]
		u = li[i][1] - li[i - 1][1]
		if r < 0 or u < 0:
			f = 1
			break
		str = r * 'R' + u * 'U'
		s = s + str
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(s)


import sys
t = int(input())
for i in range(t):
	n = int(input())
	pos = []
	for j in range(n):
		kek = list(map(int, input().split()))
		pos.append(kek)
	pos.sort()
	ans = ''
	dx = 0
	dy = 0
	flag = 1
	for j in range(len(pos) - 1):
		if pos[j][1] > pos[j + 1][1]:
			flag = 0
			break
	for j in range(len(pos)):
		ans += (pos[j][0] - dx) * 'R' + (pos[j][1] - dy) * 'U'
		dx = pos[j][0]
		dy = pos[j][1]
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


import collections
for _ in range(int(input())):
	MAX = -float('inf')
	d = collections.defaultdict(list)
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		MAX = max(MAX, a)
		d[a].append(b)
	i = j = 0
	ans = []
	an = 'YES'
	while True:
		if i in d:
			end = max(d[i])
			start = min(d[i])
			if start < j:
				an = 'NO'
				break
			while j != end:
				ans.append('U')
				j += 1
			if i == MAX:
				break
		ans.append('R')
		i += 1
	if an == 'NO':
		print(an)
	else:
		print('YES')
		print(''.join(ans))


from functools import cmp_to_key

def cmp(a, b):
	if a[0] < b[0]:
		return -1
	elif a[0] > b[0]:
		return 1
	elif a[1] < b[1]:
		return -1
	elif a[1] > b[1]:
		return 1
	else:
		return 0
for _ in range(int(input())):
	n = int(input())
	points = []
	for i in range(n):
		points.append(list(map(int, input().split())))
	points.sort(key=cmp_to_key(cmp))
	path = 'R' * points[0][0] + 'U' * points[0][1]
	i = 1
	(tx, ty) = (points[0][0], points[0][1])
	flag = 0
	while i < n:
		(x, y) = (points[i][0] - tx, points[i][1] - ty)
		if x < 0 or y < 0:
			flag = 1
			break
		path += 'R' * x + 'U' * y
		(tx, ty) = (points[i][0], points[i][1])
		i += 1
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(path)


for _ in range(int(input())):
	n = int(input())
	li = []
	li1 = []
	for i in range(n):
		t = tuple(map(int, input().split()))
		li.append(t)
		li1.append(t[::-1])
	li.sort()
	li1.sort()
	res = ''
	res1 = ''
	curr = (0, 0)
	for i in range(n):
		t = ''
		if curr[0] > li[i][0] or curr[1] > li[i][1]:
			res = -1
			break
		t += 'R' * (li[i][0] - curr[0])
		t += 'U' * (li[i][1] - curr[1])
		res += t
		curr = li[i]
	curr = (0, 0)
	for i in range(n):
		t = ''
		if curr[0] > li1[i][0] or curr[1] > li1[i][1]:
			res1 = -1
			break
		t += 'U' * (li1[i][0] - curr[0])
		t += 'R' * (li1[i][1] - curr[1])
		res1 += t
		curr = li1[i]
	if res == -1 or res1 == -1:
		if res == res1:
			print('NO')
		elif res == -1:
			print(res1)
		else:
			print(res)
	elif len(res) < len(res1):
		print('YES')
		print(res)
	elif len(res) > len(res1):
		print('YES')
		print(res1)
	else:
		print('YES')
		print(sorted([res, res1], key=len)[0])


def closepoints(x, y, a):
	b = []
	for i in range(len(a)):
		b.append([a[i][0] - x + (a[i][1] - y), i])
	b = sorted(b, key=lambda x: x[0])
	c = []
	for i in b:
		c.append(a[i[1]])
	return c
for _ in range(int(input())):
	ar = []
	for __ in range(int(input())):
		(x, y) = map(int, input().split())
		ar.append([x, y])
	ar = closepoints(0, 0, ar)
	st = ''
	st += 'R' * ar[0][0] + 'U' * ar[0][1]
	flag = 0
	for i in range(1, len(ar)):
		if ar[i][0] - ar[i - 1][0] >= 0 and ar[i][1] - ar[i - 1][1] >= 0:
			st += 'R' * (ar[i][0] - ar[i - 1][0]) + 'U' * (ar[i][1] - ar[i - 1][1])
		else:
			print('NO')
			flag = 1
			break
	if flag == 0:
		print('YES')
		print(st)


nn = int(input())
for i in range(nn):
	steps = int(input())
	dicts = {}
	for v in range(steps):
		tmp = []
		t = str(input())
		t = t.split()
		for it in t:
			tmp.append(int(it))
		ty = tmp[0]
		if tmp[0] not in dicts:
			dicts[ty] = []
			dicts[ty].append(tmp[1])
		else:
			dicts[ty].append(tmp[1])
	cur = []
	flag = 0
	strs = ''
	curx = 0
	cury = 0
	for (key, value) in sorted(dicts.items()):
		diff = key - curx
		strs += 'R' * diff
		curx = key
		value = sorted(value)
		diff = value[-1] - cury
		strs += 'U' * diff
		cury = value[-1]
		if len(cur) == 0:
			for ib in value:
				cur.append(ib)
		else:
			for ib in value:
				if cur[-1] > ib:
					flag = 1
					break
				else:
					cur.append(ib)
			if flag == 1:
				break
	if flag == 0:
		print('YES')
		print(strs)
	else:
		print('NO')


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify, nlargest
from copy import deepcopy
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

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

def inpl_1():
	return list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))

def inps():
	return sys.stdin.readline()

def inpsl(x):
	tmp = sys.stdin.readline()
	return list(tmp[:x])

def err(x):
	print(x)
	exit()
for _ in range(inp()):
	n = inp()
	xy = [inpl() for _ in range(n)]
	res = []
	(nx, ny) = (0, 0)
	xy.sort(key=lambda x: x[1])
	xy.sort(key=lambda x: x[0])
	bad = False
	for (x, y) in xy:
		if x < nx or y < ny:
			print('NO')
			break
		for i in range(x - nx):
			res.append('R')
		for i in range(y - ny):
			res.append('U')
		(nx, ny) = (x, y)
	else:
		print('YES')
		print(''.join(res))


import math
import os
import random
import re
import sys
t = int(input())
for i in range(t):
	flag = 0
	cod = []
	n = int(input())
	for i in range(n):
		value = input().split()
		l = int(value[0])
		r = int(value[1])
		cod.append([l, r])
	cod = sorted(cod)
	value = cod[0][1]
	for i in range(1, n):
		if value > cod[i][1]:
			print('NO', end='')
			flag = 1
			break
		else:
			value = cod[i][1]
	if flag == 0:
		print('YES')
		print('R' * cod[0][0], end='')
		print('U' * cod[0][1], end='')
		for i in range(1, n):
			print('R' * (cod[i][0] - cod[i - 1][0]), end='')
			print('U' * (cod[i][1] - cod[i - 1][1]), end='')
	print('')


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

def pack():
	for _ in range(t):
		n = int(input())
		lst = []
		for i in range(n):
			lst.append(list(map(int, input().split())))
		lst.sort(key=lambda x: (x[0], x[1]))
		res = ''
		prev = []
		yn = 'YES'
		for i in range(n):
			if i == 0:
				res += lst[i][0] * 'R' + lst[i][1] * 'U'
			else:
				curr = lst[i]
				if curr[0] >= prev[0] and curr[1] < prev[1]:
					yn = 'NO'
					break
				else:
					res += (curr[0] - prev[0]) * 'R' + (curr[1] - prev[1]) * 'U'
			prev = lst[i]
		if yn == 'YES':
			yield yn
			yield res
		else:
			yield yn
t = int(input())
ans = pack()
print(*ans, sep='\n')


import sys
for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	(ans, pos) = ([], True)
	cur = [0, 0]
	for i in l:
		if i[0] - cur[0] < 0 or i[1] - cur[1] < 0:
			pos = False
			break
		else:
			ans.append((i[0] - cur[0]) * 'R')
			ans.append((i[1] - cur[1]) * 'U')
			cur[0] = i[0]
			cur[1] = i[1]
	if pos:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	path = []
	x = y = 0
	t = 1
	for i in l:
		if i[0] > x:
			path.extend([(i[0] - x) * 'R'])
			x = i[0]
		if i[1] > y:
			path.extend([(i[1] - y) * 'U'])
			y = i[1]
		if i[0] < x or i[1] < y:
			t = 0
	if t == 0:
		print('NO')
	else:
		print('YES')
		print(''.join(path))


def heapify(arr, n, i):
	largest = i
	l = 2 * i + 1
	r = 2 * i + 2
	if l < n and arr[i].x <= arr[l].x:
		if arr[i].x < arr[l].x:
			largest = l
		elif arr[i].x == arr[l].x and arr[i].y < arr[l].y:
			largest = l
	if r < n and arr[largest].x <= arr[r].x:
		if arr[largest].x < arr[r].x:
			largest = r
		elif arr[largest].x == arr[r].x and arr[largest].y < arr[r].y:
			largest = r
	if largest != i:
		(arr[i], arr[largest]) = (arr[largest], arr[i])
		heapify(arr, n, largest)

def heapSort(arr):
	n = len(arr)
	for i in range(n, -1, -1):
		heapify(arr, n, i)
	for i in range(n - 1, 0, -1):
		(arr[i], arr[0]) = (arr[0], arr[i])
		heapify(arr, i, 0)

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __str__(self):
		return '(' + str(self.x) + ' ' + str(self.y) + ')'

def printArr(arr):
	for p in arr:
		print(p, end=' ')
	print('')
t = int(input())
for i in range(0, t):
	n = int(input())
	points = []
	for j in range(0, n):
		s = input()
		points.append(Point(int(s.split(' ')[0]), int(s.split(' ')[1])))
	heapSort(points)
	curX = 0
	curY = 0
	seq = ''
	for p in points:
		if p.x > curX:
			for x in range(0, p.x - curX):
				seq = seq + 'R'
			curX = p.x
		if p.y > curY:
			for x in range(0, p.y - curY):
				seq = seq + 'U'
			curY = p.y
		elif curY > p.y:
			seq = 'x'
			break
	if seq == 'x':
		print('NO')
	else:
		print('YES')
		print(seq)


for i in range(int(input())):
	l = []
	for j in range(int(input())):
		l.append(list(map(int, input().split())))
	(x, y) = (0, 0)
	l.sort(key=lambda x: x[0] + x[1])
	s = []
	prev = (0, 0)
	abort = False
	for i in l:
		if prev[0] > i[0] or prev[1] > i[1]:
			abort = True
			break
		else:
			s.append('R' * (i[0] - prev[0]))
			s.append('U' * (i[1] - prev[1]))
		prev = i.copy()
	if not abort:
		print('YES')
		print(*s, sep='')
	else:
		print('NO')


t = int(input())
for loop in range(t):
	n = int(input())
	xy = []
	ans = []
	for i in range(n):
		(x, y) = map(int, input().split())
		xy.append([x, y])
	xy.sort()
	x = 0
	y = 0
	flag = True
	for i in range(n):
		nexx = xy[i][0]
		nexy = xy[i][1]
		if x > nexx or y > nexy:
			flag = False
			break
		while x < nexx:
			ans.append('R')
			x += 1
		while y < nexy:
			ans.append('U')
			y += 1
	if flag:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


n = int(input())
for i in range(0, n):
	o = int(input())
	l = []
	W = []
	G = 0
	S = -1
	for j in range(0, 1001):
		D = []
		l.append(list(D))
	for j in range(0, o):
		p = input().rstrip().split(' ')
		l[int(p[0])].append(int(p[1]))
	for j in range(0, 1001):
		l[j].sort(key=int)
	for j in range(0, 1001):
		if len(l[j]) != 0:
			if S == -1:
				S = j
				for jd in range(0, S):
					W.append('R')
				A = l[j][len(l[j]) - 1]
				for jd in range(0, A):
					W.append('U')
				D = A
			else:
				B = j - S
				A = l[j][len(l[j]) - 1]
				C = A - D
				if l[j][0] - D < 0:
					G = 1
					break
				else:
					S = j
					D = A
					for jd in range(0, B):
						W.append('R')
					for jd in range(0, C):
						W.append('U')
	if G == 1:
		print('NO')
	else:
		print('YES')
		print(''.join(W))


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	graph = defaultdict(list)
	for i in range(n):
		(x, y) = map(int, input().split())
		graph[y].append(x)
	x = 0
	y = 0
	ans = []
	flag = 1
	for i in sorted(graph.keys()):
		for j in sorted(graph[i]):
			if y > i or x > j:
				flag = 0
				break
			else:
				ans.append('R' * (j - x))
				ans.append('U' * (i - y))
				x = j
				y = i
		if flag == 0:
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')
		print(''.join(ans))


t = int(input())
for _ in range(t):
	n = int(input())
	a = b = 0
	s = ''
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append([x, y])
	l.sort()
	flag = 1
	for i in l:
		if i[0] < a or i[1] < b:
			flag = 0
			print('NO')
			break
		for j in range(i[0] - a):
			s += 'R'
		a += i[0] - a
		for j in range(i[1] - b):
			s += 'U'
		b += i[1] - b
	if flag:
		print('YES')
		print(s)


from sys import stdin
from math import *
from sys import *
from heapq import *
from collections import defaultdict
from itertools import permutations
import os, sys
from io import IOBase, BytesIO
M = 10 ** 9 + 7

def graph_as_tree_1_root():
	n = int(input())
	dict = defaultdict(list)
	for _ in range(n - 1):
		(x, y) = list(map(int, input().split()))
		dict[x].append(y)
		dict[y].append(x)
	tree = [[1]]
	temp = [1]
	vall = 0
	seen = set([i for i in range(2, n + 1)])
	lol = []
	while len(seen) > 0:
		lol = list(seen)
		tt = []
		for x in temp:
			aa = []
			for val in dict[x]:
				if val in seen:
					aa += [val]
					seen.remove(val)
			dict[x] = aa
			tt += aa
		tree.append(tt)
		temp = tt
		vall += 1
	for x in lol:
		dict[x] = []
	print(tree, dict)

def pow(a, b):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def powmod(a, b, m):
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % m
		a = a * a % m
		b //= 2
	return res

def inv(a, m):
	return powmod(a, m - 2, m)

def alldivisors(n):
	list = []
	arr = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				arr += [i]
			else:
				arr += [i]
				list.append(n // i)
	arr += list[::-1]
	return arr

def primefactorisation(n):
	potentional_p = 3
	itog_list = defaultdict(int)
	if n % 2 == 0:
		itog_list[2] = 0
	while n % 2 == 0:
		n = n // 2
		itog_list[2] += 1
	while n - 1:
		if potentional_p > n ** 0.5:
			itog_list[n] += 1
			return itog_list
		while n % potentional_p == 0:
			n = n // potentional_p
			itog_list[potentional_p] += 1
		potentional_p += 2
	return itog_list
I = stdin.readline

def main():
	t = int(I())
	for _ in range(t):
		ans = ''
		n = int(I())
		xyl = []
		for _ in range(n):
			(x, y) = map(int, I().split())
			xyl.append((x, y))
		for i in range(n):
			for j in range(n):
				(x1, y1) = xyl[i]
				(x2, y2) = xyl[j]
				if (x1 - x2) * (y1 - y2) < 0:
					print('NO')
					break
			else:
				continue
			break
		else:
			print('YES')
			xyl = sorted(xyl, key=lambda x: x[0] + x[1])
			ans += 'R' * xyl[0][0]
			ans += 'U' * xyl[0][1]
			for i in range(n - 1):
				ans += 'R' * (xyl[i + 1][0] - xyl[i][0])
				ans += 'U' * (xyl[i + 1][1] - xyl[i][1])
			print(ans)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.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')
main()


import sys

def solution(packages, n):
	packages = sorted(packages)
	(x, y) = (0, 0)
	res = ''
	for (b, a) in packages:
		if a < x:
			return 'NO'
		right_moves = a - x
		up_moves = b - y
		while right_moves > 0:
			x += 1
			res += 'R'
			right_moves -= 1
		while up_moves > 0:
			y += 1
			res += 'U'
			up_moves -= 1
	return f'YES\n{res}'
for line in sys.stdin:
	t = int(line)
	break
for line in sys.stdin:
	temp = [int(x) for x in line.split()]
	if len(temp) == 1:
		n = temp[0]
		packages = []
	else:
		(x, y) = temp
		packages.append((y, x))
		if len(packages) == n:
			print(solution(packages, n))


t = int(input())
import math
for i in range(t):
	n = int(input())
	w = []
	for i in range(n):
		(x, y) = map(int, input().strip().split())
		w.append([x, y])
	r = sorted(w)
	ini = [0, 0]
	ans = []
	d = 0
	for i in r:
		if i[0] - ini[0] >= 0 and i[1] - ini[1] >= 0:
			ans.append(int(i[0] - ini[0]) * 'R')
			ans.append(int(i[1] - ini[1]) * 'U')
			ini = i
		else:
			d = 1
			break
	if d == 1:
		print('NO')
	else:
		print('YES')
		print(''.join(ans))


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	al = []
	for i in range(n):
		(x, y) = map(int, input().split())
		al.append([x, y])
	al.sort()
	ans = ''
	x = y = 0
	for i in range(n):
		if al[i][0] < x or al[i][1] < y:
			print('NO')
			return
		if al[i][0] > x:
			ans += 'R' * (al[i][0] - x)
			x = al[i][0]
		if al[i][1] > y:
			ans += 'U' * (al[i][1] - y)
			y = al[i][1]
	print('YES')
	print(ans)

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


n = int(input())
for i in range(n):
	k = int(input())
	a = []
	for j in range(k):
		a.append(list(map(int, input().split())))
	a.sort()
	ans = 'YES'
	for j in range(k - 1):
		if a[j][1] > a[j + 1][1]:
			ans = 'NO'
			break
	print(ans)
	if ans == 'YES':
		z = 'R' * a[0][0] + 'U' * a[0][1]
		for j in range(1, k):
			z += 'R' * (a[j][0] - a[j - 1][0]) + 'U' * (a[j][1] - a[j - 1][1])
		print(z)


t = int(input())
for _ in range(t):
	n = int(input())
	packages = []
	for _ in range(n):
		packages.append(tuple(map(int, input().split())))
	packages = sorted(packages, key=lambda p: (p[0], p[1]))
	prev = (0, 0)
	path = ''
	failed = False
	for p in packages:
		if p[0] < prev[0] or p[1] < prev[1]:
			print('NO')
			failed = True
			break
		if p[0] > prev[0]:
			path += 'R' * (p[0] - prev[0])
		if p[1] > prev[1]:
			path += 'U' * (p[1] - prev[1])
		prev = p
	if not failed:
		print('YES')
		print(path)


t = input()
t = int(t)
list = []
ans = ''
pos = True

def sec(l):
	return l[1]

def fir(l):
	return l[0]
for i in range(t):
	n = input()
	n = int(n)
	list.clear()
	ans = ''
	list.append([0, 0])
	for j in range(n):
		(a, b) = map(int, input().split())
		list.append([a, b])
	list.sort(key=fir)
	list.sort(key=sec)
	pos = True
	for k in range(n):
		if list[k + 1][1] - list[k][1] < 0 or list[k + 1][0] - list[k][0] < 0:
			pos = False
			ans = ''
			break
		while list[k + 1][0] - list[k][0] > 0:
			ans = ans + 'R'
			list[k][0] += 1
		while list[k + 1][1] - list[k][1] > 0:
			ans = ans + 'U'
			list[k][1] += 1
	if pos:
		print('YES')
		print(ans)
	else:
		print('NO')


from collections import namedtuple
point = namedtuple('point', ['x', 'y'])

def _path_to_point(begin, end):
	return 'R' * (end.x - begin.x) + 'U' * (end.y - begin.y)

def _check_availability(begin, end):
	return end.x >= begin.x and end.y >= begin.y

def solve_task():
	result = []
	points = []
	points_number = int(input())
	for i in range(points_number):
		(x, y) = map(int, input().split())
		points.append(point(x, y))
	points.sort(key=lambda item: item.x + item.y)
	points = [point(0, 0)] + points
	for i in range(len(points) - 1):
		(current_position, next_point) = (points[i], points[i + 1])
		if _check_availability(current_position, next_point):
			result.append(_path_to_point(current_position, next_point))
		else:
			return 'NO'
	return 'YES\n' + ''.join(result)
tasks_number = int(input())
for i in range(tasks_number):
	print(solve_task())


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	n = int(input())
	xy = [tuple(map(int, input().split())) for _ in range(n)]
	xy.sort(key=lambda t: (t[0], t[1]))
	flag = True
	for i in range(n - 1):
		(xi, yi) = xy[i]
		(xj, yj) = xy[i + 1]
		if xi < xj and yi > yj:
			flag = False
	if not flag:
		print('NO')
		continue
	ans = []
	(nx, ny) = (0, 0)
	for (x, y) in xy:
		for _ in range(x - nx):
			ans.append('R')
		for _ in range(y - ny):
			ans.append('U')
		(nx, ny) = (x, y)
	print('YES')
	print(''.join(ans))


def tc():
	(n, i, j, v) = (int(input()), 0, 0, [])
	for pi in sorted((list(map(int, input().split())) for i in range(n))):
		if i > pi[0]:
			return 'NO'
		v.append((pi[0] - i) * 'R')
		if j > pi[1]:
			return 'NO'
		v.append((pi[1] - j) * 'U')
		(i, j) = (pi[0], pi[1])
	return 'YES\n{}'.format(''.join(v))
for t in range(int(input())):
	print(tc())


t = int(input())
for i in range(t):
	s = [[0, 0]]
	res = []
	n = int(input())
	for j in range(n):
		(x, y) = map(int, input().split())
		s.append([x, y])
	s = sorted(s)
	c = True
	for j in range(len(s) - 1):
		xi = s[j + 1][0] - s[j][0]
		yi = s[j + 1][1] - s[j][1]
		if xi < 0 or yi < 0:
			print('NO')
			c = False
			break
		else:
			sss = 'R' * xi + 'U' * yi
			res.append(sss)
	if c == True:
		print('YES')
		print(''.join(res))


for i in range(int(input())):
	boxes = int(input())
	l_box = []
	l_box.append([0, 0])
	for j in range(boxes):
		coord = list(map(int, input().split()))
		l_box.append(coord)
	l_box = sorted(l_box, key=lambda x: (x[0], x[1]))
	ans = []
	flag = False
	for j in range(len(l_box) - 1):
		if l_box[j][1] < l_box[j + 1][1]:
			for k in range(l_box[j + 1][0] - l_box[j][0]):
				ans.append('R')
			for k in range(l_box[j + 1][1] - l_box[j][1]):
				ans.append('U')
		elif l_box[j][1] == l_box[j + 1][1]:
			for k in range(l_box[j + 1][0] - l_box[j][0]):
				ans.append('R')
			for k in range(l_box[j + 1][1] - l_box[j][1]):
				ans.append('U')
		else:
			flag = True
			print('NO')
			break
	if not flag:
		print('YES')
		print(''.join(ans))


def solve(arr):
	S = ''
	(prev_x, prev_y) = (None, None)
	for (idx, co_ordinates) in enumerate(arr):
		(x, y) = co_ordinates
		if idx == 0:
			S += 'R' * x + 'U' * y
		else:
			if y < prev_y:
				return 'NO'
			(x, y) = (x - prev_x, y - prev_y)
			S += 'R' * x + 'U' * y
		(prev_x, prev_y) = co_ordinates
	return f'YES\n{S}'
for _ in range(int(input())):
	arr = []
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		arr.append((a, b))
	print(solve(sorted(arr)))


t = int(input())
for _ in range(t):
	lis = []
	Rs = []
	Us = []
	n = int(input())
	lis.append(list(map(int, input().strip().split()))[:2])
	for k in range(n - 1):
		lis.append(list(map(int, input().strip().split()))[:2])
		j = k
		x = lis[k + 1]
		B = True
		while j > -1 and B:
			if lis[j][0] > x[0] or (lis[j][0] == x[0] and lis[j][1] > x[1]):
				lis[j + 1] = lis[j]
				j -= 1
			else:
				B = False
		lis[j + 1] = x
	for k in range(n - 1):
		Rs.append(lis[k + 1][0] - lis[k][0])
		Us.append(lis[k + 1][1] - lis[k][1])
	if all((i > -1 for i in Us)):
		s = 'R' * lis[0][0] + 'U' * lis[0][1]
		for k in range(n - 1):
			s = s + 'R' * Rs[k] + 'U' * Us[k]
		print('YES')
		print(s)
	else:
		print('NO')


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

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

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

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg

def check(string, sub_str):
	if string.find(sub_str) == -1:
		return False
	else:
		return True
mm = 1000000007

def solve():
	t = nu()
	for tt in range(t):
		n = nu()
		a = []
		for i in range(n):
			(x, y) = num()
			a.append((x, y))
		a.sort()
		cx = 0
		cy = 0
		fl = True
		ss = ''
		for i in range(n):
			x = a[i][0]
			y = a[i][1]
			if cx > x or cy > y:
				fl = False
				break
			zz = x - cx
			for i in range(zz):
				ss += 'R'
			zz = y - cy
			for i in range(zz):
				ss += 'U'
			cx = x
			cy = y
		if fl:
			print('YES')
			print(ss)
		else:
			print('NO')
solve()


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for ii in range(n):
		(c, d) = map(int, input().split())
		a.append([c, d])
	a.sort()
	(x, y) = (0, 0)
	ans = ''
	flag = True
	for (xp, yp) in a:
		if x > xp or y > yp:
			print('NO')
			flag = False
			break
		ans += 'R' * (xp - x)
		ans += 'U' * (yp - y)
		x = xp
		y = yp
	if flag:
		print('YES')
		print(ans)


for t in range(int(input())):
	(n, packages) = (int(input()), [])
	for i in range(n):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	packages.sort()
	packages.insert(0, (0, 0))
	res = ''
	for ((x1, y1), (x2, y2)) in zip(packages, packages[1:]):
		if x1 < x2 and y1 > y2:
			res = False
			break
		else:
			res += 'R' * (x2 - x1) + 'U' * (y2 - y1)
	print(f'YES\n{res}' if res != False else 'NO')


def leng(o):
	return o[0] + o[1]

def get_to(actual, f):
	r = f[0] - actual[0]
	u = f[1] - actual[1]
	if r < 0 or u < 0:
		return 'NO'
	return r * 'R' + u * 'U'
t = int(input())
for i in range(t):
	g = int(input())
	pack = [(0, 0)] * g
	for j in range(g):
		a = input().split()
		x = int(a[0])
		y = int(a[1])
		pack[j] = (x, y)
	pack.sort(key=leng)
	a = ''
	init = (0, 0)
	cont = False
	for h in range(g):
		d = get_to(init, pack[h])
		if d == 'NO':
			print(d)
			cont = True
			break
		a += d
		init = pack[h]
	if cont:
		continue
	print('YES')
	print(a)


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	ans = ''
	count = 0
	robot_cord = [0, 0]
	for i in range(n):
		a.append(list(map(int, input().split())))
	need_y = 0
	while robot_cord[0] < 1001 and count < n:
		for i in range(n):
			if a[i][0] == robot_cord[0]:
				if robot_cord[1] < a[i][1]:
					count += 1
				if a[i][1] > need_y:
					need_y = a[i][1]
		if need_y > robot_cord[1]:
			ans += 'U' * (need_y - robot_cord[1])
			robot_cord[1] = need_y
		if count < n:
			robot_cord[0] += 1
			ans += 'R'
			if robot_cord in a:
				count += 1
	if count == n:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	(N, Check) = (int(input()), True)
	Packages = sorted([tuple(map(int, input().split())) for i in range(N)])
	Answer = Packages[0][0] * 'R' + Packages[0][1] * 'U'
	for i in range(1, N):
		if Packages[i][0] < Packages[i - 1][0] or Packages[i][1] < Packages[i - 1][1]:
			Check = False
			break
		Answer += (Packages[i][0] - Packages[i - 1][0]) * 'R' + (Packages[i][1] - Packages[i - 1][1]) * 'U'
	if Check:
		print('YES', Answer, sep='\n')
		continue
	print('NO')


from operator import itemgetter
for _ in range(int(input())):
	n = int(input())
	l = [[int(s) for s in input().split()][::-1] for i in range(n)]
	l.sort()
	ans = ''
	curr = [0, 0]
	i = 0
	flag = 0
	while True:
		if i == n:
			break
		if l[i][0] < curr[0]:
			flag = 1
			break
		if l[i][1] < curr[1]:
			flag = 1
			break
		if l[i][0] == curr[0]:
			ans += 'R' * (l[i][1] - curr[1])
			curr[1] = l[i][1]
			i += 1
			continue
		if l[i][1] == curr[1]:
			ans += 'U' * (l[i][0] - curr[0])
			curr[0] = l[i][0]
			i += 1
			continue
		ans += 'R' * (l[i][1] - curr[1])
		curr[1] = l[i][1]
	if flag:
		print('NO')
	else:
		print('YES')
		print(ans)


import operator
from sys import stdin
T = int(input())
for _ in range(T):
	n = int(input())
	coord = []
	for i in range(n):
		(x, y) = map(int, input().split())
		coord.append((x, y))
	coord.sort(key=operator.itemgetter(1))
	coord.sort(key=operator.itemgetter(0))
	curr = [0, 0]
	path = ''
	zz = False
	for (i, j) in coord:
		(x, y) = curr
		if x > i or y > j:
			print('NO')
			zz = True
			break
		else:
			path += 'R' * (i - x)
			path += 'U' * (j - y)
			curr = [i, j]
	if zz:
		continue
	else:
		print('YES')
		print(path)


t = int(input())
for k in range(t):
	n = int(input())
	f = []
	for i in range(n):
		f.append(list(map(int, input().split())))
	f.sort()
	for i in range(n):
		for j in range(i, n):
			q = not (f[i][0] <= f[j][0] and f[i][1] <= f[j][1])
			if q:
				break
		if q:
			print('NO')
			break
	else:
		f.insert(0, [0, 0])
		print('YES')
		s = ''
		for i in range(1, n + 1):
			s += 'R' * (f[i][0] - f[i - 1][0])
			s += 'U' * (f[i][1] - f[i - 1][1])
		print(s)


N = int(input())
for _ in range(N):
	n = int(input())
	boxes = []
	for _ in range(n):
		inp = input().split()
		(x, y) = (int(inp[0]), int(inp[1]))
		boxes.append((x, y))
	boxes = sorted(boxes, key=lambda x: x)
	pos = (0, 0)
	res = ''
	is_good = True
	for i in range(n):
		rc = boxes[i][0] - pos[0]
		uc = boxes[i][1] - pos[1]
		if rc < 0 or uc < 0:
			is_good = False
			break
		res += rc * 'R' + uc * 'U'
		pos = boxes[i]
	if is_good:
		print(f'YES\n{res}')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	mas = []
	for j in range(n):
		mas.append(list(map(int, input().split())))
	mas.sort()
	ans = 'YES'
	s = ''
	s += mas[0][0] * 'R'
	s += mas[0][1] * 'U'
	for k in range(1, len(mas)):
		if mas[k][0] >= mas[k - 1][0] and mas[k][1] >= mas[k - 1][1]:
			s += (mas[k][0] - mas[k - 1][0]) * 'R'
			s += (mas[k][1] - mas[k - 1][1]) * 'U'
		else:
			ans = 'NO'
			break
	print(ans)
	if ans == 'YES':
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	cargo_pos = []
	for _ in range(n):
		cargo_pos.append(tuple(map(int, input().split(' '))))
	cargo_pos.append((0, 0))
	cargo_pos.sort()
	res = ''
	for i in range(n):
		(x1, y1) = cargo_pos[i]
		(x2, y2) = cargo_pos[i + 1]
		diff_x = x2 - x1
		diff_y = y2 - y1
		if diff_x < 0 or diff_y < 0:
			print('NO')
			res = ''
			break
		else:
			for _ in range(diff_x):
				res += 'R'
			for _ in range(diff_y):
				res += 'U'
	if res != '':
		print('YES')
		print(res)


t = int(input())
while t:
	t -= 1
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = tuple(map(int, input().split()))
		a.append((x, y))
	a.sort()
	s = ''
	(x, y) = (0, 0)
	flag = 0
	for i in range(n):
		(x1, y1) = a[i]
		xdiff = x1 - x
		ydiff = y1 - y
		if xdiff < 0 or ydiff < 0:
			flag = 1
			break
		s += xdiff * 'R'
		s += ydiff * 'U'
		(x, y) = (x1, y1)
	if not flag:
		print('YES')
		print(s)
	else:
		print('NO')


import math
from bisect import bisect_left, bisect_right
from sys import stdin, stdout
input = lambda : stdin.readline().strip()
print = lambda s: stdout.write(s)
t = int(input())
for _ in range(t):
	n = int(input())
	row = {}
	for i in range(1001):
		row[i] = 0
	col = {}
	for i in range(1001):
		col[i] = 0
	mat = {}
	for i in range(n):
		(a, b) = map(int, input().split())
		mat[a, b] = False
		row[a] += 1
		col[b] += 1
	cur = [0, 0]
	ans = ''
	while True:
		try:
			mat[cur[0], cur[1]] = mat[cur[0], cur[1]]
			row[cur[0]] -= 1
			col[cur[1]] -= 1
			n -= 1
		except:
			pass
		if n == 0 or cur[0] > 1000 or cur[1] > 1000:
			break
		if row[cur[0]] > 0:
			ans += 'U'
			cur[1] += 1
		else:
			ans += 'R'
			cur[0] += 1
	if n == 0:
		print('YES\n')
		print(ans + '\n')
	else:
		print('NO\n')


import heapq
t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	q = []
	ans = []
	for i in range(n):
		(x, y) = map(int, input().strip().split())
		heapq.heappush(q, (x, y))
	has = True
	(curx, cury) = (0, 0)
	while q != []:
		(sx, sy) = heapq.heappop(q)
		if cury > sy:
			has = False
			break
		for cnt in range(sx - curx):
			ans.append('R')
		curx = sx
		for cnty in range(sy - cury):
			ans.append('U')
		cury = sy
	if has:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


def f(x):
	return x[1]
t = int(input())
for zz in range(t):
	n = int(input())
	p = dict()
	for i in range(n):
		(x, y) = [int(i) for i in input().split()]
		if y not in p:
			p[y] = [x, x]
		p[y][0] = min(p[y][0], x)
		p[y][1] = max(p[y][1], x)
	cx = 0
	cy = 0
	ha = True
	s = ''
	for y in sorted(p.keys()):
		(mi, ma) = p[y]
		if cx > mi:
			ha = False
			break
		else:
			s += 'R' * (mi - cx) + 'U' * (y - cy) + 'R' * (ma - mi)
			cx = ma
			cy = y
	if ha:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [[int(x) for x in input().split()] for i in range(n)]
	a.sort()
	(x, y) = (0, 0)
	tr = 0
	for i in range(n - 1):
		if a[i][1] > a[i + 1][1]:
			tr = 1
			break
	if tr == 1:
		print('NO')
	else:
		print('YES')
		print('R' * (a[0][0] - x) + 'U' * (a[0][1] - y), end='')
		for i in range(n - 1):
			x = a[i][0]
			y = a[i][1]
			print('R' * (a[i + 1][0] - x) + 'U' * (a[i + 1][1] - y), end='')
		print('')


def calc(a, b):
	return abs(a[0] - b[0]) + abs(a[1] - b[1])

def moves(a, b):
	return (b[0] - a[0]) * 'R' + (b[1] - a[1]) * 'U'
for nt in range(int(input())):
	n = int(input())
	p = []
	for i in range(n):
		p.append(tuple(map(int, input().split())))
	p.sort()
	curr = (0, 0)
	i = 0
	ans = ''
	while i < n:
		if p[i][1] < curr[1]:
			ans = -1
			break
		ans += moves(curr, p[i])
		curr = p[i]
		i += 1
	if ans == -1:
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	a = []
	for _ in range(n):
		a.append([int(x) for x in input().split()])
	a.sort()
	(x, y) = (0, 0)
	answer = ''
	flag = True
	for l in a:
		if not (l[0] >= x and l[1] >= y):
			flag = False
			print('NO')
			break
		answer += 'R' * (l[0] - x)
		answer += 'U' * (l[1] - y)
		(x, y) = (l[0], l[1])
	if flag:
		print('YES')
		print(answer)


def solve(a, b):
	x = b[0] - a[0]
	y = b[1] - a[1]
	if x < 0 or y < 0:
		return 'null'
	return 'R' * x + 'U' * y
for t in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		(x, y) = map(int, input().split())
		arr.append((x, y))
	arr.append((0, 0))
	arr.sort()
	res = ''
	check = True
	for i in range(n):
		temp = solve(arr[i], arr[i + 1])
		if temp == 'null':
			print('NO')
			check = False
			break
		res += temp
	if check:
		print('YES')
		print(res)


t = int(input())
for tt in range(t):
	n = int(input())
	lst = []
	for i in range(n):
		(x, y) = map(int, input().split())
		lst.append((x, y))
	lst.sort()
	x = 0
	y = 0
	ans = ''
	for i in range(n):
		(xx, yy) = lst[i]
		if xx < x or y > yy:
			ans = ''
			break
		ans += 'R' * (xx - x) + 'U' * (yy - y)
		x = xx
		y = yy
	if ans == '':
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	x = 0
	y = 0
	s = ''
	for i in range(n):
		(a, b) = l[i]
		if a < x or b < y:
			print('NO')
			break
		s += 'R' * (a - x) + 'U' * (b - y)
		x = a
		y = b
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	c = []
	for _ in range(int(input())):
		(x, y) = [int(i) for i in input().split()]
		c.append([x, y])
	c.sort()
	z = 'R' * c[0][0] + 'U' * c[0][1]
	for i in range(1, len(c)):
		(a, b) = c[i - 1]
		(x, y) = c[i]
		if a > x or b > y:
			print('NO')
			break
		z += 'R' * (x - a) + 'U' * (y - b)
		(a, b) = (x, y)
	else:
		print('YES')
		print(z)


from math import sqrt

def add(n, binaryArr, arr):
	for i in range(n):
		arr.append(list(map(int, input().split())))
		binaryArr.append(0)

def lessDintace(point, n, binaryArr, arr):
	distance = 10000
	newPoint = None
	index = -1
	for i in range(1, n + 1):
		if binaryArr[i] == 1:
			continue
		else:
			value = sqrt((point[0] - arr[i][0]) ** 2 + (point[1] - arr[i][1]) ** 2)
			if value < distance:
				distance = value
				newPoint = arr[i]
				index = i
	binaryArr[index] = 1
	return newPoint

def main():
	for i in range(int(input())):
		str = ''
		bool = True
		newPoint = [0, 0]
		lastPoint = [0, 0]
		arr = [[0, 0]]
		binaryArr = [1]
		n = int(input())
		add(n, binaryArr, arr)
		for j in range(n):
			newPoint = lessDintace(lastPoint, n, binaryArr, arr)
			if newPoint[0] - lastPoint[0] < 0 or newPoint[1] - lastPoint[1] < 0:
				bool = False
				break
			else:
				str += 'R' * (newPoint[0] - lastPoint[0])
				str += 'U' * (newPoint[1] - lastPoint[1])
			lastPoint = newPoint
		if bool:
			print('YES')
			print(str)
		else:
			print('NO')
main()


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
S = lambda : input().strip()
mod = 1000000007
for i in range(I()):
	n = I()
	a = []
	for i in range(n):
		a.append(li())
	a.sort()
	s = ''
	(l, r) = (0, 0)
	f = 0
	for i in a:
		(p, q) = i
		if p < l or q < r:
			f = 1
			break
		s = s + (p - l) * 'R' + (q - r) * 'U'
		(l, r) = (p, q)
	if f == 0:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for _ in range(n):
		a += [tuple(map(int, input().split()))]
	a.sort()
	(cX, cY) = (0, 0)
	out = []
	for (x, y) in a:
		if x >= cX:
			out += ['R' * (x - cX)]
			cX = x
		else:
			break
		if y >= cY:
			out += ['U' * (y - cY)]
			cY = y
		else:
			break
	else:
		print('YES')
		print(''.join(out))
		continue
	print('NO')


n = int(input())
for i in range(n):
	m = int(input())
	s = []
	for j in range(m):
		(a, b) = input().split(' ')
		(a, b) = (int(a), int(b))
		s.append([a, b])
	s.sort(key=lambda c: (c[0], c[1]))
	flag = True
	for e in range(len(s) - 1):
		if s[e][1] <= s[e + 1][1]:
			pass
		else:
			flag = False
			break
	if flag:
		print('YES')
		x_tek = 0
		y_tek = 0
		rez = ''
		for (xt, yt) in s:
			r_time = xt - x_tek
			up_time = yt - y_tek
			rez += 'R' * r_time + 'U' * up_time
			x_tek = xt
			y_tek = yt
		print(rez)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	list1 = []
	for i in range(n):
		(x, y) = map(int, input().split())
		list1.append([x + y, x, y])
	list1.sort()
	(a, b) = (0, 0)
	str1 = ''
	for i in range(0, n):
		if list1[i][1] - a < 0 or list1[i][2] - b < 0:
			print('NO')
			break
		if list1[i][1] - a == 0 and list1[i][2] - b != 0:
			str1 = str1 + 'U' * (list1[i][2] - b)
			b = list1[i][2]
		elif list1[i][1] - a != 0 and list1[i][2] - b == 0:
			str1 = str1 + 'R' * (list1[i][1] - a)
			a = list1[i][1]
		else:
			str1 += 'R' * (list1[i][1] - a) + 'U' * (list1[i][2] - b)
			(a, b) = (list1[i][1], list1[i][2])
	else:
		print('YES')
		print(str1)


from collections import defaultdict

def solve(n, l, ans):
	ans.append('R' * l[0][0] + 'U' * l[0][1])
	(h, v) = (l[0][0], l[0][1])
	for i in range(1, n):
		if l[i][0] < h or l[i][1] < v:
			return False
		if l[i][0] > h:
			ans.append('R' * (l[i][0] - h))
			h = l[i][0]
		if l[i][1] > v:
			ans.append('U' * (l[i][1] - v))
			v = l[i][1]
	return True
for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(list(map(int, input().split())))
	l.sort()
	ans = ['']
	if not solve(n, l, ans):
		print('NO')
	else:
		print('YES')
		res = ''
		for i in ans:
			if i != '':
				res += i
		print(res)


n = int(input())
for x in range(n):
	curr = 0
	dic = {}
	point = int(input())
	for y in range(point):
		(a, b) = list(map(int, input().split()))
		if a in dic:
			dic[a].append(b)
		else:
			dic[a] = [b]
		if a > curr:
			curr = a
	initial = 0
	x = 0
	y = 0
	string = ''
	flag = 5
	while True:
		if initial in dic:
			diff = initial - x
			if diff < 0:
				flag = 6
				break
			kam = 'R' * diff
			string += kam
			maxx = max(dic[initial])
			minn = min(dic[initial])
			kam = maxx - y
			lam = minn - y
			if kam < 0 or lam < 0:
				flag = 6
				break
			else:
				string += 'U' * kam
			x = initial
			y = maxx
			initial += 1
		else:
			initial += 1
		if initial > curr:
			break
	if flag == 5:
		print('YES')
		print(string)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		(b, c) = map(int, input().split())
		a.append((b, c))
	a.sort()
	cx = 0
	cy = 0
	string = ''
	flag = 'hobe'
	for (x, y) in a:
		if cx <= x:
			string += 'R' * (x - cx)
			cx = x
		else:
			flag = 'miao'
			break
		if cy <= y:
			string += 'U' * (y - cy)
			cy = y
		else:
			flag = 'miao'
			break
	if flag == 'miao':
		print('NO')
	else:
		print('YES')
		print(string)


t = int(input())
for i in range(t):
	n = int(input())
	move = []
	for j in range(n):
		(a, b) = list(map(int, input().split()))
		move.append([a, b])
	move.sort()
	result = ''
	temp = [0, 0]
	flag = 0
	for j in range(n):
		if move[j][1] >= temp[1]:
			result += 'R' * (move[j][0] - temp[0]) + 'U' * (move[j][1] - temp[1])
			temp = move[j]
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(result)


for _ in range(int(input())):
	n = int(input())
	packs = [(0, 0)]
	for _ in range(n):
		packs.append(tuple(map(int, input().split())))
	packs = sorted(packs)
	res = ''
	for i in range(n):
		(dx, dy) = (packs[i + 1][0] - packs[i][0], packs[i + 1][1] - packs[i][1])
		if dy < 0:
			res = 'NO'
			break
		res += 'R' * dx + 'U' * dy
	if res != 'NO':
		print('YES')
		print(res)
	else:
		print(res)


for _ in range(int(input())):
	n = int(input())
	points = []
	for i in range(n):
		point = [int(x) for x in input().split()]
		points.append(point)
	points.sort()
	cp = [0, 0]
	path = ''
	f = True
	for i in range(n):
		R = points[i][0] - cp[0]
		U = points[i][1] - cp[1]
		if f and R >= 0 and (U >= 0):
			path += R * 'R' + U * 'U'
			cp = points[i].copy()
		else:
			f = False
			break
	if f:
		print('YES')
		print(path)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	pts = []
	for a in range(n):
		(x, y) = map(int, input().split())
		pts.append(tuple([x, y]))
	pts = sorted(pts, key=lambda x: (x[1], x[0]))
	le = pts[0]
	ans = ''
	ans += 'R' * le[0]
	ans += 'U' * le[1]
	np = False
	for x in pts[1:]:
		if x[0] - le[0] >= 0 and x[1] - le[1] >= 0:
			ans += 'R' * (x[0] - le[0])
			ans += 'U' * (x[1] - le[1])
			le = x
		else:
			np = True
			break
	if np:
		print('NO')
	else:
		print('YES')
		print(ans)


te = int(input())
while te > 0:
	te = te - 1
	n = int(input())
	listOfCoordinates = []
	for _ in range(n):
		(a, b) = list(map(int, input().split()))
		listOfCoordinates.append((a, b))
	listOfCoordinates.sort()
	tup = sorted(listOfCoordinates, key=lambda x: x[1])
	isPossible = 1
	ans = ''
	x = 0
	y = 0
	for i in range(n):
		diff_x = tup[i][0] - x
		diff_y = tup[i][1] - y
		if diff_x < 0 or diff_y < 0:
			isPossible = 0
			break
		else:
			while diff_x > 0:
				diff_x -= 1
				ans += 'R'
			while diff_y > 0:
				diff_y -= 1
				ans += 'U'
		x = tup[i][0]
		y = tup[i][1]
	if isPossible == 0:
		print('NO')
	else:
		print('YES')
		print(ans)


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		li = []
		for j in range(n):
			li.append([int(k) for k in input().split()])
		b = True
		li.sort()
		try:
			for k in range(n):
				for l in range(n):
					if li[k][0] < li[l][0] and li[k][1] > li[l][1]:
						b = False
						raise EOFError
		except EOFError:
			pass
		if not b:
			print('NO')
			continue
		else:
			print('YES')
			x = 0
			y = 0
			k = 0
			while True:
				if k == n:
					break
				while x < li[k][0]:
					print('R', end='')
					x += 1
				while y < li[k][1]:
					print('U', end='')
					y += 1
				k += 1
		print()
main()


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = input().split()
		x = int(x)
		y = int(y)
		l.append([x, y])
	l.sort()
	out = ''
	out = out + 'R' * l[0][0] + 'U' * l[0][1]
	for i in range(1, n):
		if l[i][0] >= l[i - 1][0] and l[i][1] >= l[i - 1][1]:
			out = out + 'R' * (l[i][0] - l[i - 1][0]) + 'U' * (l[i][1] - l[i - 1][1])
		else:
			out = 'NO'
			break
	if out != 'NO':
		print('YES')
		print(out)
	if out == 'NO':
		print('NO')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_int = lambda : int(sys.stdin.readline())
for _ in range(get_int()):
	n = get_int()
	matrix = sorted([get_list() for i in range(n)])
	res = ''
	(x, y) = (0, 0)
	valid = True
	for i in range(n):
		(a, b) = matrix[i]
		if a - x >= 0 and b - y >= 0:
			res += 'R' * (a - x) + 'U' * (b - y)
			(x, y) = (a, b)
		else:
			valid = False
			break
	if valid:
		print('YES')
		print(res)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = [list(map(int, input().split())) for i in range(n)]
	flag = True
	arr = []
	for i in range(n):
		arr.append(sum(l[i]))
	l.sort(key=lambda x: (x[0], x[1]))
	flag = True
	for i in range(n - 1):
		if l[i + 1][0] - l[i][0] < 0 or l[i + 1][1] - l[i][1] < 0:
			flag = False
			break
	if not flag:
		print('NO')
	else:
		ans = ''
		x = 0
		y = 0
		for i in range(n):
			if i == 0:
				ans += 'R' * l[i][0]
				x += l[i][0]
				ans += 'U' * l[i][1]
				y += l[i][1]
			else:
				if l[i][0] == l[i - 1][0]:
					ans += 'U' * (l[i][1] - l[i - 1][1])
					y += l[i][1] - l[i - 1][1]
				else:
					ans += 'R' * (l[i][0] - l[i - 1][0])
					x += l[i][0] - l[i - 1][0]
				if y != l[i][1]:
					ans += 'U' * (l[i][1] - y)
					y += l[i][1] - y
		print('YES')
		print(ans)


n = int(input())
for i in range(n):
	a = [[0, 0]]
	f = False
	s = ''
	m = int(input())
	for j in range(m):
		a.append([int(x) for x in input().split()])
	a.sort(key=lambda y: (y[0], y[1]))
	for j in range(1, len(a)):
		if a[j][0] == a[j - 1][0] and a[j][1] > a[j - 1][1] or (a[j][0] > a[j - 1][0] and a[j][1] == a[j - 1][1]) or (a[j][0] > a[j - 1][0] and a[j][1] > a[j - 1][1]):
			if a[j][0] == a[j - 1][0]:
				s += 'U' * (a[j][1] - a[j - 1][1])
			elif a[j][1] == a[j - 1][1]:
				s += 'R' * (a[j][0] - a[j - 1][0])
			else:
				s += 'R' * (a[j][0] - a[j - 1][0]) + 'U' * (a[j][1] - a[j - 1][1])
		else:
			print('NO')
			f = True
			break
	if f:
		continue
	else:
		print('YES\n%s' % s)


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	for j in range(n):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.sort(key=lambda q: q[0] + q[1])
	ok = True
	for i in range(len(a) - 1):
		if a[i][0] <= a[i + 1][0] and a[i][1] <= a[i + 1][1]:
			continue
		ok = False
	if ok:
		print('YES')
		path = ''
		a = [[0, 0]] + a
		for i in range(len(a) - 1):
			path += 'R' * (a[i + 1][0] - a[i][0])
			path += 'U' * (a[i + 1][1] - a[i][1])
		print(path)
	else:
		print('NO')


for _ in range(int(input())):
	ans = ''
	flag = 1
	s = int(input())
	store = {}
	for i in range(s):
		(x1, y1) = map(int, input().split())
		if store.get(x1) == None:
			store[x1] = []
			store[x1].append(y1)
		else:
			store[x1].append(y1)
	(x, y) = (0, 0)
	prev = 0
	for k in sorted(store.keys()):
		if y <= min(store[k]):
			ans += 'R' * (k - x)
			ans += 'U' * (max(store[k]) - y)
			x = k
			y = max(store[k])
		else:
			print('NO')
			flag = 0
			break
	if flag:
		print('YES')
		print(ans)


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	arr = []
	for i in range(n):
		(x, y) = map(int, stdin.readline().split())
		arr.append([x, y])
	arr = sorted(arr, key=lambda x: (x[0], x[1]))
	(a, b) = (0, 0)
	m = ''
	i = 0
	cond = True
	while i < n:
		if arr[i][0] < a or arr[i][1] < b:
			cond = False
			break
		m += 'R' * (arr[i][0] - a)
		m += 'U' * (arr[i][1] - b)
		a = arr[i][0]
		b = arr[i][1]
		i += 1
	if cond == True:
		print('YES')
		print(m)
		continue
	print('NO')


for _ in range(int(input())):
	n = int(input())
	inp = []
	res = ''
	for i in range(n):
		(x, y) = map(int, input().split())
		inp.append([x, y])
	inp.sort()
	(X, Y) = (0, 0)
	for i in inp:
		if i[0] - X >= 0 and i[1] - Y >= 0:
			res += 'R' * (i[0] - X) + 'U' * (i[1] - Y)
		else:
			res = 'fuck'
		(X, Y) = (i[0], i[1])
	if 'fuck' in res:
		print('NO')
	else:
		print('YES')
		print(res)


from sys import stdin
from _collections import deque
mod = 10 ** 9 + 7
import sys
sys.setrecursionlimit(10 ** 5)
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from _collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
t = int(input())
for _ in range(t):
	n = int(input())
	la = []
	for i in range(n):
		(a, b) = map(int, input().split())
		la.append([a, b])
	la.sort()
	flag = 0
	for i in range(1, n):
		if la[i][1] < la[i - 1][1]:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		(x1, y1) = (0, 0)
		ans = []
		while la != []:
			(x, y) = la.pop(0)
			z1 = x - x1
			z2 = y - y1
			for i in range(z1):
				ans.append('R')
			for i in range(z2):
				ans.append('U')
			(x1, y1) = (x, y)
		print('YES')
		print(''.join(ans))


t = int(input())
for i in range(t):
	n = int(input())
	l = [[0 for i in range(2)] for j in range(n)]
	for j in range(n):
		l[j] = list(map(int, input().split()))
	l.sort()
	s = ''
	(x, y) = (0, 0)
	c = [0] * n
	for j in range(n):
		s = s + (l[j][0] - x) * 'r'
		if l[j][0] - x < 0:
			break
		x = l[j][0]
		s = s + (l[j][1] - y) * 'u'
		if l[j][1] - y < 0:
			break
		y = l[j][1]
		c[j] = 1
	if c == [1] * n:
		print('YES')
		print(s.upper())
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	l = []
	for j in range(n):
		(x, y) = map(int, input().split())
		ele = [x, y]
		l.append(ele)
	l.sort()
	s = ''
	st = 0
	en = 0
	flag = True
	for k in range(n):
		if l[k][0] - st < 0 or l[k][1] - en < 0:
			flag = False
			break
		else:
			s = s + ('R' * (l[k][0] - st) + 'U' * (l[k][1] - en))
			st = l[k][0]
			en = l[k][1]
	if flag:
		print('YES')
		print(s)
	else:
		print('NO')


import sys
import math
from collections import defaultdict, Counter
import operator
input = sys.stdin.readline

def print(x):
	sys.stdout.write(str(x) + '\n')
t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for j in range(n):
		(x, y) = map(int, input().split())
		l.append([x, y])
	l = sorted(l, key=operator.itemgetter(0, 1))
	ans = ''
	prev = [0, 0]
	for j in l:
		if j[0] < prev[0] or j[1] < prev[1]:
			print('NO')
			break
		ans += (j[0] - prev[0]) * 'R'
		ans += (j[1] - prev[1]) * 'U'
		prev = j
	else:
		print('YES')
		print(ans)


T = int(input())
for z in range(T):
	N = int(input())
	lst = []
	for k in range(N):
		lst.append(list(map(int, input().split())))
	lst.sort()
	path = ''
	flag = True
	(curr_x, curr_y) = (0, 0)
	for i in range(len(lst)):
		if lst[i][0] >= curr_x and lst[i][1] >= curr_y:
			path += 'R' * (lst[i][0] - curr_x)
			path += 'U' * (lst[i][1] - curr_y)
			curr_x = lst[i][0]
			curr_y = lst[i][1]
		else:
			flag = False
			break
	if flag:
		print('YES')
		print(path)
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	l = list()
	flst = list()
	c2 = 0
	ri = 0
	ui = 0
	for i in range(n):
		(x, y) = [int(num) for num in input().split()]
		lst = [x, y]
		l.append(lst)
	lst2 = sorted(l, key=lambda k: [k[0], k[1]])
	for i in range(len(lst2) - 1):
		c = lst2[i]
		c1 = lst2[i + 1]
		if c[0] > c1[0] or c[1] > c1[1]:
			print('NO')
			c2 = 1
			break
	if c2 == 1:
		continue
	else:
		print('YES')
		for i in range(len(lst2)):
			c = lst2[i]
			l1 = ['R'] * (c[0] - ri)
			ri = c[0]
			l2 = ['U'] * (c[1] - ui)
			ui = c[1]
			flst = flst + l1 + l2
		print(*flst, sep='')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = list(map(int, input().split()))[0]
	arr = []
	for _ in range(n):
		a = list(map(int, input().split()))
		arr.append(a)
	arr.sort()
	(i, j) = (0, 0)
	ans = ''
	for (m, n) in arr:
		if m >= i and n >= j:
			ans += 'R' * abs(m - i)
			ans += 'U' * abs(n - j)
			i = m
			j = n
		else:
			print('NO')
			break
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	from collections import defaultdict
	a = defaultdict(list)
	b = set()
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		a[x].append(y)
		b.add(x)
	b = list(b)
	for i in a:
		a[i].sort()
	b.sort()
	(l, p, q) = (0, 0, 0)
	s = ''
	for i in b:
		k = a[i]
		s += 'R' * (i - l)
		l = i
		for j in k:
			if j < p:
				q = q + 1
				break
			else:
				s += 'U' * (j - p)
				p = j
		if q == 1:
			break
	if q == 1:
		print('NO')
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	m1 = []
	m2 = []
	s = ''
	for x in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	for x in l:
		m1.append(x[1])
		m2.append(x[1])
	m1.sort()
	if m1 != m2:
		print('NO')
		continue
	print('YES')
	(nowx, nowy) = (0, 0)
	for pos in l:
		if pos[0] != nowx:
			temp = pos[0] - nowx
			s += 'R' * temp
			nowx += temp
		if pos[1] != nowy:
			temp = pos[1] - nowy
			s += 'U' * temp
			nowy += temp
	print(s)


for _ in range(int(input())):
	n = int(input())
	arr = [list(map(int, input().split())) for i in range(n)]
	arr.sort()
	(x, y) = (0, 0)
	s = str()
	t = True
	for i in arr:
		(a, b) = (i[0], i[1])
		if a >= x and b >= y:
			s += (a - x) * 'R' + (b - y) * 'U'
			(x, y) = (a, b)
		else:
			t = False
			break
	if t:
		print('YES')
		print(s)
	else:
		print('NO')


def can(x1, x2, y1, y2):
	if x2 - x1 >= 0 and y2 - y1 >= 0:
		return True
	return False
t = int(input())
for i in range(t):
	n = int(input())
	a = [list(map(int, input().split())) for j in range(n)]
	a.sort()
	(lx, ly) = (0, 0)
	ok = True
	s = ''
	for j in range(n):
		if not can(lx, a[j][0], ly, a[j][1]):
			ok = False
			break
		for k in range(lx, a[j][0]):
			s += 'R'
		for k in range(ly, a[j][1]):
			s += 'U'
		lx = a[j][0]
		ly = a[j][1]
	if not ok:
		print('NO')
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	pkg = []
	for i in range(n):
		pkg.append(list(map(int, input().split())))
	pkg.sort(key=lambda x: (x[0], x[1]))
	s = ''
	x = 0
	y = 0
	flag = 1
	for i in pkg:
		if x - i[0] > 0 or y - i[1] > 0:
			print('NO')
			flag = 0
			break
		for j in range(i[0] - x):
			s += 'R'
		for j in range(i[1] - y):
			s += 'U'
		x = i[0]
		y = i[1]
	if flag:
		print('YES')
		print(s)


t = int(input())
for zzzz in range(t):
	n = int(input())
	myPos = [0, 0]
	myPacksX = []
	myPacksY = []
	maxD = 0
	path = ''
	for i in range(n):
		(a, b) = map(int, input().split())
		myPacksX.append(a)
		myPacksY.append(b)
		maxD = max(a + b, maxD)
		flag = False
	for i in range(maxD):
		if myPos[0] in myPacksX and myPos[1] in myPacksY:
			flag = True
		elif myPos[0] in myPacksX:
			myPos[1] += 1
			path += 'U'
			for pt in range(len(myPacksX)):
				if myPos[0] == myPacksX[pt] and myPos[1] == myPacksY[pt]:
					myPacksX.pop(pt)
					myPacksY.pop(pt)
					break
		elif myPos[1] in myPacksY:
			myPos[0] += 1
			path += 'R'
			for pt in range(len(myPacksX)):
				if myPos[0] == myPacksX[pt] and myPos[1] == myPacksY[pt]:
					myPacksX.pop(pt)
					myPacksY.pop(pt)
					break
		else:
			myPos[0] += 1
			path += 'R'
		if flag:
			break
	if flag:
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
for h in range(t):
	n = int(input())
	cor = []
	for i in range(n):
		(x, y) = map(int, input().split())
		cor.append((x, y))
	cor = sorted(cor, key=lambda k: [k[0], k[1]])
	(x, y) = (0, 0)
	ans = str()
	for i in range(n):
		if cor[i][0] < x:
			ans = '*'
			break
		while x < cor[i][0]:
			x += 1
			ans += 'R'
		if cor[i][1] < y:
			ans = '*'
			break
		while y < cor[i][1]:
			y += 1
			ans += 'U'
	print('NO' if ans == '*' else 'YES\n' + ans)


for _ in range(int(input())):
	n = int(input())
	k = []
	for i in range(n):
		k.append(list(map(int, input().split())))
	k.sort()
	flag = 0
	m = []
	s = ''
	s += 'R' * (k[0][0] - 0)
	s += 'U' * (k[0][1] - 0)
	m.append(s)
	for i in range(n - 1):
		s = ''
		dif1 = k[i + 1][0] - k[i][0]
		s += 'R' * dif1
		dif2 = k[i + 1][1] - k[i][1]
		s += 'U' * dif2
		if dif1 < 0 or dif2 < 0:
			flag = 1
			break
		else:
			m.append(s)
	if flag == 1:
		print('NO')
	else:
		print('YES')
		for i in m:
			print(i, end='')
		print(end='\n')


t = int(input())
lst = []
for i in range(t):
	n = int(input())
	lst.append([])
	for j in range(n):
		(x, y) = map(int, input().split())
		lst[i].append([x, y])
for i in range(t):
	l = lst[i]
	n = len(lst[i])
	l.sort()
	s = ''
	x = 0
	y = 0
	for m in range(n):
		if m == 0:
			x = l[m][0]
			y = l[m][1]
		else:
			x = l[m][0] - l[m - 1][0]
			y = l[m][1] - l[m - 1][1]
		for j in range(x):
			s = s + 'R'
		for k in range(y):
			s = s + 'U'
		if x < 0 or y < 0:
			print('NO')
			break
		elif m == n - 1:
			print('YES')
			print(s)


from sys import *
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
for _ in range(int(input())):
	n = int(input())
	path = []
	for i in range(n):
		path.append(int_arr())
	path.sort(key=lambda x: x[0])
	path.sort()
	ans = [0, 0]
	st = ''
	(prevx, prevy) = (0, 0)
	for i in range(n):
		if ans[0] < path[i][0] and path[i][0] >= prevx and (path[i][1] >= prevy):
			st += 'R' * (path[i][0] - ans[0])
			ans[0] = path[i][0]
		if ans[1] < path[i][1] and path[i][0] >= prevx and (path[i][1] >= prevy):
			st += 'U' * (path[i][1] - ans[1])
			ans[1] = path[i][1]
		elif ans[0] > path[i][0] or ans[1] > path[i][1] or path[i][0] < prevx or (path[i][1] < prevy):
			break
		(prevx, prevy) = (ans[0], ans[1])
	if ans == path[-1]:
		print('YES')
		print(st)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	packs = [tuple(map(int, input().split())) for _ in range(n)]
	packs.sort(key=lambda p: p[1])
	packs.sort(key=lambda p: p[0])
	(x, y) = (0, 0)
	out = ''
	for (nx, ny) in packs:
		if nx < x or ny < y:
			print('NO')
			break
		else:
			out += 'R' * (nx - x) + 'U' * (ny - y)
			(x, y) = (nx, ny)
	else:
		print('YES')
		print(out)


t = int(input())

def check(arr, c):
	a = []
	ii = 0
	jj = 0
	for i in c:
		if i == 'R':
			ii += 1
		else:
			jj += 1
		a.append([ii, jj])
	for i in arr:
		if i not in a:
			return False
	return True
for _ in range(t):
	arr = []
	d = dict()
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		arr.append([a, b])
		d[a] = []
	arr.sort()
	for i in arr:
		d[i[0]].append(i[1])
	c = ''
	so = sorted(d.keys())
	p1 = so[0]
	c += 'R' * p1
	p2 = max(d[so[0]])
	c += 'U' * p2
	temp = 0
	for i in so[1:]:
		ii = i - p1
		p1 = i
		c += 'R' * ii
		ma = max(d[i])
		maa = ma - p2
		p2 = ma
		c += 'U' * maa
		if maa < 0 or ii < 0:
			temp = 1
	if temp == 1:
		print('NO')
	elif check(arr, c):
		print('YES')
		print(c)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = []
	for __ in range(n):
		(x, y) = map(int, input().split())
		l.append([x, y])
	l = sorted(l, key=lambda k: [k[0], k[1]])
	ans = ''
	flag = 0
	(x, y) = (0, 0)
	for i in l:
		if i[0] < x or i[1] < y:
			flag = 1
			break
		while x != i[0] or y != i[1]:
			if i[0] > x:
				ans += 'R'
				x += 1
			elif i[0] == x and i[1] > y:
				ans += 'U'
				y += 1
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		N = int(input())
		XY = [tuple(map(int, input().split())) for _ in [0] * N]
		XY.sort(key=lambda x: x[1])
		XY.sort(key=lambda x: x[0])
		XY = [(0, 0)] + XY
		ans = ''
		for i in range(N):
			if XY[i][0] > XY[i + 1][0] or XY[i][1] > XY[i + 1][1]:
				print('NO')
				break
			else:
				ans += (XY[i + 1][0] - XY[i][0]) * 'R'
				ans += (XY[i + 1][1] - XY[i][1]) * 'U'
		else:
			print('YES')
			print(ans)
main()


for i in range(int(input())):
	n = int(input())
	a = []
	for j in range(n):
		a.append(list(map(int, input().split())))
	a.sort()
	x = a[0][0]
	y = a[0][1]
	f = 0
	s = 'R' * x + 'U' * y
	for i in a[1:]:
		if i[0] > x and i[1] < y:
			print('NO')
			f = 1
			break
		else:
			s += abs(i[0] - x) * 'R' + abs(i[1] - y) * 'U'
			x = i[0]
			y = i[1]
	if f == 0:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	coords = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		coords += [(x, y)]
	coords.sort()
	r = coords[0][0] * 'R' + coords[0][1] * 'U'
	for i in range(n - 1):
		r += (coords[i + 1][0] - coords[i][0]) * 'R' + (coords[i + 1][1] - coords[i][1]) * 'U'
		if coords[i][1] > coords[i + 1][1]:
			print('NO')
			break
	else:
		print('YES')
		print(r)


import functools
t = int(input())
for i in range(t):
	lst = []
	s = ''
	x = 0
	y = 0
	flag = True
	n = int(input())
	for j in range(n):
		values = input()
		values = values.split(' ')
		a = int(values[0])
		b = int(values[1])
		lst.append((a, b))
	lst = sorted(lst, key=lambda temp: (temp[0], temp[1]))
	for u in lst:
		if u[0] - x < 0 or u[1] - y < 0:
			print('NO')
			flag = False
			break
		else:
			for k in range(u[0] - x):
				s = s + 'R'
			for l in range(u[1] - y):
				s = s + 'U'
			x = u[0]
			y = u[1]
	if flag == True:
		print('YES')
		print(s)


def solve(n, xy):
	(x, y) = xy[0]
	res = ''
	while x > 0:
		res += 'R'
		x -= 1
	while y > 0:
		res += 'U'
		y -= 1
	(x, y) = xy[0]
	for i in range(1, n):
		(xx, yy) = xy[i]
		if xx < x or yy < y:
			return 'NO'
		while xx > x:
			res += 'R'
			x += 1
		while yy > y:
			res += 'U'
			y += 1
	return res
for _ in range(int(input())):
	n = int(input())
	xy = []
	for i in range(n):
		xy.append(list(map(int, input().split())))
	xy.sort(key=lambda x: [x[0], x[1]])
	t = solve(n, xy)
	if t == 'NO':
		print('NO')
	else:
		print('YES')
		print(t)


from functools import cmp_to_key
for case in range(int(input())):
	n = int(input())
	flg = True
	s = []
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		s.append((x, y))
	s = sorted(s, key=cmp_to_key(lambda a, b: a[1] - b[1] if a[0] == b[0] else a[0] - b[0]))
	(xx, yy) = (0, 0)
	ans = ''
	for t in s:
		if t[0] < xx or t[1] < yy:
			flg = False
			break
		ans += 'R' * (t[0] - xx) + 'U' * (t[1] - yy)
		(xx, yy) = (t[0], t[1])
	print('YES\n' + ans if flg else 'NO')


for _ in range(int(input())):
	n = int(input())
	ar = []
	for _____ in range(n):
		ar.append(list(map(int, input().split())))
	ar.sort(key=lambda x: (x[0] ** 2 + x[1] ** 2) ** 0.5)
	ans = 'YES'
	(x, y) = (0, 0)
	kek = ''
	for i in range(n):
		if x > ar[i][0] or y > ar[i][1]:
			ans = 'NO'
			break
		while x < ar[i][0]:
			x += 1
			kek += 'R'
		while y < ar[i][1]:
			y += 1
			kek += 'U'
	print(ans)
	if ans == 'YES':
		print(kek)


T = int(input())
for kase in range(T):
	lis = []
	n = int(input())
	ans = ''
	for i in range(n):
		t = [int(x) for x in input().split()]
		lis.append((t[0], t[1]))
	lis.sort()
	now = (0, 0)
	for p in lis:
		ans += 'R' * (p[0] - now[0])
		ans += 'U' * (p[1] - now[1])
		if p[1] < now[1]:
			ans = -1
			break
		else:
			now = p
	if ans != -1:
		print('YES')
		print(ans)
	else:
		print('NO')


for t in range(int(input())):
	n = int(input())
	packs = []
	for i in range(n):
		(x, y) = (int(i) for i in input().split())
		packs.append((x, y))
	packs.sort()
	(x0, y0) = (0, 0)
	d = False
	out = ''
	for i in range(n):
		if packs[i][0] < x0 or packs[i][1] < y0:
			print('NO')
			d = True
			break
		else:
			out += 'R' * (packs[i][0] - x0)
			out += 'U' * (packs[i][1] - y0)
		(x0, y0) = packs[i]
	if not d:
		print('YES')
		print(out)


results = []
for _ in range(int(input())):
	packages = []
	for _ in range(int(input())):
		(x, y) = [int(i) for i in input().split()]
		packages.append((x, y))
	packages.sort(key=lambda t: t[0] + t[1])
	(curr_x, curr_y) = (0, 0)
	res = ''
	for (i, p) in enumerate(packages):
		if p[0] < curr_x or p[1] < curr_y:
			results.append('NO')
			break
		res += 'R' * (p[0] - curr_x)
		res += 'U' * (p[1] - curr_y)
		(curr_x, curr_y) = (p[0], p[1])
		if i == len(packages) - 1:
			results.append('YES')
			results.append(res)
for r in results:
	print(r)


for _ in range(int(input())):
	n = int(input())
	points = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		points.append([x, y])
	points.sort()
	flag = True
	for i in range(1, n):
		if points[i][1] < points[i - 1][1]:
			flag = False
			break
	if flag:
		print('YES')
		res = ''
		(x, y) = (0, 0)
		for point in points:
			res += (point[0] - x) * 'R' + (point[1] - y) * 'U'
			x = point[0]
			y = point[1]
		print(res)
	else:
		print('NO')


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
for _ in range(int(input())):
	n = int(input())
	packages = []
	for _ in range(n):
		packages.append([int(x) for x in input().split()])
	packages.sort()
	instructions = ''
	pos = [0, 0]
	possible = True
	for package in packages:
		if package[0] - pos[0] < 0:
			possible = False
			break
		elif package[1] - pos[1] < 0:
			possible = False
			break
		instructions += 'R' * (package[0] - pos[0]) + 'U' * (package[1] - pos[1])
		pos = package.copy()
	if possible:
		print('YES')
		print(instructions)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.insert(0, [0, 0])
	a.sort()
	s = ''
	ok = True
	for i in range(len(a) - 1):
		if a[i][0] > a[i + 1][0] or a[i][1] > a[i + 1][1]:
			ok = False
	if ok:
		for i in range(len(a) - 1):
			s += (a[i + 1][0] - a[i][0]) * 'R'
			s += (a[i + 1][1] - a[i][1]) * 'U'
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	P = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		P.append([x + y, x, y])
	P.sort()
	(x, y) = (0, 0)
	ans = 'YES\n'
	for p in P:
		(n, nx, ny) = p
		if nx < x or ny < y:
			ans = 'NO'
			break
		ans += 'R' * (nx - x) + 'U' * (ny - y)
		(x, y) = (nx, ny)
	print(ans)


import operator

def main():
	for _ in range(int(input())):
		cx = cy = 0
		ret = ''
		packages = []
		for _ in range(int(input())):
			packages.append(tuple(map(int, input().split())))
		is_solved = True
		packages = sorted(packages, key=operator.itemgetter(0, 1))
		for (x, y) in packages:
			if x > cx:
				ret += 'R' * (x - cx)
				cx = x
			elif x < cx:
				is_solved = False
				break
			if y > cy:
				ret += 'U' * (y - cy)
				cy = y
			elif y < cy:
				is_solved = False
				break
		if not is_solved:
			print('NO')
			continue
		print('YES')
		print(ret)
main()


results = []
for i in range(0, int(input())):
	points = []
	points.append([0, 0])
	condition = True
	resultstring = ''
	for i in range(0, int(input())):
		newpoint = input().split()
		newpoint = [int(i) for i in newpoint]
		points.append(newpoint)
	points.sort()
	for i in range(0, len(points) - 1):
		if not (points[i][0] <= points[i + 1][0] and points[i][1] <= points[i + 1][1]):
			results.append('NO')
			condition = False
			break
		else:
			resultstring += 'R' * (points[i + 1][0] - points[i][0]) + 'U' * (points[i + 1][1] - points[i][1])
	if condition:
		results.append('YES')
		results.append(resultstring)
for i in results:
	print(i)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	l = []
	ans = ''
	for _ in range(n):
		l += [list(map(int, stdin.readline().split()))]
	l.sort(key=lambda x: (x[0], x[1]))
	x = y = 0
	for [x1, y1] in l:
		dy = y1 - y
		dx = x1 - x
		if dy < 0 or dx < 0:
			ans = ''
			break
		ans += 'R' * dx + 'U' * dy
		(x, y) = (x1, y1)
	if ans:
		print('YES')
		print(ans)
	else:
		print('NO')


def arr_inp(n):
	if n == 1:
		return [int(x) for x in stdin.readline().split()]
	elif n == 2:
		return [float(x) for x in stdin.readline().split()]
	else:
		return [str(x) for x in stdin.readline().split()]
from sys import stdin
from operator import itemgetter
for i in range(int(input())):
	(n, out) = (int(input()), [])
	arr = sorted([arr_inp(1) for j in range(n)], key=itemgetter(0, 1))
	(ini, flag) = ([0, 0], 'YES')
	for (x, y) in arr:
		if x >= ini[0] and y >= ini[1]:
			out.extend(['R' for k in range(x - ini[0])])
			out.extend(['U' for k in range(y - ini[1])])
			ini = [x, y]
		else:
			flag = 'NO'
			break
	print(flag)
	if flag == 'YES':
		print(''.join(out))


T = int(input())
for _ in range(T):
	n = int(input())
	arr = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		arr.append([x, y])
	arr = sorted(arr, key=lambda x: (x[0], x[1]))
	(x, y) = (0, 0)
	ans = ''
	flag = True
	for i in range(n):
		(a, b) = (arr[i][0], arr[i][1])
		if x > a:
			flag = False
			break
		if y > b:
			flag = False
			break
		if x < a:
			ans += 'R' * (a - x)
		if y < b:
			ans += 'U' * (b - y)
		(x, y) = (a, b)
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	for i in range(n):
		b = []
		(x, y) = map(int, input().split())
		b.append(x)
		b.append(y)
		a.append(b)
	a.sort()
	s = ''
	x = 0
	y = 0
	f = 0
	for i in range(len(a)):
		x1 = a[i][0]
		y1 = a[i][1]
		if x1 - x >= 0 and y1 - y >= 0:
			for j in range(x1 - x):
				s = s + 'R'
			for k in range(y1 - y):
				s = s + 'U'
		else:
			f = 1
			break
		x = x1
		y = y1
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for queries in range(t):
	no_of_packages = int(input())
	array = []
	array2 = ''
	x = 0
	y = 0
	Danger = True
	for i in range(no_of_packages):
		(a, b) = list(map(int, input().split()))
		array.append((a, b))
	array.sort()
	for (a, b) in array:
		if x < a:
			array2 += (a - x) * 'R'
		if y < b:
			array2 += (b - y) * 'U'
		if x > a or y > b:
			Danger = False
		x = a
		y = b
	if Danger == False:
		print('NO')
	else:
		print('YES')
		print(array2)


for _ in range(int(input())):
	lt = []
	n = int(input())
	for l in range(n):
		lt.append(tuple(map(int, input().split())))
	lt.append((0, 0))
	lt = sorted(lt, key=lambda k: k[1])
	lt = sorted(lt, key=lambda k: k[0])
	st = ''
	for i in range(n):
		if lt[i][0] != lt[i + 1][0] and lt[i][1] > lt[i + 1][1]:
			print('NO')
			break
		if lt[i][0] <= lt[i + 1][0] and lt[i][1] <= lt[i + 1][1]:
			st += 'R' * (lt[i + 1][0] - lt[i][0])
			st += 'U' * (lt[i + 1][1] - lt[i][1])
	else:
		print('YES')
		print(st)


for _ in range(int(input())):
	n = int(input())
	l1 = []
	s = ''
	u = ''
	for i in range(n):
		l1.append(list(map(int, input().split())))
	l1.sort()
	a = [0, 0]
	for i in range(n):
		if l1[i][0] < a[0] or l1[i][1] < a[1]:
			print('NO')
			break
		else:
			s += 'R' * (l1[i][0] - a[0])
			s += 'U' * (l1[i][1] - a[1])
		a = l1[i]
	else:
		print('YES')
		print(s)


for x in range(int(input())):
	(d, m, n, f, c, r) = ({}, [], [], 0, 0, 0)
	for y in range(int(input())):
		(a, b) = map(int, input().split())
		if b not in m:
			m.append(b)
			d[b] = [a]
		else:
			d[b].append(a)
	m.sort()
	for y in range(len(m) - 1):
		if min(d[m[y + 1]]) < max(d[m[y]]):
			f = 1
			break
		else:
			n.append('R' * (min(d[m[y]]) - c))
			n.append('U' * (int(m[y]) - r))
			n.append('R' * (max(d[m[y]]) - min(d[m[y]])))
		r = int(m[y])
		c = max(d[m[y]])
	n.append('R' * (min(d[m[-1]]) - c))
	n.append('U' * (int(m[-1]) - r))
	n.append('R' * (max(d[m[-1]]) - min(d[m[-1]])))
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(''.join(n))


t = int(input())
for x in range(t):
	n = int(input())
	d = {}
	an = []
	miny = 0
	for p in range(n):
		(x, y) = map(int, input().split())
		if x not in d:
			an.append(x)
			d[x] = [y]
		else:
			d[x].append(y)
	an.sort()
	ans = []
	px = 0
	py = 0
	check = 0
	for ele in an:
		if miny > min(d[ele]):
			print('NO')
			check = 1
			break
		while px < ele:
			ans.append('R')
			px += 1
		anyy = d[ele]
		for elem in anyy:
			while py < elem:
				ans.append('U')
				py += 1
				if miny < py:
					miny = py
	if check != 1:
		print('YES')
		print(''.join(ans))


from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline()

def sieve(x):
	a = [True] * (x + 1)
	sq = floor(sqrt(x))
	for i in range(3, sq + 1, 2):
		if a[i]:
			for j in range(i * i, x + 1, i):
				a[j] = False
	if x > 1:
		p = [2]
	else:
		p = []
	for i in range(3, x + 1, 2):
		if a[i]:
			p.append(i)
	return p
for _ in range(ii()):
	n = ii()
	a = []
	for _ in range(n):
		(p, q) = mi()
		a.append([p, q])
	a.sort()
	x = y = 0
	s = []
	f = 0
	for i in range(n):
		r = a[i][0] - x
		u = a[i][1] - y
		if r < 0 or u < 0:
			f = 1
			break
		x = a[i][0]
		y = a[i][1]
		s.append('R' * r)
		s.append('U' * u)
	if f:
		print('NO')
	else:
		print('YES')
		print(*s, sep='')


for _ in range(int(input())):
	n = int(input())
	arr = []
	for _ in range(n):
		arr.append([int(i) for i in input().split()])
	arr.sort()
	trav = ''
	(yl, xl) = (0, 0)
	for (x, y) in arr:
		if xl > x or yl > y:
			print('NO')
			break
		for _ in range(xl, x):
			trav += 'R'
		for _ in range(yl, y):
			trav += 'U'
		(yl, xl) = (y, x)
	else:
		print('YES')
		print(trav)


t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	curr = [0, 0]
	coords = [[0] * 2 for i in range(n)]
	path = ''
	for i in range(n):
		v = [int(x) for x in input().split(' ')]
		coords[i][0] = v[0]
		coords[i][1] = v[1]
	coords.sort()
	found = False
	for point in coords:
		if curr[0] > point[0] or curr[1] > point[1]:
			found = False
			break
		while curr[0] < point[0]:
			curr[0] += 1
			path += 'R'
		while curr[1] < point[1]:
			curr[1] += 1
			path += 'U'
		found = True
	if found:
		print('YES')
		print(path)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append((x, y))
	l.sort()
	flag = 1
	ans = []
	ans.append((l[0][0] - 0) * 'R')
	ans.append((l[0][1] - 0) * 'U')
	for i in range(n - 1):
		if l[i][0] <= l[i + 1][0] and l[i][1] <= l[i + 1][1]:
			ans.append((l[i + 1][0] - l[i][0]) * 'R')
			ans.append((l[i + 1][1] - l[i][1]) * 'U')
			continue
		else:
			flag = -1
			break
	if flag == 1:
		print('YES')
		print(*ans, sep='')
	else:
		print('NO')


t = int(input())
while t:
	l = []
	n = int(input())
	for i in range(n):
		(x, y) = input().split(' ')
		x = int(x)
		y = int(y)
		l.append((x, y))
	l.sort()
	xm = 0
	ym = 0
	R = 0
	U = 0
	s = ''
	b = True
	for tupla in l:
		R = tupla[0] - xm
		xm = tupla[0]
		U = tupla[1] - ym
		ym = tupla[1]
		if U < 0:
			b = False
			break
		else:
			s = s + R * 'R' + U * 'U'
	if not b:
		print('NO')
	else:
		print('YES')
		print(s)
	t = t - 1


T = int(input())
for _ in range(0, T):
	n = int(input())
	temp = 'YES'
	L = [(0, 0)]
	for i in range(0, n):
		(a, b) = map(int, input().split())
		L.append((b, a))
	L.sort()
	st = ''
	for i in range(1, len(L)):
		if L[i][0] == L[i - 1][0]:
			st += 'R' * (L[i][1] - L[i - 1][1])
		else:
			if L[i][1] < L[i - 1][1]:
				temp = 'NO'
				break
			else:
				st += 'R' * (L[i][1] - L[i - 1][1])
			st += 'U' * (L[i][0] - L[i - 1][0])
	print(temp)
	if temp == 'YES':
		print(st)


def bubbleSort(arr):
	n = len(arr[0])
	for i in range(n):
		for j in range(0, n - i - 1):
			if arr[0][j] > arr[0][j + 1]:
				(arr[0][j], arr[0][j + 1]) = (arr[0][j + 1], arr[0][j])
				(arr[1][j], arr[1][j + 1]) = (arr[1][j + 1], arr[1][j])
			elif arr[0][j] == arr[0][j + 1]:
				if arr[1][j] > arr[1][j + 1]:
					(arr[0][j], arr[0][j + 1]) = (arr[0][j + 1], arr[0][j])
					(arr[1][j], arr[1][j + 1]) = (arr[1][j + 1], arr[1][j])
for _ in range(int(input())):
	n = int(input())
	xy = [[], []]
	for i in range(n):
		(x, y) = map(int, input().split())
		xy[0].append(x)
		xy[1].append(y)
	bubbleSort(xy)
	x = 0
	y = 0
	ans = ''
	flag = 1
	for i in range(n):
		if xy[0][i] >= x:
			ans += 'R' * (xy[0][i] - x)
			x = xy[0][i]
		else:
			flag = 0
			break
		if xy[1][i] >= y:
			ans += 'U' * (xy[1][i] - y)
			y = xy[1][i]
		else:
			flag = 0
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	d = [[0, 0]]
	for i in range(n):
		(x, y) = map(int, input().split())
		d.append([x, y])
	d.sort(key=lambda x: (x[0], x[1]))
	yes = True
	ans = ''
	for i in range(n):
		if d[i][0] == d[i + 1][0]:
			ans += 'U' * (d[i + 1][1] - d[i][1])
		elif d[i][1] > d[i + 1][1]:
			yes = False
			break
		else:
			ans += 'R' * (d[i + 1][0] - d[i][0]) + 'U' * (d[i + 1][1] - d[i][1])
	if yes:
		print('YES')
		print(ans)
	else:
		print('NO')


def solve():
	n = int(input())
	nums = [(0, 0)]
	for i in range(n):
		(x, y) = map(int, input().split())
		nums.append((x, y))
	nums = sorted(nums, key=lambda t: t[0] + t[1])
	cmds = []
	for i in range(len(nums) - 1):
		if nums[i][0] > nums[i + 1][0] or nums[i][1] > nums[i + 1][1]:
			print('NO')
			return
		cmds.append('R' * (nums[i + 1][0] - nums[i][0]) + 'U' * (nums[i + 1][1] - nums[i][1]))
	print('YES')
	print(''.join(cmds))
t = int(input())
for i in range(t):
	solve()


def collectingPackages(arr, n):
	arr.sort()
	x = 0
	y = 0
	s = ''
	res = 1
	for i in range(0, n):
		k = arr[i][0]
		j = arr[i][1]
		if j < x:
			res = 0
			break
		k = k - y
		j = j - x
		y = arr[i][0]
		x = arr[i][1]
		while j > 0:
			j -= 1
			s += 'R'
		while k > 0:
			k -= 1
			s += 'U'
	if res == 0:
		print('NO')
		return
	else:
		print('YES')
		print(s)
		return
tc = int(input())
for _ in range(0, tc):
	n = int(input())
	arr = []
	for _ in range(0, n):
		(a, b) = input().split()
		a = int(a)
		b = int(b)
		arr.append([b, a])
	collectingPackages(arr, n)


import math

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	n = Read.int()
	f = []
	for i in range(n):
		f.append(Read.list_int())
	f.sort(key=lambda x: x[0])
	f.sort(key=lambda x: x[1])
	res = ''
	pos = [0, 0]
	for i in f:
		if i[0] >= pos[0] and i[1] >= pos[1]:
			res += 'R' * (i[0] - pos[0])
			res += 'U' * (i[1] - pos[1])
			pos = i
		else:
			print('NO')
			return
	print('YES')
	print(res)
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


def solve(n, ar):
	ar.sort()
	track = []
	dp = [0, 0]
	dp[0] = 0
	for i in range(n):
		if ar[i] == dp:
			continue
		if ar[i][0] - dp[0] >= 0:
			x = ar[i][0] - dp[0]
			track.append('R' * x)
			dp[0] = ar[i][0]
		else:
			print('NO')
			return
		if ar[i][1] - dp[1] >= 0:
			y = ar[i][1] - dp[1]
			track.append('U' * y)
			dp[1] = ar[i][1]
		else:
			print('NO')
			return
	track = ''.join(map(str, track))
	print('YES')
	print(track)
t = int(input())
for _ in range(t):
	n = int(input())
	ar = []
	prev = []
	for _ in range(n):
		aa = list(map(int, input().split()))
		ar.append(aa)
	solve(n, ar)


N = int(input())
YN = []
for i in range(N):
	n = int(input())
	points = [(0, 0)]
	for j in range(n):
		(x, y) = map(int, input().split())
		points.append((x, y))
	np = sorted(points)
	rout = ''
	for k in range(n):
		sa = np[k + 1][0] - np[k][0]
		sa2 = np[k + 1][1] - np[k][1]
		if sa >= 0 and sa2 >= 0:
			rout += 'R' * sa
			rout += 'U' * sa2
		else:
			YN.append('NO')
			break
	else:
		YN.append('YES')
		YN.append(rout)
for p in YN:
	print(p)


t = int(input())
while t:
	n = int(input())
	l = []
	for i in range(n):
		m = list(map(int, input().split()))
		l.append(m)
	l.sort()
	i = 0
	j = 0
	s = ''
	k = 0
	while k < len(l):
		r = l[k][0] - i
		c = l[k][1] - j
		if r >= 0 and c >= 0:
			if r <= c:
				s += 'R' * r + 'U' * c
				i = l[k][0]
				j = l[k][1]
				k += 1
			else:
				s += 'R' * r + 'U' * c
				i = l[k][0]
				j = l[k][1]
				k += 1
		else:
			break
	if k == n:
		print('YES')
		print(s)
	else:
		print('NO')
	t -= 1


p = int(input())
for i in range(p):
	n = int(input())
	dot = [(0, 0)]
	for i in range(n):
		(a, b) = map(int, input().split())
		dot.append((a, b))
	dot.sort()
	ans = []
	fl = True
	for i in range(1, n + 1):
		if dot[i][1] < dot[i - 1][1]:
			fl = False
			print('NO')
			break
		else:
			ans.append('R' * (dot[i][0] - dot[i - 1][0]))
			ans.append('U' * (dot[i][1] - dot[i - 1][1]))
	if fl:
		print('YES')
		for i in ans:
			print(i, end='')
		print()


import sys
input = sys.stdin.readline
for _ in [0] * int(input()):
	n = int(input())
	x = [0] * n
	for i in range(n):
		x[i] = list(map(int, input().split()))
	prev = [0, 0]
	s = ''
	for h in sorted(x):
		if h[1] < prev[1]:
			print('NO')
			break
		else:
			s = s + 'R' * (h[0] - prev[0]) + 'U' * (h[1] - prev[1])
			prev = h
	else:
		print('YES')
		print(s)


tests = int(input())
for test in range(tests):
	n_packages = int(input())
	packages = []
	for index in range(n_packages):
		line = input().split(' ')
		line = [int(x) for x in line]
		packages.append({'x': line[0], 'y': line[1], 'sum': line[0] + line[1]})
	orderedPackages = sorted(packages, key=lambda k: k['sum'])
	picked = 0
	path = orderedPackages[0]['x'] * 'R' + orderedPackages[0]['y'] * 'U'
	for index in range(n_packages - 1):
		u = orderedPackages[index + 1]['y'] - orderedPackages[index]['y']
		r = orderedPackages[index + 1]['x'] - orderedPackages[index]['x']
		if u < 0 or r < 0:
			break
		path += 'R' * r + 'U' * u
		picked += 1
	if picked == n_packages - 1:
		print('YES')
		print(path)
	else:
		print('NO')


t = int(input())
while t:
	t = t - 1
	n = int(input())
	x = []
	for i in range(n):
		z = input().split()
		x.append([int(z[0]), int(z[1])])
	x = sorted(x, key=lambda k: (k[0], k[1]))
	ans = ''
	current_x = 0
	current_y = 0
	boolean = True
	x_max = 0
	y_max = 0
	for i in x:
		ans = ans + 'R' * (i[0] - current_x) + 'U' * (i[1] - current_y)
		current_x = i[0]
		current_y = i[1]
		if x_max > i[0] or y_max > i[1]:
			print('NO')
			boolean = False
			break
		x_max = max(x_max, i[0])
		y_max = max(y_max, i[1])
	if boolean:
		print('YES')
		print(ans)


def solution(lis, num_pack):
	lis = sorted(lis, key=lambda k: [k[0], k[1]])
	i = 0
	robot = [0, 0]
	point = lis[i]
	directions = ''
	while num_pack != 0:
		if robot[0] > point[0] or robot[1] > point[1]:
			return 'NO'
			break
		else:
			right = point[0] - robot[0]
			up = point[1] - robot[1]
			directions += 'R' * right + 'U' * up
			robot = point
			try:
				i += 1
				point = lis[i]
			except:
				pass
			num_pack -= 1
	return 'YES\n' + directions
t = int(input())
while t > 0:
	t -= 1
	lis = []
	num_pack = int(input())
	num_pac = num_pack
	while num_pac > 0:
		num_pac -= 1
		lis_int = input().split()
		new_list = [int(i) for i in lis_int]
		lis.append(new_list)
	print(solution(lis, num_pack))


t = int(input())
while t > 0:
	n = int(input())
	pack = []
	for i in range(n):
		(a, b) = [int(c) for c in input().split(' ')]
		pack.append((a, b))
	pack = sorted(pack, key=lambda x: (x[0], x[1]))
	(p_i, p_j) = (0, 0)
	ans = ''
	flag = True
	for pk in pack:
		if p_j > pk[1]:
			print('NO')
			flag = False
			break
		ans += 'R' * (pk[0] - p_i) + 'U' * (pk[1] - p_j)
		(p_i, p_j) = (pk[0], pk[1])
	if flag:
		print('YES')
		print(ans)
	t -= 1


t = int(input())
for x in range(t):
	n = int(input())
	t = []
	s = ''
	prz = False
	for y in range(n):
		(a, b) = map(int, input().split())
		t.append([a, b])
	t = sorted(t, key=lambda x: (x[0], x[1]))
	if len(t) == 1:
		print('YES')
		for xx in range(t[0][0]):
			s += 'R'
		for yy in range(t[0][1]):
			s += 'U'
		print(s)
		continue
	for z in range(1, len(t)):
		if t[z - 1][1] > t[z][1]:
			print('NO')
			prz = True
			break
	if prz == True:
		continue
	prev_x = 0
	prev_y = 0
	for xx in range(0, len(t)):
		curr_x = t[xx][0] - prev_x
		curr_y = t[xx][1] - prev_y
		prev_x = t[xx][0]
		prev_y = t[xx][1]
		for xxx in range(curr_x):
			s += 'R'
		for yyy in range(curr_y):
			s += 'U'
	print('YES')
	print(s)


def f(l):
	max = 0
	e = 0
	for i in range(0, len(l)):
		if l[i][1] >= max:
			max = l[i][1]
		else:
			e = 1
			break
	if e == 1:
		return 'NO'
	else:
		return 'YES'
t = int(input())
for i in range(0, t):
	l = []
	n = int(input())
	for i in range(0, n):
		(x, y) = map(int, input().split())
		l.append((x, y))
	l.sort()
	ans = f(l)
	print(ans)
	if ans == 'YES':
		s = ''
		a = 0
		b = 0
		for i in range(0, len(l)):
			x = l[i][0]
			y = l[i][1]
			s = s + (x - a) * 'R'
			s = s + (y - b) * 'U'
			a = x
			b = y
		print(s)


for _ in range(int(input())):
	N = int(input())
	L = []
	L.append([0, 0])
	for i in range(N):
		(A, B) = map(int, input().split())
		L.append([A, B])
	L.sort()
	S = []
	FLAG = 0
	for i in range(len(L) - 1):
		if L[i + 1][0] - L[i][0] < 0 or L[i + 1][1] - L[i][1] < 0:
			FLAG = 1
			break
		else:
			A = L[i + 1][0] - L[i][0]
			B = L[i + 1][1] - L[i][1]
			S += A * 'R'
			S += B * 'U'
	if FLAG == 1:
		print('NO')
	else:
		print('YES')
		print(''.join(S))


t = int(input())
for i in range(t):
	n = int(input())
	packs = []
	for i in range(n):
		(a, b) = map(int, input().split())
		packs.append([a, b])
	packs.sort()
	minc = 0
	da = True
	for i in packs:
		if i[1] < minc:
			print('NO')
			da = False
			break
		minc = i[1]
	if da:
		print('YES')
		c = 0
		r = 0
		for i in packs:
			print('R' * (i[0] - c) + 'U' * (i[1] - r), end='')
			c = i[0]
			r = i[1]
		print()


for t in range(int(input())):
	n = int(input())
	packages = [tuple(map(int, input().split())) for n in range(n)]
	packages.sort(key=lambda p: p[0] + p[1])
	if any((packages[i + 1][0] < packages[i][0] or packages[i + 1][1] < packages[i][1] for i in range(n - 1))):
		print('NO')
	else:
		print('YES')
		(x, y) = (0, 0)
		for (xp, yp) in packages:
			while x < xp:
				print('R', end='')
				x += 1
			while y < yp:
				print('U', end='')
				y += 1
		print()


t = int(input())
for i in range(t):
	n = int(input())
	a = [0] * n
	b = [0] * n
	c = 0
	c1 = 0
	s = ''
	f = 0
	hl = 0
	vl = 0
	for j in range(n):
		(a[j], b[j]) = map(int, input().split())
		t1 = j
		while a[t1] <= a[t1 - 1] and b[t1] <= b[t1 - 1]:
			if t1 == 0:
				break
			t = a[t1 - 1]
			a[t1 - 1] = a[t1]
			a[t1] = t
			t = b[t1 - 1]
			b[t1 - 1] = b[t1]
			b[t1] = t
			t1 -= 1
	for j in range(n):
		if a[j] - c >= 0 and b[j] - c1 >= 0:
			ed = 'R' * (a[j] - c) + 'U' * (b[j] - c1)
			s = s + ed
			c = a[j]
			c1 = b[j]
		else:
			f = 1
			break
	if f == 0:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())

def check(x, y):
	if x[1] > y[1]:
		return False
	else:
		return True

def dir(x, y):
	a = x[0]
	b = x[1]
	c = y[0]
	d = y[1]
	r = c - a
	u = d - b
	s = ''
	for i in range(r):
		s += 'R'
	for i in range(u):
		s += 'U'
	return s
for _ in range(t):
	l = [(0, 0)]
	n = int(input())
	for k in range(n):
		(i, j) = [int(x) for x in input().split()]
		l.append((i, j))
	l = sorted(l)
	s = ''
	flag = False
	for i in range(len(l) - 1):
		if not check(l[i], l[i + 1]):
			print('NO')
			flag = True
			break
		s += dir(l[i], l[i + 1])
	if flag != True:
		print('YES')
		print(s)


def Sortx(sub_li):
	return sorted(sub_li, key=lambda x: x[0])

def Sorty(sub_li):
	return sorted(sub_li, key=lambda x: x[1])
for _ in range(int(input())):
	ls = []
	n = int(input())
	for __ in range(n):
		(a, b) = map(int, input().split())
		ls.append([a, b])
	ls = Sortx(Sorty(ls))
	r1 = ls[0][0]
	r2 = ls[0][1]
	s = r1 * 'R'
	s += r2 * 'U'
	i = 0
	f = 1
	while i < n - 1:
		if ls[i][1] > ls[i + 1][1]:
			f = 0
			break
		else:
			r = ls[i + 1][0] - ls[i][0]
			u = ls[i + 1][1] - ls[i][1]
			s += 'R' * r
			s += 'U' * u
			i += 1
	if f == 1:
		print('YES')
		print(s)
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	l = []
	t = 1
	a = ''
	for i in range(n):
		l.append(list(map(int, input().split())))
		l.sort()
		x = 0
		y = 0
	for i in l:
		while x < i[0]:
			x = x + 1
			a += 'R'
		while y < i[1]:
			y = y + 1
			a += 'U'
		if y - i[1] > 0:
			print('NO')
			t = 0
			break
	if t != 0:
		print('YES')
		print(a)


t = int(input())
for i in range(t):
	dots = []
	n = int(input())
	for j in range(n):
		(x, y) = map(int, input().split())
		dots.append((x, y))
	dots.sort()
	first = (0, 0)
	res = ''
	for pair in dots:
		if first[1] <= pair[1]:
			res += (pair[0] - first[0]) * 'R' + (pair[1] - first[1]) * 'U'
			first = pair
		else:
			res = None
			break
	if res is not None:
		print('YES')
		print(res)
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	lx = []
	s = ''
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		lx.append((x, y))
	lx.sort()
	s += lx[0][0] * 'R'
	s += lx[0][1] * 'U'
	ans = True
	for i in range(len(lx) - 1):
		if lx[i + 1][0] >= lx[i][0] and lx[i + 1][1] >= lx[i][1]:
			s += (lx[i + 1][0] - lx[i][0]) * 'R'
			s += (lx[i + 1][1] - lx[i][1]) * 'U'
		else:
			ans = False
			print('NO')
			break
	if ans == True:
		print('YES')
		print(s)


t = int(input())
for caso in range(t):
	n = int(input())
	pontos = [[int(i) for i in input().split()] for k in range(n)]
	pontos.sort()
	possivel = True
	caminho = ''
	(x, y) = (0, 0)
	for ponto in pontos:
		difx = ponto[0] - x
		dify = ponto[1] - y
		(x, y) = (ponto[0], ponto[1])
		if dify < 0:
			possivel = False
			break
		caminho += 'R' * difx + 'U' * dify
	if not possivel:
		print('NO')
	else:
		print('YES')
		print(caminho)


for _ in range(int(input())):
	n = int(input())
	arr = [[0, 0]]
	for i in range(n):
		(a, b) = map(int, input().split())
		arr.append([a, b])
	arr.sort()
	flag = 0
	ans = ''
	print
	for i in range(1, n + 1):
		if arr[i - 1][0] == arr[i][0]:
			ans += abs(arr[i][1] - arr[i - 1][1]) * 'U'
		elif arr[i - 1][1] <= arr[i][1]:
			ans += abs(arr[i][0] - arr[i - 1][0]) * 'R'
			ans += abs(arr[i][1] - arr[i - 1][1]) * 'U'
		else:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	pack = []
	for i in range(n):
		pack.append(list(map(int, input().split())))
	pack.sort(key=lambda x: int(''.join((str(i) for i in x))))
	currv = 0
	currh = 0
	ans = []
	for i in pack:
		if i[0] < currv or i[1] < currh:
			ans = 'NO'
			break
		else:
			while currv != i[0]:
				ans.append('R')
				currv += 1
			while currh != i[1]:
				ans.append('U')
				currh += 1
	if ans == 'NO':
		print(ans)
	else:
		print('YES')
		print(''.join((str(i) for i in ans)))


from operator import itemgetter
t = int(input())
while t > 0:
	t = t - 1
	flag = 0
	n = int(input())
	li = [0]
	li2 = [0]
	for i in range(n):
		(a, b) = input().strip().split()
		li.append(int(a))
		li2.append(int(b))
	xb = list(zip(li, li2))
	xb = sorted(xb, key=itemgetter(0, 1))
	if len(xb) == 1:
		print('yes')
	s = ''
	for i in range(len(xb) - 1):
		if xb[i][1] <= xb[i + 1][1]:
			for k in range(xb[i + 1][0] - xb[i][0]):
				s = s + 'R'
			for j in range(xb[i + 1][1] - xb[i][1]):
				s = s + 'U'
		else:
			flag = 1
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	package = int(input())
	coordinates = []
	for i in range(package):
		(x, y) = map(int, input().split())
		coordinates.append((x, y))
	coordinates.sort()
	current_x = 0
	current_y = 0
	sequence = []
	yes = True
	for (x, y) in coordinates:
		while current_x < x:
			current_x += 1
			sequence.append('R')
		while current_y < y:
			current_y += 1
			sequence.append('U')
		if current_y > y:
			yes = False
			break
	if yes:
		print('YES')
		print(*sequence, sep='')
	else:
		print('NO')


tests = int(input())
for i in range(0, tests):
	banderaNo = 0
	cajas = int(input())
	myLista = list()
	for o in range(0, cajas):
		(x, y) = map(int, input().split())
		if x < 0 or y < 0:
			banderaNo = 1
		coordiTemp = [x, y]
		myLista.append(coordiTemp)
	if banderaNo == 1:
		print('NO')
	else:
		myLista.sort()
		numTemp = 0
		for k in range(0, len(myLista)):
			corTemp = myLista[k]
			unaY = corTemp[1]
			if unaY < numTemp:
				banderaNo = 1
			numTemp = unaY
		if banderaNo == 1:
			print('NO')
		else:
			print('YES')
			camino = ''
			corAct = [0, 0]
			for p in range(0, len(myLista)):
				coriT = myLista[p]
				xi = coriT[0]
				yi = coriT[1]
				numR = xi - corAct[0]
				numU = yi - corAct[1]
				for r in range(0, numR):
					camino += 'R'
				for u in range(0, numU):
					camino += 'U'
				corAct[0] = xi
				corAct[1] = yi
			print(camino)


t = int(input())
for _ in range(t):
	ans = ''
	n = int(input())
	xyl = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		xyl.append((x, y))
	for i in range(n):
		for j in range(n):
			(x1, y1) = xyl[i]
			(x2, y2) = xyl[j]
			if (x1 - x2) * (y1 - y2) < 0:
				print('NO')
				break
		else:
			continue
		break
	else:
		print('YES')
		xyl = sorted(xyl, key=lambda x: x[0] + x[1])
		ans += 'R' * xyl[0][0]
		ans += 'U' * xyl[0][1]
		for i in range(n - 1):
			ans += 'R' * (xyl[i + 1][0] - xyl[i][0])
			ans += 'U' * (xyl[i + 1][1] - xyl[i][1])
		print(ans)


test_cases = int(input())

def process():
	packages_count = int(input())
	packages = []
	for j in range(packages_count):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	packages.sort()
	path = ''
	pos = (0, 0)
	for j in range(packages_count):
		if packages[j][0] < pos[0] or packages[j][1] < pos[1]:
			print('NO')
			return
		path += 'R' * (packages[j][0] - pos[0])
		path += 'U' * (packages[j][1] - pos[1])
		pos = packages[j]
	print('YES')
	print(path)
for i in range(test_cases):
	process()


t = int(input())
for _ in range(t):
	n = int(input())
	cr = []
	for _ in range(n):
		(xi, yi) = [int(x) for x in input().split()]
		cr.append([xi, yi])
	frst = sorted(cr, key=lambda x: (x[0], x[1]))
	res = ''
	tr = True
	xloc = 0
	yloc = 0
	for (xi, yi) in frst:
		if xloc <= xi and yloc <= yi:
			res += (xi - xloc) * 'R'
			res += (yi - yloc) * 'U'
			xloc = xi
			yloc = yi
		else:
			tr = False
			break
	if tr:
		print('YES')
		print(res)
	else:
		print('NO')


from sys import stdin, stdout
import gc
gc.disable()
input = stdin.readline

def check_int(A, B, C):
	if int(A) == A and int(B) == B and (int(C) == C):
		return True
	return False
t = int(input().strip())
for _ in range(t):
	n = int(input())
	coord = []
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		coord.append([x, y, x + y])
	coord.sort(key=lambda x: x[2])
	cx = 0
	cy = 0
	flag = 0
	ans = []
	for i in range(n):
		(x, y, dist) = coord[i]
		if cx > x:
			flag = 1
			break
		if cy > y:
			flag = 1
			break
		while cx < x:
			cx += 1
			ans.append('R')
		while cy < y:
			cy += 1
			ans.append('U')
	else:
		print('YES')
		print(''.join(ans))
	if flag == 1:
		print('NO')


def arrange(a, b):
	n = len(a)
	for i in range(n):
		flag = False
		for j in range(n - i - 1):
			if a[j] > a[j + 1]:
				flag = True
				(a[j], a[j + 1]) = (a[j + 1], a[j])
				(b[j], b[j + 1]) = (b[j + 1], b[j])
			if a[j] == a[j + 1] and b[j] > b[j + 1]:
				flag = True
				(b[j], b[j + 1]) = (b[j + 1], b[j])
		if flag == False:
			break

def isSorted(b):
	flag = True
	for i in range(len(b) - 1):
		if b[i] > b[i + 1]:
			flag = False
			break
	return flag
for _ in range(int(input())):
	a = []
	b = []
	n = int(input())
	for pkg in range(n):
		(p, q) = map(int, input().split())
		a.append(p)
		b.append(q)
	arrange(a, b)
	if isSorted(b) == False:
		print('NO')
	else:
		print('YES')
		x1 = 0
		y1 = 0
		s = ''
		for c in range(n):
			s = s + (a[c] - x1) * 'R' + (b[c] - y1) * 'U'
			x1 = a[c]
			y1 = b[c]
		print(s)


t = int(input())
for inh in range(0, t):
	n = int(input())
	a = []
	for i in range(0, n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	a.sort()
	(x, y) = (0, 0)
	ans = ''
	k = True
	for i in range(0, n):
		(c, d) = (a[i][0], a[i][1])
		if c >= x and d >= y:
			ans += 'R' * (c - x) + 'U' * (d - y)
			(x, y) = (c, d)
		else:
			k = False
			break
	if k:
		print('YES')
		print(ans)
	else:
		print('NO')


def find_path(coordinates):
	path = ''
	sorted_coordinates = sorted(coordinates, key=lambda coordinate: (coordinate[0], coordinate[1]))
	prev_coordinates = (0, 0)
	for curr_coordinates in sorted_coordinates:
		if curr_coordinates[1] < prev_coordinates[1]:
			return 'NO'
		right_path = 'R' * (curr_coordinates[0] - prev_coordinates[0])
		top_path = 'U' * (curr_coordinates[1] - prev_coordinates[1])
		path += right_path + top_path
		prev_coordinates = curr_coordinates
	return 'YES' + '\n' + path
all_coordinates = []
for _ in range(int(input())):
	coordinates = []
	for _ in range(int(input())):
		pair = [int(s) for s in input().split()]
		coordinates.append(pair)
	all_coordinates.append(coordinates)
for c in all_coordinates:
	print(find_path(c))


gi = lambda : list(map(int, input().split()))
(t,) = gi()
for k in range(t):
	(n,) = gi()
	l = sorted([gi() for _ in range(n)])
	(up, ri) = (0, 0)
	ans = []
	flag = True
	for p in l:
		(x, y) = p
		ans.append('R' * (x - ri))
		ri = x
		if y < up:
			print('NO')
			flag = False
			break
		ans.append('U' * (y - up))
		up = y
	if flag:
		print('YES')
		print(''.join(ans))


for _ in range(int(input())):
	t = int(input())
	l = []
	for i in range(t):
		(a, b) = map(int, input().split())
		l.append([a, b])
	d = sorted(l)
	x = 0
	y = 0
	s = ''
	c = 0
	for (i, j) in d:
		if i < x or j < y:
			c = 1
			print('NO')
			break
		v = 'R' * (i - x)
		w = 'U' * (j - y)
		x = i
		y = j
		s += v + w
	if c == 0:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(n, m) = map(int, input().split())
		l.append((n, m))
	l1 = []
	l2 = []
	s1 = ''
	c = 0
	for i in range(len(l)):
		s = (l[i][0] ** 2 + l[i][1] ** 2) ** 0.5
		l1.append((l[i], s))
	l1.sort()
	for i in range(len(l1)):
		l2.append(l1[i][0])
	s1 = 'R' * l2[0][0] + 'U' * l2[0][1]
	for i in range(1, len(l2)):
		x = l2[i][0] - l2[i - 1][0]
		s1 = s1 + x * 'R'
		y = l2[i][1] - l2[i - 1][1]
		s1 = s1 + y * 'U'
		if x < 0 or y < 0:
			c = 1
	if c == 1:
		s1 = ''
		print('NO')
	else:
		print('YES')
		print(s1)


for test_cases in range(int(input())):
	no_of_packages = int(input())
	indexes = []
	for i in range(no_of_packages):
		indexes.append(list(map(int, input().split())))
	indexes.sort(key=lambda x: (x[0], x[1]))
	right = 0
	up = 0
	flag = 0
	s = ''
	for i in indexes:
		if i[0] >= right:
			s += 'R' * (i[0] - right)
			right = i[0]
		else:
			flag = 1
			break
		if i[1] >= up:
			s += 'U' * (i[1] - up)
			up = i[1]
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES\n' + s)


for _ in range(int(input())):
	n = int(input())
	M = []
	for _ in range(n):
		M.append(list(map(int, input().split())))
	M.sort()
	ans = ''
	(x, y) = (0, 0)
	flag = 0
	for i in M:
		(dx, dy) = (i[0], i[1])
		val1 = dx - x
		val2 = dy - y
		if val1 < 0:
			print('NO')
			flag = 1
			break
		if val1 != 0:
			ans += 'R' * val1
			x = dx
		if dy - y < 0:
			print('NO')
			flag = 1
			break
		if dy - y != 0:
			ans += 'U' * val2
			y = dy
	if flag == 0:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split(' '))
		l.append((a, b))
	l.append((0, 0))
	l.sort()
	if len(l) == 2:
		print('YES')
		r = l[1][0] - l[0][0]
		u = l[1][1] - l[0][1]
		path = '' + 'R' * r + 'U' * u
		print(path)
	else:
		path = []
		c = 0
		for i in range(1, len(l)):
			if l[i][0] < l[i - 1][0] or l[i][1] < l[i - 1][1]:
				c = c + 1
		if c != 0:
			print('NO')
		else:
			for i in range(1, len(l)):
				r = l[i][0] - l[i - 1][0]
				u = l[i][1] - l[i - 1][1]
				y = 'R' * r + 'U' * u
				path.append(y)
			print('YES')
			print(''.join(path))


def cp(n, l):
	l = sorted(l, key=lambda x: x[1] + x[0])
	s = ''
	k1 = l[0][0] - 0
	k2 = l[0][1] - 0
	r = 'R' * k1
	u = 'U' * k2
	s = s + r + u
	if n == 1:
		print('YES')
		print(s)
		return
	for i in range(n - 1):
		if l[i][0] > l[i + 1][0] or l[i][1] > l[i + 1][1]:
			print('NO')
			return
		else:
			q1 = l[i + 1][0] - l[i][0]
			q2 = l[i + 1][1] - l[i][1]
			r = q1 * 'R'
			u = q2 * 'U'
			s = s + r + u
	print('YES')
	print(s)
t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = [int(i) for i in input().split()]
		l.append([x, y])
	ans = cp(n, l)
	ans


for _ in range(int(input())):
	p = int(input())
	l = []
	for i in range(p):
		l.append(list(map(int, input().split())))
	l.sort()
	flag = True
	ans = ''
	ans += l[0][0] * 'R' + l[0][1] * 'U'
	for i in range(1, p):
		a = l[i][0] - l[i - 1][0]
		b = l[i][1] - l[i - 1][1]
		if a < 0 or b < 0:
			flag = False
			break
		ans += a * 'R' + b * 'U'
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(tuple([int(a) for a in input().split(' ')]))
	arr.sort()
	prev = None
	yes = True
	succ = []
	pos = (0, 0)
	for e in arr:
		if prev:
			if prev[0] <= e[0] and prev[1] <= e[1]:
				if prev[0] == e[0] and prev[1] == e[1]:
					yes = False
					break
				if prev[0] > e[0] or prev[1] > e[1]:
					yes = False
					break
			else:
				yes = False
				break
		succ.extend(['R'] * (e[0] - pos[0]))
		succ.extend(['U'] * (e[1] - pos[1]))
		pos = e
		prev = e
	if yes:
		print('YES')
		print(''.join(succ))
	else:
		print('NO')


from functools import reduce

def factors(n):
	k = sorted(list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5 + 1)) if n % i == 0)))))
	return k[1:]

def solve():
	n = int(input())
	s = []
	for _ in range(0, n):
		(x, y) = map(int, input().split())
		s.append((x, y))
	s = sorted(s)
	ss = 'YES'
	ans = ''
	(xx, yy) = (0, 0)
	for i in s:
		(ox, oy) = (i[0], i[1])
		ans += (ox - xx) * 'R'
		if oy - yy < 0:
			ss = 'NO'
			break
		else:
			ans += (oy - yy) * 'U'
		(xx, yy) = (ox, oy)
	if ss == 'YES':
		print(ss)
		print(ans)
	else:
		print(ss)
t = int(input())
for _ in range(0, t):
	solve()


test = int(input())
while test > 0:
	test -= 1
	n = int(input())
	ara = []
	ara.append((0, 0))
	for i in range(1, n + 1):
		(t1, t2) = map(int, input().split())
		ara.append((t1, t2))
	ara.sort()
	impossible = False
	for i in range(1, n + 1):
		if ara[i][0] < ara[i - 1][0] or ara[i][1] < ara[i - 1][1]:
			impossible = True
			break
	if impossible:
		print('NO')
		continue
	print('YES')
	for i in range(1, n + 1):
		rc = ara[i][0] - ara[i - 1][0]
		for j in range(rc):
			print('R', end='')
		uc = ara[i][1] - ara[i - 1][1]
		for j in range(uc):
			print('U', end='')
	print()


for _ in range(int(input())):
	n = int(input())
	pkg = []
	for i in range(n):
		(x, y) = [int(x) for x in input().split()]
		pkg.append((x, y))
	pkg.sort()
	flag = True
	ans = []
	ans.append(pkg[0][0])
	ans.append(pkg[0][1] * -1)
	for i in range(n - 1):
		if pkg[i][0] > pkg[i + 1][0]:
			flag = False
			break
		elif pkg[i][0] == pkg[i + 1][0]:
			if pkg[i][1] > pkg[i + 1][1]:
				flag = False
				break
			else:
				k = (pkg[i + 1][1] - pkg[i][1]) * -1
				ans.append(k)
		else:
			if pkg[i][1] > pkg[i + 1][1]:
				flag = False
				break
			k = (pkg[i + 1][0] - pkg[i][0]) * 1
			ans.append(k)
			k = (pkg[i + 1][1] - pkg[i][1]) * -1
			ans.append(k)
	if flag:
		print('YES')
		for i in range(len(ans) - 1):
			if ans[i] > 0:
				print('R' * ans[i], end='')
			elif ans[i] < 0:
				print('U' * abs(ans[i]), end='')
		k = ans[-1]
		if k > 0:
			print('R' * k)
		else:
			print('U' * abs(k))
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	a = [[0, 0, 0]]
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append([x + y, x, y])
	a.sort()
	f = 0
	ans = ''
	for i in range(1, n + 1):
		x = a[i][1] - a[i - 1][1]
		if x < 0:
			f = 1
			break
		ans += x * 'R'
		x = a[i][2] - a[i - 1][2]
		if x < 0:
			f = 1
			break
		ans += x * 'U'
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


import sys
from collections import defaultdict
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	dic = defaultdict(list)
	for i in range(n):
		(x, y) = map(int, sys.stdin.readline().split())
		dic[x].append(y)
	for i in dic:
		dic[i].sort()
	ans = ''
	(prev_x, prev_y, z) = (0, 0, True)
	for i in sorted(dic):
		if i == prev_x:
			pass
		else:
			ans = ans + 'R' * (i - prev_x)
			prev_x = i
		m = len(dic[i])
		for j in dic[i]:
			if j < prev_y:
				z = False
				break
			else:
				ans = ans + (j - prev_y) * 'U'
				prev_y = j
		if not z:
			break
	if z:
		print('YES')
		print(ans)
	else:
		print('NO')


c = int(input())
for i in range(c):
	n = int(input())
	a = []
	s = 0
	x = ''
	flag = 0
	e = 0
	f = 0
	for i in range(n):
		b = list(map(int, input().split()))
		a.append(b)
	a.append([0, 0])
	a.sort()
	for j in range(1, len(a)):
		if a[0][0] != a[j][s] and a[0][1] == a[j][s + 1]:
			if a[j][s] > a[0][0]:
				a[0][0] = a[j][s]
				for i in range(f, a[0][0]):
					f = a[0][0]
					x = x + 'R'
			else:
				print('NO')
				flag = 1
				break
		elif a[0][0] == a[j][s] and a[0][1] != a[j][s + 1]:
			if a[j][s + 1] > a[0][1]:
				a[0][1] = a[j][s + 1]
				for i in range(e, a[0][1]):
					e = a[0][1]
					x = x + 'U'
			else:
				print('NO')
				flag = 1
				break
		elif a[0][0] != a[j][s] and a[0][1] != a[j][s + 1]:
			if a[j][s] > a[0][0] and a[j][s + 1] > a[0][1]:
				a[0][0] = a[j][s]
				a[0][1] = a[j][s + 1]
				for i in range(f, a[0][0]):
					f = a[0][0]
					x = x + 'R'
				for i in range(e, a[0][1]):
					e = a[0][1]
					x = x + 'U'
			else:
				print('NO')
				flag = 1
				break
	if flag == 0:
		print('YES')
		print(x)
	a.clear()


from math import ceil
from collections import deque
for _ in range(int(input())):
	n = int(input())
	a = []
	f = 0
	for i in range(n):
		a.append([int(i) for i in input().split()])
	a.sort()
	for i in range(n - 1):
		if a[i][1] > a[i + 1][1]:
			f = 1
	if f:
		print('NO')
		continue
	print('YES')
	x = y = 0
	for i in a:
		while i[0] > x:
			print('R', end='')
			x += 1
		while i[1] > y:
			print('U', end='')
			y += 1
	print()


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		a = list(map(int, input().split()))
		l.append(a)
	l.append([0, 0])
	l.sort()
	s = []
	x = 'YES'
	for i in range(len(l) - 1):
		if l[i + 1][0] - l[i][0] >= 0 and l[i + 1][1] - l[i][1] >= 0:
			s.append('R' * (l[i + 1][0] - l[i][0]) + 'U' * (l[i + 1][1] - l[i][1]))
		else:
			x = 'NO'
			break
	if x == 'YES':
		print(x)
		print(''.join(s))
	if x == 'NO':
		print(x)


t = int(input())
fans = []
fprompt = []
for i in range(0, t):
	n = int(input())
	x = [0]
	y = [0]
	ans = ''
	prompt = 'YES'
	for i in range(0, n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	for i in range(len(x)):
		for j in range(0, len(x) - i - 1):
			if x[j] == x[j + 1]:
				if y[j] > y[j + 1]:
					(y[j], y[j + 1]) = (y[j + 1], y[j])
			if x[j] > x[j + 1]:
				(x[j], x[j + 1]) = (x[j + 1], x[j])
				(y[j], y[j + 1]) = (y[j + 1], y[j])
	for i in range(0, len(x) - 1):
		if x[i + 1] >= x[i]:
			ans = ans + 'R' * (x[i + 1] - x[i])
			if y[i + 1] >= y[i]:
				ans = ans + 'U' * (y[i + 1] - y[i])
			else:
				prompt = 'NO'
		else:
			prompt = 'NO'
	fans.append(ans)
	fprompt.append(prompt)
for i in range(0, t):
	if fprompt[i] == 'YES':
		print(fprompt[i], fans[i], sep='\n')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	data = [list(map(int, input().split())) for _ in range(n)]
	data.sort(key=lambda x: (x[0], x[1]))
	bo = True
	(u, v) = (0, 0)
	ans = ''
	for (x, y) in data:
		if u > x or v > y:
			bo = False
			break
		ans += 'R' * (x - u) + 'U' * (y - v)
		u = x
		v = y
	if bo:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
while t:
	n = int(input())
	a = [[0, 0]]
	for i in range(0, n):
		b = [int(j) for j in input().split()]
		a.append(b)
	a.sort()
	flag = 1
	for i in range(1, len(a)):
		if a[i][0] - a[i - 1][0] < 0 or a[i][1] - a[i - 1][1] < 0:
			flag = 0
			break
	if flag == 0:
		print('NO')
	else:
		print('YES')
		for i in range(1, len(a)):
			r = a[i][0] - a[i - 1][0]
			u = a[i][1] - a[i - 1][1]
			for i in range(0, r):
				print('R', end='')
			for i in range(0, u):
				print('U', end='')
		print()
	t = t - 1


for i in range(int(input())):
	n = int(input())
	xy = []
	for j in range(n):
		xy.append([int(i) for i in input().split()])
	xy.sort()
	curPos = [0, 0]
	final = ''
	for i in xy:
		if i[0] < curPos[0] or i[1] < curPos[1]:
			print('NO')
			break
		else:
			final += 'R' * (i[0] - curPos[0]) + 'U' * (i[1] - curPos[1])
			curPos = [i[0], i[1]]
	else:
		print('YES')
		print(final)


from sys import stdin
t = int(stdin.readline().strip())
for _ in range(t):
	n = int(stdin.readline().strip())
	a = [list(map(int, stdin.readline().split())) for _ in range(n)]
	a.sort()
	t = True
	res = ''
	(x, y) = (0, 0)
	for i in range(n):
		(cx, cy) = a[i]
		if x > cx or y > cy:
			t = False
			break
		res += 'R' * (cx - x)
		res += 'U' * (cy - y)
		(x, y) = (cx, cy)
	if t:
		print('YES')
		print(res)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	packages = [0] * n
	for i in range(n):
		packages[i] = list(map(int, input().split()))
	curr_pos = [0, 0]
	packages_visited = [0] * n
	packages = sorted(packages)
	ans = ''
	for i in range(n):
		if packages[i][0] - curr_pos[0] >= 0 and packages[i][1] - curr_pos[1] >= 0:
			x_change = packages[i][0] - curr_pos[0]
			y_change = packages[i][1] - curr_pos[1]
			ans += 'R' * x_change
			ans += 'U' * y_change
			curr_pos = packages[i]
			packages_visited[i] = 1
	f = 1
	for i in packages_visited:
		if i == 0:
			f = 0
	if f == 0:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	pack = []
	for __ in range(n):
		pack.append(list(map(int, input().split())))
	pack.sort()
	yes_no = 'YES'
	ans = ''
	x = 0
	y = 0
	for (xx, yy) in pack:
		if yy < y:
			yes_no = 'NO'
			break
		else:
			ans += 'R' * (xx - x) + 'U' * (yy - y)
			x = xx
			y = yy
	print(yes_no)
	if yes_no == 'YES':
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	coords = [[0, 0, 0]]
	steps = [0]
	flag = 0
	for j in range(n):
		x = list(map(int, input().split()))
		coords.append([x[0] + x[1]] + x)
		steps.append(x[0] + x[1])
	steps = list(set(steps))
	if len(steps) != n + 1:
		print('NO')
	else:
		coords.sort()
		ans = []
		for j in range(len(coords) - 1):
			if coords[j][1] <= coords[j + 1][1] and coords[j][2] <= coords[j + 1][2]:
				ans.extend(['R'] * (0 - coords[j][1] + coords[j + 1][1]) + ['U'] * (0 - coords[j][2] + coords[j + 1][2]))
			else:
				flag = 1
				break
		if flag == 0:
			print('YES')
			print(''.join(ans))
		else:
			print('NO')


from collections import defaultdict, deque
from itertools import permutations
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
int_input = lambda : int(stdin.readline())
string_input = lambda : stdin.readline()
multi_int_input = lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input = lambda : list(map(int, stdin.readline().split()))
string_list_input = lambda : list(string_input())
MOD = pow(10, 9) + 7

class coordinate:

	def __init__(self, x, y):
		self.x = x
		self.y = y
test = int_input()
for _ in range(test):
	n = int_input()
	listCoordinates = []
	for i in range(n):
		(x, y) = multi_int_input()
		listCoordinates.append(coordinate(x, y))
	flag = 0
	listCoordinates.sort(key=lambda y: y.x)
	prev = None
	for p in listCoordinates:
		if prev == None:
			prev = p
		elif p.y < prev.y and p.x != prev.x:
			flag = 1
			break
		prev = p
	if flag == 1:
		print('NO')
	else:
		flag = 0
		dicti = {}
		for p in listCoordinates:
			if p.x in dicti:
				dicti[p.x].append(p.y)
			else:
				dicti[p.x] = [p.y]
		for points in dicti:
			if len(dicti[points]) > 1:
				dicti[points] = sorted(dicti[points])
		startingx = 0
		startingy = 0
		result = ''
		for p in dicti:
			if len(dicti[p]) > 1:
				right = 'R' * abs(startingx - p)
				up = 'U' * abs(startingy - dicti[p][-1])
				if startingy - dicti[p][0] > 0:
					flag = 1
					break
				result += right + up
				startingx = p
				startingy = dicti[p][-1]
			else:
				right = 'R' * abs(startingx - p)
				up = 'U' * abs(startingy - dicti[p][0])
				if startingy - dicti[p][0] > 0:
					flag = 1
					break
				result += right + up
				startingx = p
				startingy = dicti[p][0]
		if flag == 0:
			print('YES')
			print(result)
		else:
			print('NO')


def print_path(positions):
	cur_pos = (0, 0)
	traversed_path = ''
	pathable = True
	for position in positions:
		pos_diff = (position[0] - cur_pos[0], position[1] - cur_pos[1])
		if pos_diff[0] < 0 or pos_diff[1] < 0:
			pathable = False
			print('NO')
			break
		else:
			traversed_path += 'R' * pos_diff[0]
			traversed_path += 'U' * pos_diff[1]
		cur_pos = position
	if pathable:
		print('YES')
		print(traversed_path)
num_tests = int(input())
for test_num in range(0, num_tests):
	num_packages = int(input())
	package_positions = []
	for package_num in range(0, num_packages):
		package_position = tuple([int(x) for x in input().split()])
		package_positions.append(package_position)
	sorted_positions = sorted(package_positions, key=lambda x: (x[0], x[1]))
	print_path(sorted_positions)


t = int(input())
for _ in range(t):
	p = int(input())
	total_path = [[0, 0]]
	for __ in range(p):
		total_path.append(list(map(int, input().split())))
	total_path = sorted(total_path, key=lambda k: [k[0], k[1]])
	flag = 0
	s = ''
	for i in range(1, len(total_path)):
		if total_path[i - 1][1] <= total_path[i][1]:
			s += (total_path[i][0] - total_path[i - 1][0]) * 'R'
			s += (total_path[i][1] - total_path[i - 1][1]) * 'U'
		else:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
while t > 0:
	n = int(input())
	nlist = []
	for i in range(n):
		nlist.append(list(map(int, input().split())))
	nlist.sort(key=lambda x: (x[0], x[1]))
	m = nlist[0][1]
	flag = 0
	for i in nlist:
		if i[1] >= m:
			m = i[1]
		else:
			print('NO')
			flag = 1
			break
	if flag == 1:
		t -= 1
		continue
	path = ''
	prevx = 0
	prevy = 0
	for i in nlist:
		for ct in range(int(i[0]) - prevx):
			path += 'R'
		prevx = int(i[0])
		for ct in range(int(i[1]) - prevy):
			path += 'U'
		prevy = int(i[1])
	print('YES')
	print(path)
	t -= 1


import sys

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())

def solve():
	n = mint()
	a = [None] * n
	for i in range(n):
		a[i] = tuple(mints())
	a.sort()
	r = []
	(px, py) = (0, 0)
	for (x, y) in a:
		if x - px < 0 or y - py < 0:
			print('NO')
			return
		for i in range(x - px):
			r.append('R')
		for j in range(y - py):
			r.append('U')
		px = x
		py = y
	print('YES')
	print(''.join(r))
for i in range(mint()):
	solve()


for _ in range(int(input())):
	n = int(input())
	a = []
	s = ''
	for i in range(n):
		a.append(list(map(int, input().split())))
	a = sorted(a)
	x = [0, 0]
	for i in range(n):
		if a[i][0] < x[0] or a[i][1] < x[1]:
			print('NO')
			break
		else:
			r = a[i][0] - x[0]
			u = a[i][1] - x[1]
			for j in range(r):
				s += 'R'
			for j in range(u):
				s += 'U'
		x = a[i]
	else:
		print('YES')
		print(s)


def packages(n, a):
	a.sort()
	ans = ''
	x = 0
	y = 0
	for i in range(n):
		if a[i][0] >= x and a[i][1] >= y:
			ans += 'R' * (a[i][0] - x) + 'U' * (a[i][1] - y)
			x = a[i][0]
			y = a[i][1]
		else:
			print('NO')
			return
	print('YES')
	print(ans)
	return
t = int(input())
array = []
for i in range(t):
	n = int(input())
	a = []
	for j in range(n):
		a.append(list(map(int, input().split(' '))))
	array.append([n, a])
for x in array:
	packages(*x)


for t in range(int(input())):
	n = int(input())
	l = []
	s = ''
	for j in range(n):
		l.append(list(map(int, input().split())))
	l = sorted(l)
	y = [0, 0]
	for i in range(n):
		if l[i][0] < y[0] or l[i][1] < y[1]:
			print('NO')
			break
		else:
			m = l[i][0] - y[0]
			n = l[i][1] - y[1]
			for j in range(m):
				s += 'R'
			for j in range(n):
				s += 'U'
		y = l[i]
	else:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	flag = 0
	l = []
	for sad in range(n):
		(g, h) = map(int, input().split())
		tup = (g, h)
		l.append(tup)
	l.sort()
	for (i, j) in l:
		for (n, m) in l:
			if i < n and j > m:
				flag = 1
				break
	(p, q) = (0, 0)
	an = ''
	if flag == 0:
		for (i, j) in l:
			if i > p:
				dif = i - p
				an += 'R' * dif
				p = i
			if j > q:
				dif = j - q
				an += 'U' * dif
				q = j
		print('YES')
		print(an)
	else:
		print('NO')


from collections import Counter
from collections import defaultdict
import math
t = int(input())
for _ in range(0, t):
	n = int(input())
	a = list()
	for i in range(0, n):
		(x, y) = list(map(int, input().split()))
		a.append((x, y))
	a.append((0, 0))
	a.sort(key=lambda x: (x[0], x[1]))
	s = ''
	f = 1
	for i in range(1, len(a)):
		if a[i][0] - a[i - 1][0] < 0 or a[i][1] - a[i - 1][1] < 0:
			f = 0
			break
		s = s + 'R' * (a[i][0] - a[i - 1][0])
		s = s + 'U' * (a[i][1] - a[i - 1][1])
	if f:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for i in range(t):
	pack = []
	n = int(input())
	for j in range(n):
		(a, b) = map(int, input().strip().split())
		pack.append([a, b])
	pack.sort(key=lambda x: (x[0], x[1]))
	pos = [0, 0]
	flag = 1
	for j in range(1, n):
		if pack[j][1] < pack[j - 1][1]:
			flag = 0
			break
	if flag:
		print('YES')
		for j in range(0, n):
			print('R' * (pack[j][0] - pos[0]), end='')
			print('U' * (pack[j][1] - pos[1]), end='')
			pos = pack[j]
		print('')
	else:
		print('NO')


t = int(input())
ans = []
for i in range(t):
	prov = 0
	n = int(input())
	mi = []
	for j in range(n):
		(x, y) = map(int, input().split())
		mi.append([x, y])
	mi.sort()
	s = ''
	now = [0, 0]
	prov = True
	for j in range(n):
		if mi[j][1] < now[1]:
			ans.append('NO')
			prov = False
			break
		else:
			s += 'R' * (mi[j][0] - now[0]) + 'U' * (mi[j][1] - now[1])
			now = [mi[j][0], mi[j][1]]
	if prov:
		ans.append('YES')
		ans.append(s)
for i in range(len(ans)):
	print(ans[i])


t = int(input())
for i in range(t):
	ans = ''
	finish = False
	n = int(input())
	min_max = [[1000000, -1] for _ in range(1001)]
	for j in range(n):
		(x, y) = map(int, input().split())
		min_max[y] = [min(min_max[y][0], x), max(min_max[y][1], x)]
	if min_max[0][0] != 1000000:
		ans += 'R' * min_max[0][1]
		last = [min_max[0][1], 0]
	else:
		last = [0, 0]
	for j in range(1, 1001):
		if min_max[j][0] != 1000000:
			if min_max[j][0] < last[0]:
				print('NO')
				finish = True
				break
			else:
				ans += 'R' * (min_max[j][0] - last[0]) + 'U' * (j - last[1]) + 'R' * (min_max[j][1] - min_max[j][0])
				last = [min_max[j][1], j]
	if finish:
		continue
	print('YES')
	print(ans)


def distance(b):
	x1 = 0
	y1 = 0
	x2 = b[0]
	y2 = b[1]
	return abs(y1 - y2) + abs(x1 - x2)

def can_go(points):
	for i in range(len(points)):
		for j in range(i + 1, len(points)):
			if (points[i][0] - points[j][0]) * (points[i][1] - points[j][1]) < 0:
				return False
	return True
import math
t = int(input())
for i in range(t):
	n = int(input())
	points = []
	for j in range(n):
		new = input().split(' ')
		points.append(list(map(int, new)))
	if can_go(points):
		print('YES')
		path = sorted(points, key=distance)
		go = ''
		now = [0, 0]
		for point in path:
			go += 'R' * (point[0] - now[0])
			go += 'U' * (point[1] - now[1])
			now = point
		print(go)
	else:
		print('NO')


for _ in range(int(input())):
	flag = 0
	n = int(input())
	points = []
	for i in range(n):
		(x, y) = map(int, input().split())
		points.append([x, y])
	points.sort()
	(X, Y) = (0, 0)
	path = ''
	for point in points:
		if point[0] < X or point[1] < Y:
			flag = 1
			break
		path += 'R' * (point[0] - X)
		path += 'U' * (point[1] - Y)
		(X, Y) = point
	if flag:
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
for _ in range(t):
	n = int(input())
	coords = []
	for __ in range(n):
		coords.append(list(map(int, input().split())))
	coords.sort()
	path = ''
	currX = 0
	currY = 0
	for coord in coords:
		xDiff = coord[0] - currX
		yDiff = coord[1] - currY
		if xDiff < 0 or yDiff < 0:
			path = None
			break
		path += 'R' * xDiff + 'U' * yDiff
		currX += xDiff
		currY += yDiff
	if path:
		print('YES')
		print(path)
	else:
		print('NO')


t = int(input())
answers = []
for ti in range(t):
	n = int(input())
	p = [[0, 0]]
	for ni in range(n):
		ints = list(map(int, input().split()))
		p.append([ints[0], ints[1]])
	p.sort()
	answer = ''
	not_found = False
	for i in range(1, len(p)):
		if p[i][0] < p[i - 1][0] or p[i][1] < p[i - 1][1]:
			not_found = True
			break
		for r in range(p[i][0] - p[i - 1][0]):
			answer += 'R'
		for u in range(p[i][1] - p[i - 1][1]):
			answer += 'U'
	if not_found:
		answers.append('NO')
	else:
		answers.append('YES')
		answers.append(answer)
for a in answers:
	print(a)


t = int(input())
for i in range(0, t):
	t2 = int(input())
	position = {}
	max_x = 0
	for x in range(0, t2):
		(x, y) = map(int, input().split())
		if position.get(x, 0) != 0:
			res_list = position[x]
			res_list.append(y)
			position[x] = res_list
		else:
			position[x] = [y]
		max_x = max(max_x, x)
	movement = ''
	res_x = 0
	res_y = [0]
	for x in range(0, max_x + 1):
		res_list2 = position.get(x, 0)
		if res_list2 != 0:
			U_num = max(res_list2) - max(res_y)
			R_num = x - res_x
			res_x = x
			movement += 'R' * R_num
			movement += 'U' * U_num
			if min(res_list2) < max(res_y):
				print('NO')
				break
			else:
				res_y = res_list2
	else:
		print('YES')
		print(movement)


for _ in ' ' * int(input()):
	a = []
	c = ''
	k = 'YES'
	for _ in ' ' * int(input()):
		a += [list(map(int, input().split()))]
	a = sorted(a)
	for i in a:
		if [i[1], i[0]] in a and [i[1], i[0]] != i:
			k = 'NO'
		elif i[0] - c.count('R') < 0 or i[1] - c.count('U') < 0:
			k = 'NO'
		else:
			c = c + (i[0] - c.count('R')) * 'R' + (i[1] - c.count('U')) * 'U'
	if k == 'NO':
		print('NO')
	else:
		print(k)
		print(c)


n = int(input())
for i in range(n):
	k = int(input())
	maldade = [[0, 0]]
	for j in range(k):
		parzinho = [int(x) for x in input().split()]
		maldade.append(parzinho)
	maldade.sort()
	ref = 0
	for par in maldade:
		if par[1] < ref:
			print('NO')
			break
		else:
			ref = par[1]
	else:
		print('YES')
		path = ''
		x = y = 0
		for par in maldade:
			path += 'R' * (par[0] - x)
			path += 'U' * (par[1] - y)
			x = par[0]
			y = par[1]
		print(path)


t = int(input())

def check(pos):
	for f in range(1, len(pos)):
		if pos[f][1] < pos[f - 1][1]:
			return 'NO'
	i = [0, 0]
	ans = ''
	for f in pos:
		while i[0] < f[0]:
			i[0] += 1
			ans = ans + 'R'
		while i[1] < f[1]:
			i[1] += 1
			ans = ans + 'U'
	print('YES')
	return ans
for _ in range(t):
	n = int(input())
	pos = []
	for _ in range(n):
		pos.append(list((int(x) for x in input().split())))
	pos = sorted(pos)
	print(check(pos))


for _ in range(int(input())):
	n = int(input())
	c = 0
	xmax = 0
	a = []
	for _ in range(1001):
		temp = [0] * 1001
		a.append(temp)
	count = [0] * 1001
	ans = []
	for i in range(n):
		(xx, yy) = map(int, input().split())
		a[xx][yy] = 1
		count[xx] += 1
		xmax = max(xmax, xx)
	y = 0
	for x in range(xmax + 1):
		while count[x] > 0:
			if a[x][y] == 1:
				c += 1
				count[x] -= 1
				a[x][y] -= 1
			else:
				y += 1
				ans.append('U')
				if y == 1001:
					break
		if y == 1001:
			break
		if x < xmax:
			ans.append('R')
	if c == n:
		print('YES')
		for num in ans:
			print(num, end='')
		print()
	else:
		print('NO')


from sys import stdin
from collections import defaultdict
T = int(stdin.readline())
for _ in range(T):
	N = int(stdin.readline())
	P = []
	for _ in range(N):
		P.append(list(map(int, stdin.readline().rstrip().split())))
	P = sorted(P, key=lambda p: p[0])
	curY = 0
	curX = 0
	pY = 0
	path = ''
	flag = True
	st = 0
	while st != N:
		if curX != P[st][0]:
			pY = curY
		path += 'R' * (P[st][0] - curX)
		curX = P[st][0]
		if curY < P[st][1]:
			path += 'U' * (P[st][1] - curY)
		curY = max(curY, P[st][1])
		if P[st][1] < pY:
			flag = False
			break
		st += 1
	if flag:
		print('YES')
		print(path)
	else:
		print('NO')


a = int(input())
for _ in range(a):
	n = int(input())
	d = {}
	for j in range(n):
		(q, w) = map(int, input().split())
		if q in d:
			d[q].append(w)
		else:
			d[q] = [w]
	s = ''
	(z, w) = (0, 0)
	for i in sorted(d):
		s += 'R' * (i - z)
		z = i
		if min(d[i]) >= w:
			s += 'U' * (max(d[i]) - w)
			w = max(d[i])
		else:
			w = -1
			break
	if w == -1:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(t):
	q = int(input())
	s = [(0, 0)]
	for i in range(q):
		(x, y) = map(int, input().split())
		s.append((x, y))
	s.sort(key=lambda x: (x[0], x[1]))
	lastx = s[0][0]
	lasty = s[0][1]
	f = True
	ot = ''
	for i in range(1, q + 1):
		ind1 = s[i][0] - lastx
		lastx = s[i][0]
		ind2 = s[i][1] - lasty
		lasty = s[i][1]
		if ind1 >= 0 and ind2 >= 0:
			ot += 'R' * ind1 + 'U' * ind2
		else:
			f = False
			break
	if f:
		print('YES')
		print(ot)
	else:
		print('NO')


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	p = []
	p.append((0, 0))
	for _ in range(n):
		(x, y) = map(int, input().split())
		p.append((x, y))
	p.sort()
	route = ''
	(X, Y) = (0, 0)
	for i in range(1, n + 1):
		X = p[i][0] - p[i - 1][0]
		Y = p[i][1] - p[i - 1][1]
		if X < 0 or Y < 0:
			route = ''
			break
		route += 'R' * X + 'U' * Y
	if route == '':
		ans.append('NO')
	else:
		ans.append('YES')
		ans.append(route)
for i in range(len(ans)):
	print(ans[i])


from sys import stdin, stdout
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))

def chars():
	s = cin()
	return list(s[:len(s) - 1])

def pl(a):
	for val in a:
		cout(val)
(t,) = mp()
for _ in range(t):
	(n,) = mp()
	l = [[0, 0]]
	for i in range(n):
		l += [mp()]
	l.sort()
	s = ''
	for i in range(1, n + 1):
		r = l[i][0] - l[i - 1][0]
		u = l[i][1] - l[i - 1][1]
		if r * u < 0:
			cout('NO\n')
			break
		else:
			s += 'R' * r + 'U' * u
	else:
		cout('YES\n' + s + '\n')


t = int(input())
while t:
	n = int(input())
	flag = True
	array = [[0, 0]]
	for i in range(n):
		array.append(list(map(int, input().split())))
	array.sort()
	for i in range(n):
		if array[i][1] > array[i + 1][1] and array[i][0] < array[i + 1][0]:
			print('NO')
			flag = False
			break
		elif array[i][1] > array[i + 1][1] and array[i][0] == array[i + 1][0]:
			(array[i], array[i + 1]) = (array[i + 1], array[i])
	if flag:
		rev = ''
		for i in range(0, n):
			rev += 'R' * (array[i + 1][0] - array[i][0])
			rev += 'U' * (array[i + 1][1] - array[i][1])
		print('YES')
		print(rev)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	temp = []
	d1 = {}
	for i in range(n):
		(x, y) = map(int, input().split())
		if x not in d1:
			d1[x] = [y]
			temp.append(x)
		else:
			d1[x].append(y)
	moves = []
	flag = 0
	temp.sort()
	current_y = 0
	current_x = 0
	for x in temp:
		if x > current_x:
			moves.append((x - current_x) * 'R')
		d1[x].sort()
		for y in d1[x]:
			if current_y > y:
				flag = 1
				break
		if flag == 1:
			break
		if d1[x][-1] > current_y:
			moves.append((d1[x][-1] - current_y) * 'U')
		current_x = x
		current_y = d1[x][-1]
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(''.join(moves))


def go(n, maze):
	up = list()
	right = list()
	for i in range(n):
		up.append(0)
		right.append(0)
	maxx = 0
	maxy = 0
	for i in maze:
		up[i[0]] += 1
		right[i[1]] += 1
		maxx = max(maxx, i[0])
		maxy = max(maxy, i[1])
	x = 0
	y = 0
	res = 'YES'
	r = ''
	count = 0
	while x != maxx or y != maxy:
		if up[x] > 0 and right[y] > 0 and ([x, y] not in maze) or (up[x] > 1 and right[y] > 1 and ([x, y] in maze)):
			res = 'NO'
			print(res)
			return
		if [x, y] in maze:
			maze.remove([x, y])
			up[x] -= 1
			right[y] -= 1
		if up[x] > right[y]:
			count += 1
			y += 1
			r += 'U'
		else:
			count += 1
			x += 1
			r += 'R'
	print(res)
	print(r)
	return
n = int(input())
for i in range(n):
	li = list()
	size = 0
	count = int(input())
	for i in range(count):
		(x, y) = map(int, input().split())
		size = max(x, y, size)
		li.append([x, y])
	go(size + 1, li)


tests = int(input())
for test in range(tests):
	arr = []
	ans = ''
	me = [0, 0]
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().strip().split())
		arr.append([x, y])
	arr.sort()
	d = True
	for i in arr:
		if i[0] < me[0] or i[1] < me[1]:
			d = False
			break
		else:
			while i[0] > me[0]:
				ans += 'R'
				me[0] += 1
			while i[1] > me[1]:
				ans += 'U'
				me[1] += 1
	if d:
		print('YES')
		print(ans)
	else:
		print('NO')


import sys
LI = lambda : list(map(int, sys.stdin.readline().split()))
MI = lambda : map(int, sys.stdin.readline().split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline())
for _ in range(II()):
	a = sorted([list(MI()) for i in range(II())])
	(ok, ans, px, py) = (1, '', 0, 0)
	for (cx, cy) in a:
		if cx < px or cy < py:
			ok = 0
		else:
			ans += 'R' * (cx - px) + 'U' * (cy - py)
		(px, py) = (cx, cy)
	if ok:
		print('YES', ans, sep='\n')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	b = []
	for j in range(n):
		a = list(map(int, input().split()))
		b.append(a)
	b.sort()
	st = ''
	temp_x = 0
	temp_y = 0
	for j in range(n):
		if temp_x < b[j][0]:
			for k in range(b[j][0] - temp_x):
				st += 'R'
			temp_x = b[j][0]
		if temp_x == b[j][0] and temp_y < b[j][1]:
			for k in range(b[j][1] - temp_y):
				st += 'U'
			temp_y = b[j][1]
		if temp_x > b[j][0] or temp_y > b[j][1]:
			print('NO')
			break
		if temp_x == b[n - 1][0] and temp_y == b[n - 1][1]:
			print('YES')
			print(st)


for _ in range(int(input())):
	n = int(input())
	a = [list(map(int, input().split())) for i in range(n)]
	a.sort()
	ans = 'YES'
	for j in range(n - 1):
		if a[j + 1][1] < a[j][1]:
			ans = 'NO'
			break
	print(ans)
	if ans == 'YES':
		s = 'R' * a[0][0] + 'U' * a[0][1]
		for i in range(1, n):
			rs = a[i][0] - a[i - 1][0]
			us = a[i][1] - a[i - 1][1]
			s += 'R' * rs + 'U' * us
		print(s)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

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

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
from bisect import bisect_left

def solve():
	n = int(input())
	ar = []
	for _ in range(n):
		(x, y) = sep()
		ar.append((x, y))
	ar.sort()
	t = 1
	ans = ''
	cur = (0, 0)
	for i in ar:
		if i[1] < cur[1]:
			t = 0
			break
		else:
			ans += 'R' * (i[0] - cur[0]) + 'U' * (i[1] - cur[1])
		cur = i
	if t == 0:
		print('NO')
	else:
		print('YES')
		print(ans)
t = int(input())
for _ in range(t):
	solve()


def sol():
	n = int(input())
	l = []
	for i in range(n):
		s = list(map(int, input().split()))
		l.append(s)
	l.sort()
	res = ''
	(x, y) = (0, 0)
	flag = True
	for i in l:
		start = i[0] - x
		end = i[1] - y
		if start < 0 or end < 0:
			print('NO')
			flag = False
			break
		for c in range(start):
			res += 'R'
		for x in range(end):
			res += 'U'
		x = i[0]
		y = i[1]
	if flag:
		print('YES')
		print(res)
try:
	for _ in range(int(input())):
		sol()
except:
	pass


def ans(c, n):
	for i in range(n - 1):
		if c[i][1] > c[i + 1][1]:
			print('NO')
			return
	s = ''
	c = [[0, 0]] + c
	for i in range(n):
		s += 'R' * (c[i + 1][0] - c[i][0])
		s += (c[i + 1][1] - c[i][1]) * 'U'
	print('YES')
	print(s)
	return
for _ in range(int(input())):
	n = int(input())
	c = []
	for i in range(n):
		(a, b) = map(int, input().split())
		c.append([a, b])
	c.sort()
	ans(c, n)


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		a.append(list(map(int, input().split())))
	a.sort()
	prev_x = 0
	prev_y = 0
	i = 0
	flag = 0
	strr = ''
	while i < n:
		if a[i][0] >= prev_x and a[i][1] >= prev_y:
			x = a[i][0] - prev_x
			y = a[i][1] - prev_y
		else:
			print('NO')
			flag = 1
			break
		strr = strr + 'R' * x + 'U' * y
		prev_x = a[i][0]
		prev_y = a[i][1]
		i = i + 1
	if flag == 0:
		print('YES')
		print(strr)


t = int(input())
for a in range(t):
	flag = False
	n = int(input())
	curr = [0, 0]
	packages = []
	string = ''
	for b in range(n):
		packages.append(list(map(int, input().split())))
	distances = []
	for c in packages:
		distances.append(c[0] + c[1])
	packs = [d for (_, d) in sorted(zip(distances, packages))]
	distances.sort()
	for e in range(n - 1):
		if distances[e] == distances[e + 1]:
			print('NO')
			flag = True
			break
	if flag == False:
		for f in packs:
			if curr[0] > f[0] or curr[1] > f[1]:
				print('NO')
				flag = True
				break
			temp = curr
			curr = f
			for g in range(curr[0] - temp[0]):
				string = string + 'R'
			for h in range(curr[1] - temp[1]):
				string = string + 'U'
		if flag == False:
			print('YES')
			print(string)


for _ in range(int(input())):
	n = int(input())
	arr = []
	ans = []
	flag = 0
	for i in range(n):
		(xi, yi) = map(int, input().split())
		arr.append([xi, yi])
	arr.append([0, 0])
	arr.sort()
	for i in range(len(arr) - 1):
		if arr[i][1] > arr[i + 1][1]:
			flag = 1
			break
		else:
			rapp = arr[i + 1][0] - arr[i][0]
			while rapp > 0:
				ans.append('R')
				rapp -= 1
			uapp = arr[i + 1][1] - arr[i][1]
			while uapp > 0:
				ans.append('U')
				uapp -= 1
	if flag == 1:
		print('NO')
	else:
		print('YES')
		for i in ans:
			print(i, end='')
		print()


for _ in range(int(input())):
	n = int(input())
	pos = []
	for i in range(n):
		(a, b) = map(int, input().split())
		pos.append([a, b])
	pos.sort(key=lambda a: [a[0], a[1]])
	s = sorted(pos, key=lambda a: a[0] + a[1])
	(a, b) = (0, 0)
	ans = ''
	flag = True
	for i in range(len(s)):
		if s[i][1] < b or s[i][0] < a:
			flag = False
			break
		up = s[i][1] - b
		right = s[i][0] - a
		(a, b) = (s[i][0], s[i][1])
		ans += 'R' * right + 'U' * up
	if flag == False:
		print('NO')
	else:
		print('YES')
		print(ans)


import sys
input = sys.stdin.readline
t = int(input())
out = []
for _ in range(t):
	n = int(input())
	pos = []
	for __ in range(n):
		pos.append(tuple(map(int, input().split())))
	pos.sort()
	currX = 0
	currY = 0
	s = ''
	works = True
	for (x, y) in pos:
		if currX > x:
			works = False
			break
		else:
			s += 'R' * (x - currX)
			currX = x
		if currY > y:
			works = False
			break
		else:
			s += 'U' * (y - currY)
			currY = y
	if works:
		out.append('YES')
		out.append(s)
	else:
		out.append('NO')
print('\n'.join(out))


t = int(input())
for i in range(t):
	n = int(input())
	x = []
	y = []
	u = ''
	count = 0
	for j in range(n):
		s = list(map(int, input().split()))
		x.append(s)
	x.sort()
	for j in x:
		y.append(j[1])
	y1 = y[:]
	y.sort()
	if y != y1:
		print('NO')
	else:
		print('YES')
		for j in range(len(x)):
			if j == 0:
				u = u + 'R' * x[j][0]
				u = u + 'U' * x[j][1]
			else:
				u = u + 'R' * (x[j][0] - x[j - 1][0])
				u = u + 'U' * (x[j][1] - x[j - 1][1])
		print(u)


t = int(input())
for z in range(0, t):
	q = int(input())
	a = []
	for i in range(0, q):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.sort()
	s = ''
	x = 0
	y = 0
	t = 0
	i = 0
	while i < q:
		if x < a[i][0]:
			x += 1
			s += 'R'
		elif y < a[i][1]:
			y += 1
			s += 'U'
		elif x == a[i][0] and y == a[i][1]:
			i += 1
		else:
			break
	if i == q:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for i in range(t):
	ans = ''
	f = 0
	a = []
	n = int(input())
	for j in range(n):
		a.append(list(map(int, input().split())))
	a.sort()
	st = 0
	for j in a:
		if st > j[1]:
			f = 1
			print('NO')
			break
		st = j[1]
	c = [0, 0]
	if f == 0:
		for j in a:
			ans += (j[0] - c[0]) * 'R'
			ans += (j[1] - c[1]) * 'U'
			c = j
		print('YES')
		print(ans)


def solve(n, ll):
	ll.sort()
	(x, y) = (0, 0)
	ans = ''
	for i in ll:
		if i[0] < x or i[-1] < y:
			return 'NO'
		ans += 'R' * (i[0] - x)
		ans += 'U' * (i[-1] - y)
		(x, y) = (i[0], i[-1])
	if x == ll[-1][0] and y == ll[-1][-1]:
		print('YES')
		return ans
	return 'NO'
t = int(input())
for _ in range(t):
	n = int(input())
	points = []
	for i in range(n):
		(x, y) = map(int, input().split())
		points.append([x, y])
	print(solve(n, points))


from operator import attrgetter

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def show(self):
		return (self.x, self.y)

def key_sort(a):
	return 10000000 * a.x + a.y
T = int(input())
for t in range(0, T):
	n = int(input())
	a = []
	str = ''
	for i in range(0, n):
		(x, y) = map(int, input().split())
		a.append(Point(x, y))
	a = sorted(a, key=key_sort)
	lastX = 0
	lastY = 0
	b = True
	for A in a:
		str += (A.x - lastX) * 'R'
		lastX = A.x
		if A.y < lastY:
			b = False
			break
		str += (A.y - lastY) * 'U'
		lastY = A.y
	if b == True:
		print('YES')
		print(str)
	else:
		print('NO')


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]
mo = 1000000007
for _ in range(inn()):
	n = inn()
	a = parr()
	a.sort(key=lambda x: x[0] + x[1])
	x = 0
	y = 0
	flag = 0
	ans = ''
	for i in range(n):
		res1 = a[i][0] - x
		res2 = a[i][1] - y
		if res1 < 0 or res2 < 0:
			flag = 1
			break
		ans += 'R' * res1 + 'U' * res2
		x = a[i][0]
		y = a[i][1]
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	l = [list(map(int, input().split())) for i in range(n)]
	l = sorted(l, key=lambda x: (x[0], x[1]))
	s = ''
	for i in range(n):
		if i == 0:
			r = l[i][0] - 0
			u = l[i][1] - 0
			if r >= 0 and u >= 0:
				s += 'R' * r + 'U' * u
			else:
				s = ''
				break
		else:
			r = l[i][0] - l[i - 1][0]
			u = l[i][1] - l[i - 1][1]
			if r >= 0 and u >= 0:
				s += 'R' * r + 'U' * u
			else:
				s = ''
				break
	if s != '':
		print('YES')
		print(s)
	else:
		print('NO')


from sys import stdin
import operator
t = int(stdin.readline().rstrip())
while t > 0:
	n = int(stdin.readline().rstrip())
	l = []
	for i in range(n):
		p = list(map(int, stdin.readline().split()))
		l.append(p)
	li = sorted(l, key=lambda kv: kv[0])
	li1 = sorted(li, key=lambda kv: kv[1])
	ans = ''
	f = 0
	for i in range(n):
		if i != 0:
			if li1[i][0] < li1[i - 1][0]:
				f = 1
			elif li1[i][1] < li1[i - 1][1]:
				f = 1
			else:
				ans += (li1[i][0] - li1[i - 1][0]) * 'R' + (li1[i][1] - li1[i - 1][1]) * 'U'
		else:
			ans += li1[i][0] * 'R' + li1[i][1] * 'U'
	if f == 0:
		print('YES')
		print(ans)
	else:
		print('NO')
	t -= 1


t = int(input())
while t:
	t -= 1
	a = []
	n = int(input())
	while n:
		n -= 1
		x = list(map(int, input().split()))
		a.append(x)
	a.sort()
	b = a + []
	b = sorted(b, key=lambda x: x[1])
	if b != a:
		print('NO')
	else:
		print('YES')
		x1 = 0
		y1 = 0
		for i in range(0, len(a)):
			e = a[i][0] - x1
			while e:
				e -= 1
				print('R', end='')
			x1 = a[i][0]
			e = a[i][1] - y1
			while e:
				e -= 1
				print('U', end='')
			y1 = a[i][1]
		print()


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for _ in range(t):
	n = sInt()
	a = [[0, 0]]
	ans = ''
	k = 1
	for i in range(n):
		b = lInt()
		a.append(b)
	a.sort()
	for i in range(n):
		if a[i][0] == a[i + 1][0] and a[i][1] != a[i + 1][1]:
			ans += 'U' * (a[i + 1][1] - a[i][1])
		elif a[i][0] != a[i + 1][0] and a[i][1] == a[i + 1][1]:
			ans += 'R' * (a[i + 1][0] - a[i][0])
		elif a[i][0] != a[i + 1][0] and a[i][1] != a[i + 1][1]:
			ans += 'R' * (a[i + 1][0] - a[i][0])
			ans += 'U' * (a[i + 1][1] - a[i][1])
		if a[i + 1][0] - a[i][0] < 0 or a[i + 1][1] - a[i][1] < 0:
			k = 0
			break
	if k == 0:
		print('NO')
	else:
		print('YES')
		print(ans)


for i in range(int(input())):
	l = [list(map(int, input().split())) for j in range(int(input()))]
	x = list()
	ll = list()
	l.sort()
	for k in l:
		x.append(k[1])
	x.sort()
	a = b = z = 0
	for l1 in l:
		if l1[1] == x[z]:
			ll.append((l1[0] - a) * 'R' + (l1[1] - b) * 'U')
			a = l1[0]
			b = l1[1]
			z += 1
		else:
			break
	if z == len(x):
		print('YES')
		print(''.join(ll))
	else:
		print('NO')


t = int(input())
for test in range(t):
	n = int(input())
	p = []
	for nn in range(n):
		x = list(map(int, input().split()))
		p.append(x)
	p.sort()
	res = 'YES'
	for i in range(n):
		if p[i][0] < 0 or p[i][1] < 0:
			res = 'NO'
	if res == 'YES':
		for i in range(n):
			for j in range(n):
				if p[i][0] > p[j][0] and p[i][1] < p[j][1]:
					res = 'NO'
					break
	if res == 'YES':
		cur = p[0]
		print(res)
		print('R' * cur[0], end='')
		print('U' * cur[1], end='')
		for i in range(1, n - 1):
			x = p[i]
			if x[0] > cur[0]:
				print('R' * (x[0] - cur[0]), end='')
				print('U' * (x[1] - cur[1]), end='')
			else:
				print('U' * (x[1] - cur[1]), end='')
			cur = x
		print('R' * (p[n - 1][0] - cur[0]), end='')
		print('U' * (p[n - 1][1] - cur[1]), end='')
		print()
	else:
		print('NO')


def func(arr):
	my_pos = [0, 0]
	for x in arr:
		if my_pos[0] < x[0]:
			print('R' * (x[0] - my_pos[0]), end='')
			my_pos[0] = x[0]
		if my_pos[1] < x[1]:
			print('U' * (x[1] - my_pos[1]), end='')
			my_pos[1] = x[1]
	print()
test = int(input())
for _ in range(test):
	points = int(input())
	arr = []
	for a in range(points):
		(x, y) = input().split()
		x = int(x)
		y = int(y)
		arr.append([x, y])
	arr = sorted(arr, key=lambda k: [k[0], k[1]])
	isbr = 0
	for i in range(len(arr) - 1):
		if arr[i][0] > arr[i + 1][0]:
			isbr = 1
			break
	if isbr == 0:
		for i in range(len(arr) - 1):
			if arr[i][1] > arr[i + 1][1]:
				isbr = 1
				break
	if isbr == 1:
		print('NO')
	else:
		print('YES')
		func(arr)


t = int(input())
for _ in range(0, t):
	flag = 0
	arr = []
	for x in range(0, int(input())):
		f = input().split(' ')
		f = list(map(int, f))
		arr.append(tuple(f))
	arr.sort()
	if len(arr) != 1:
		for i in range(0, len(arr) - 1):
			if arr[i][1] > arr[i + 1][1]:
				print('NO')
				flag = 1
				break
	if flag == 1:
		continue
	print('YES')
	print('R' * int(arr[0][0]), end='')
	print('U' * int(arr[0][1]), end='')
	for i in range(0, len(arr) - 1):
		for _ in range(0, int(arr[i + 1][0]) - int(arr[i][0])):
			print('R', end='')
		for _ in range(0, int(arr[i + 1][1]) - int(arr[i][1])):
			print('U', end='')
	print()


t = int(input())
for a in range(t):
	n = int(input())
	package = []
	for b in range(n):
		package.append([int(i) for i in input().split()])
	package.sort()
	path = ''
	x = 0
	y = 0
	for i in package:
		if i[0] < x or i[1] < y:
			print('NO')
			break
		else:
			path = path + 'R' * (i[0] - x)
			path = path + 'U' * (i[1] - y)
			x = i[0]
			y = i[1]
	else:
		print('YES')
		print(path)


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	coor = []
	max_x = 0
	for i in range(1001):
		coor.append([])
	for i in range(n):
		(x, y) = map(int, input().split())
		if x > max_x:
			max_x = x
		coor[x].append(y)
	maxi = 0
	m = 0
	st = []
	flag = 0
	for i in range(max_x + 1):
		for j in coor[i]:
			if m <= j:
				if j > maxi:
					maxi = j
			else:
				ans.append('NO')
				flag = -1
				break
		for k in range(m, maxi):
			st.append('U')
		m = maxi
		st.append('R')
		if flag == -1:
			break
	if flag == -1:
		continue
	st.pop()
	if flag == 0:
		ans.append('YES')
		ans.append(''.join(st))
for i in ans:
	print(i)


d = int(input())
ans1 = [True] * d
ans = [''] * d
for i in range(d):
	n = int(input())
	x = [[0] * 2 for j in range(n)]
	for j in range(n):
		(x[j][0], x[j][1]) = map(int, input().split())
	x.sort()
	ans[i] = 'R' * x[0][0] + 'U' * x[0][1]
	for j in range(1, n):
		if x[j][1] < x[j - 1][1]:
			ans1[i] = False
			break
		else:
			ans[i] += 'R' * (x[j][0] - x[j - 1][0]) + 'U' * (x[j][1] - x[j - 1][1])
for i in range(d):
	if ans1[i]:
		print('YES')
		print(ans[i])
	else:
		print('NO')


def get_input_of_test():
	coords = [(0, 0)]
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().split())
		coords.append((x, y))
	coords.sort()
	return coords

def sol_of_test(coords):
	steps = list()
	cur_y = 0
	for ind in range(1, len(coords)):
		if coords[ind][1] < cur_y:
			return ('NO', steps)
		x_shift = coords[ind][0] - coords[ind - 1][0]
		y_shift = coords[ind][1] - coords[ind - 1][1]
		steps.extend(['R' for i in range(x_shift)])
		steps.extend(['U' for i in range(y_shift)])
		cur_y += y_shift
	return ('YES', ''.join(steps))
num_tests = int(input())
answers = []
for test_ind in range(num_tests):
	coords = get_input_of_test()
	answ = sol_of_test(coords)
	answers.append(answ)
for test_ind in range(num_tests):
	print(answers[test_ind][0])
	if answers[test_ind][0] == 'YES':
		print(answers[test_ind][1])


kl = int(input())
for l in range(kl):
	n = int(input())
	a = [[0 for i in range(n + 2)] for j in range(2)]
	(a[0][0], a[1][0], a[0][n + 1], a[1][n + 1]) = (0, 0, 1100, 1100)
	s = [0, n + 1]
	sc = 2
	pr = 0
	for i in range(1, n + 1):
		(a[0][i], a[1][i]) = [int(i) for i in input().split()]
		if pr:
			continue
		for k in range(sc):
			if a[0][i] ** 2 + a[1][i] ** 2 < a[0][s[k]] ** 2 + a[1][s[k]] ** 2:
				if a[0][i] <= a[0][s[k]] and a[1][i] <= a[1][s[k]] and (a[0][i] >= a[0][s[k - 1]]) and (a[1][i] >= a[1][s[k - 1]]):
					sc += 1
					s.insert(k, i)
					break
				else:
					pr = 1
					break
	if pr:
		print('NO')
	else:
		print('YES')
		for i in range(1, n + 1):
			for ii in range(a[0][s[i]] - a[0][s[i - 1]]):
				print('R', end='')
			for ii in range(a[1][s[i]] - a[1][s[i - 1]]):
				print('U', end='')
		print()


inputNum = int(input())
ansList = []
for i in range(inputNum):
	boxNum = int(input())
	boxList = []
	for j in range(boxNum):
		boxCrd = [int(n) for n in input().split()]
		boxList.append(boxCrd)
	boxList.sort()
	ansString = ''
	currentXCrd = 0
	currentYCrd = 0
	for j in range(boxNum):
		if boxList[j][0] - currentXCrd > 0:
			for k in range(boxList[j][0] - currentXCrd):
				ansString = ansString + 'R'
		if boxList[j][1] - currentYCrd > 0:
			for k in range(boxList[j][1] - currentYCrd):
				ansString = ansString + 'U'
		elif boxList[j][1] - currentYCrd < 0:
			ansString = ''
			break
		currentXCrd = boxList[j][0]
		currentYCrd = boxList[j][1]
	ansList.append(ansString)
for i in ansList:
	if i != '':
		print('YES')
		print(i)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	x = 0
	y = 0
	result = 'YES'
	path = ''
	pkgs = [[int(j) for j in input().split(' ')] for i in range(n)]
	pkgs = sorted(pkgs, key=sum)
	xVals = [i[0] for i in pkgs]
	yVals = [i[1] for i in pkgs]
	while True:
		if len(xVals) == 0:
			break
		if x in xVals and y in yVals:
			result = 'NO'
			break
		elif x not in xVals:
			x += 1
			path += 'R'
		else:
			y += 1
			path += 'U'
		if x == xVals[0] and y == yVals[0]:
			xVals = xVals[1:]
			yVals = yVals[1:]
	print(result)
	if result == 'YES':
		print(path)


t = int(input())
for _ in range(t):
	n = int(input())
	coords = []
	for i in range(n):
		(x, y) = map(int, input().split())
		coords.append((x, y))
	coords.sort()
	(px, py) = (0, 0)
	answer = []
	ok = True
	for (x, y) in coords:
		if x >= px and y >= py:
			answer.append('R' * (x - px))
			answer.append('U' * (y - py))
		else:
			ok = False
			break
		(px, py) = (x, y)
	if ok:
		print('YES')
		print(''.join(answer))
	else:
		print('NO')


def main():
	for _ in range(int(input())):
		n = int(input())
		arr = [tuple(map(int, input().split())) for _ in range(n)]
		arr.sort()
		current_position = (0, 0)
		ans_string = ''
		flag = True
		for package_position in arr:
			(x_difference, y_difference) = (package_position[0] - current_position[0], package_position[1] - current_position[1])
			if y_difference < 0:
				flag = False
				break
			ans_string += 'R' * x_difference + 'U' * y_difference
			current_position = (current_position[0] + x_difference, current_position[1] + y_difference)
		if flag:
			print('YES')
			print(ans_string)
		else:
			print('NO')
main()


def rob():
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	if n == 1:
		print('YES')
		print('R' * x + 'U' * y)
		return
	a.sort()
	for j in range(n - 1):
		if a[j][1] > a[j + 1][1]:
			print('NO')
			return
	print('YES')
	print('R' * a[0][0] + 'U' * a[0][1], end='')
	for k in range(1, n - 1):
		print('R' * (a[k][0] - a[k - 1][0]) + 'U' * (a[k][1] - a[k - 1][1]), end='')
	print('R' * (a[n - 1][0] - a[n - 2][0]) + 'U' * (a[n - 1][1] - a[n - 2][1]))
t = int(input())
for i in range(t):
	rob()


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n').split(' ')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = int(input())
	l = []
	for i in range(n):
		l.append(li())
	l.sort(key=lambda x: (x[1], x[0]))
	ans = 'YES'
	for i in range(1, n):
		if l[i - 1][1] != l[i][1] and l[i - 1][0] > l[i][0]:
			ans = 'NO'
			break
	print(ans)
	if ans == 'NO':
		continue
	s = ''
	l = [[0, 0]] + l
	for i in range(1, n + 1):
		while l[i - 1][0] < l[i][0]:
			l[i - 1][0] += 1
			s += 'R'
		while l[i][1] > l[i - 1][1]:
			l[i - 1][1] += 1
			s += 'U'
	print(s)


for _ in range(int(input())):
	x = []
	y = []
	for t in range(int(input())):
		k = list(map(int, input().split()))
		y.append(k[1])
		x.append(k)
	x = sorted(x)
	y = sorted(y)
	m = x[0][1]
	for i in range(len(x)):
		if x[i][1] != y[i]:
			print('NO')
			break
	else:
		print('YES')
		s = ''
		p1 = 0
		p2 = 0
		for i in x:
			a = i[0] - p1
			b = i[1] - p2
			t = 'R'
			p = 'U'
			s = s + t * a + p * b
			p1 = i[0]
			p2 = i[1]
		print(s)


for _ in range(int(input())):
	a = []
	for _ in range(int(input())):
		a.append(tuple(map(int, input().split())))
	a = sorted(a)
	i = j = 0
	has_res = True
	res = ''
	for ele in a:
		if ele[0] < i or ele[1] < j:
			has_res = False
			break
		res += 'R' * (ele[0] - i)
		i = ele[0]
		res += 'U' * (ele[1] - j)
		j = ele[1]
	if has_res:
		print('YES')
		print(res)
	else:
		print('NO')


import sys
import math

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

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

def input():
	return sys.stdin.readline().strip()
from collections import defaultdict
for _ in range(int(input())):
	A = defaultdict(list)
	B = {}
	C = []
	N = int(input())
	for i in range(N):
		(a, b) = ilele()
		C.append((a, b))
	C.sort()
	for (a, b) in C:
		A[a].append(b)
		B[a, b] = 0
	stri = ''
	temp = 0
	global temp2
	temp2 = 0
	flag = 0
	for (i, j) in A.items():
		stri += 'R' * (i - temp)
		temp = i
		for k in j:
			if k < temp2:
				flag = 1
				break
			stri += 'U' * (k - temp2)
			temp2 = k
			B[i, k] = 1
	if flag == 1:
		print('NO')
		continue
	if 0 in B.values():
		print('NO')
	else:
		print('YES')
		print(stri)


import math

def main_function():
	tests = range(int(input()))
	for test in tests:
		packages = [[int(j) for j in input().split(' ')] for i in range(int(input()))]
		packages = sorted(packages, key=lambda x: (x[0], x[1]))
		last_item = packages[0]
		is_there_ordered = True
		for i in packages:
			if last_item[1] > i[1]:
				is_there_ordered = False
			last_item = i
		if not is_there_ordered:
			print('NO')
		else:
			print('YES')
			last_point = [0, 0]
			for i in packages:
				print('R' * (i[0] - last_point[0]), end='')
				print('U' * (i[1] - last_point[1]), end='')
				last_point = i
			print()
main_function()


from sys import stdin, stdout

def main():
	N = int(stdin.readline())
	for i in range(N):
		mapper = []
		num = int(stdin.readline())
		for j in range(num):
			arr = list(map(int, stdin.readline().split()))
			mapper.append(arr)
		mapper = sorted(mapper, key=lambda x: (x[0], x[1]))
		minx = 0
		miny = 0
		is_success = True
		path = ''
		for [x, y] in mapper:
			if x < minx or y < miny:
				print('NO')
				is_success = False
				break
			while minx < x:
				path = path + 'R'
				minx = minx + 1
			while miny < y:
				path = path + 'U'
				miny = miny + 1
		if is_success is True:
			stdout.write('YES\n')
			stdout.write(path + '\n')
main()


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import deque
from heapq import heappush, heappop
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
t = ip()
for _ in range(t):
	n = ip()
	dic = defaultdict(list)
	for i in range(n):
		(x, y) = inp()
		dic[x].append(y)
	ch = sorted(list(dic.keys()))
	for i in ch:
		dic[i].sort()
	temp = []
	for i in ch:
		temp += dic[i]
	check = sorted(list(temp))
	if check == temp:
		(x, y) = (0, 0)
		ans = ''
		for i in ch:
			ans += 'R' * (i - x)
			x = i
			for j in dic[i]:
				ans += 'U' * (j - y)
				y = j
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for test in range(t):
	n = int(input())
	pos = []
	for i in range(n):
		(x, y) = [int(x) for x in input().split()]
		pos.append((x, y))
	pos.sort()
	ans = []
	curx = 0
	cury = 0
	f = 0
	for (x, y) in pos:
		if x < curx or y < cury:
			f = 1
			break
		for i in range(x - curx):
			ans.append('R')
		for i in range(y - cury):
			ans.append('U')
		curx = x
		cury = y
	if f == 1:
		print('NO')
	else:
		print('YES')
		for i in range(len(ans)):
			print(ans[i], end='')
		print()


t = int(input())
for i in range(t):
	m = int(input())
	L1 = []
	L4 = []
	d = {}
	s = ''
	for i in range(m):
		ch = input()
		L = [int(i) for i in ch.split()]
		a = L[0]
		b = L[1]
		L4.append((a, b))
		if a not in L1:
			L1.append(a)
		if a not in d:
			d[a] = [b]
		else:
			d[a].append(b)
		x = 0
		y = 0
		X = 0
		Y = 0
		L1.sort()
	test = True
	for i in range(len(L4)):
		for j in range(i + 1, len(L4)):
			if L4[i][0] > L4[j][0] and L4[i][1] < L4[j][1] or (L4[i][0] < L4[j][0] and L4[i][1] > L4[j][1]):
				test = False
	if test == True:
		for i in L1:
			s += 'R' * (i - x)
			X += i - x
			x = i
			s += 'U' * (max(d[i]) - y)
			Y += max(d[i]) - y
			y = max(d[i])
		print('YES')
		print(s)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = ''
	shan = 0
	sree = []
	for i in range(n):
		(l, k) = map(int, input().split())
		sree.append([l, k])
	sree.sort()
	(a, b) = (0, 0)
	for i in range(n):
		(l, k) = (sree[i][0], sree[i][1])
		if l >= a and k >= b and (shan != 1):
			s += 'R' * (l - a) + 'U' * (k - b)
			(a, b) = (l, k)
		else:
			shan = 1
	if shan:
		print('NO')
	else:
		print('YES')
		print(s)


n = int(input())
for i in range(n):
	t = int(input())
	l = []
	for j in range(t):
		l.append([*map(int, input().split())])
	sl = sorted(l, key=lambda x: (x[0], x[1]))
	j0 = 0
	j1 = 0
	no = False
	for j in range(len(sl)):
		if sl[j][0] < j0 or sl[j][1] < j1:
			no = True
			break
		j0 = sl[j][0]
		j1 = sl[j][1]
	if no:
		print('NO')
		continue
	print('YES')
	curPos = [0, 0]
	for j in range(len(sl)):
		for k in range(sl[j][0] - curPos[0]):
			print('R', end='')
		for k in range(sl[j][1] - curPos[1]):
			print('U', end='')
		curPos = sl[j]
	print()


import sys
import math
for _ in range(int(input())):
	n = int(input())
	a = []
	pos = [0, 0]
	for i in range(n):
		a.append(list(map(int, input().split())))
	a.sort()
	path = ''
	res = True
	for j in a:
		if j[0] > pos[0]:
			path += 'R' * (j[0] - pos[0])
			pos[0] = j[0]
		if j[1] > pos[1]:
			path += 'U' * (j[1] - pos[1])
			pos[1] = j[1]
		elif j[1] < pos[1]:
			res = False
			break
	if res:
		print('YES')
		print(path)
	else:
		print('NO')


import os

def f(x_y_arr):
	x_y_arr.sort(key=lambda x: (x[0], x[1]))
	x_prev = 0
	y_prev = 0
	result = ''
	for (x, y) in x_y_arr:
		if x < x_prev or y < y_prev:
			return 'NO'
		elif x == x_prev:
			result += 'U' * (y - y_prev)
		elif y == y_prev:
			result += 'R' * (x - x_prev)
		else:
			result += 'R' * (x - x_prev)
			result += 'U' * (y - y_prev)
		x_prev = x
		y_prev = y
	return f'YES\n{result}'
if os.environ.get('DEBUG', False):
	print(f'{f([(1, 3), (1, 2), (3, 3), (5, 5), (4, 3)])} = RUUURRRRUU')
	print(f'{f([(1, 0), (0, 1)])} = NO')
	print(f'{f([(4, 3)])} = RRRRUUU')
else:
	for _ in range(int(input())):
		x_y_arr = []
		for _ in range(int(input())):
			x_y_arr.append(tuple(map(int, input().split())))
		print(f(x_y_arr))


def solver(num_packages, package_positions):
	current_pos = [0, 0]
	package_positions = sorted(package_positions)
	path = ''
	for position in package_positions:
		x_displacement = position[0] - current_pos[0]
		y_displacement = position[1] - current_pos[1]
		if x_displacement < 0 or y_displacement < 0:
			print('NO')
			return
		path += 'R' * x_displacement + 'U' * y_displacement
		current_pos = position
	print('YES')
	print(path)
test_cases = input()
for test in range(int(test_cases)):
	num_packages = int(input())
	package_positions = []
	for i in range(num_packages):
		package_positions.append([int(x) for x in input().split()])
	solver(num_packages, package_positions)


def fin_path(n, boxes):
	curr = [[0, 0]]
	path = []
	boxes.sort()
	for i in range(1, n):
		if boxes[i - 1][0] > boxes[i][0] or boxes[i - 1][1] > boxes[i][1]:
			print('NO')
			return
	for i in range(n):
		path.append((boxes[i][0] - curr[-1][0], boxes[i][1] - curr[-1][1]))
		curr.append(boxes[i])
	print('YES')
	for (i, j) in path:
		for x in range(i):
			print('R', end='')
		for y in range(j):
			print('U', end='')
	print('')
t = int(input())
for _ in range(t):
	boxes = []
	n = int(input())
	for i in range(n):
		boxes.append(list(map(int, input().split())))
	fin_path(n, boxes)


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())

def solve():
	packages = inp()
	coords = []
	n = packages
	while n != 0:
		coords.append(inlt())
		n = n - 1
	(x, y) = (0, 0)
	path = ''
	possible = False
	coords.sort()
	for i in range(len(coords)):
		coord = coords[i]
		if coord[0] >= x and coord[1] >= y:
			possible = True
		else:
			possible = False
			break
		if x < coord[0]:
			x_distance = coord[0] - x
			path = path + x_distance * 'R'
			x = coord[0]
		if y < coord[1]:
			y_distance = coord[1] - y
			path = path + y_distance * 'U'
			y = coord[1]
	if not possible:
		print('NO')
	else:
		print('YES')
		print(path)
n = inp()
while n != 0:
	solve()
	n = n - 1


for _ in range(int(input())):
	pos = [0, 0]
	s = ''
	xy = []
	f = 0
	for i in range(int(input())):
		xy.append([int(x) for x in input().split()])
	xy = sorted(xy)
	for item in xy:
		x = item[0] - pos[0]
		y = item[1] - pos[1]
		if x < 0 or y < 0:
			f += 1
			break
		else:
			s += 'R' * x + 'U' * y
			pos = item
	if f > 0:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(t):
	n = int(input())
	total = [(0, 0)]
	for j in range(n):
		li = list(map(int, input().split(' ')))
		(up, down) = (li[0], li[1])
		total.append((up, down))
	total = list(sorted(total, key=lambda x: x[0] + x[1]))
	flag = True
	path = ''
	for o in range(1, len(total)):
		if total[o][0] >= total[o - 1][0] and total[o][1] >= total[o - 1][1]:
			down = total[o][0] - total[o - 1][0]
			ups = total[o][1] - total[o - 1][1]
			path = path + 'R' * down
			path = path + 'U' * ups
		else:
			flag = False
			break
	if flag:
		print('YES')
		print(path)
	else:
		print('NO')


n = int(input())
for i in range(n):
	m = int(input())
	l = []
	for j in range(m):
		w = list(map(int, input().split()))
		l.append(w)
	l.append([0, 0])
	l.sort()
	c = 0
	p = []
	for i in range(m):
		x = l[i + 1][0] - l[i][0]
		y = l[i + 1][1] - l[i][1]
		if x >= 0 and y >= 0:
			if x > 0:
				p.append(x * 'R')
			if y > 0:
				p.append(y * 'U')
		else:
			c += 1
			print('NO')
			break
	if c == 0:
		print('YES')
		print(''.join(p))


count = int(input())
for i in range(count):
	n = int(input())
	data = []
	for j in range(n):
		data.append(tuple(map(int, input().split())))
	data = sorted(data, key=lambda a: (a[1], a[0]))
	(x, y) = (0, 0)
	way = ''
	for element in data:
		delta = element[0] - x
		if delta < 0:
			print('NO')
			break
		for _ in range(delta):
			way += 'R'
		x += delta
		delta = element[1] - y
		if delta < 0:
			print('NO')
			break
		for _ in range(delta):
			way += 'U'
		y += delta
	else:
		print('YES')
		print(''.join(way))
		continue


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	pnt = sorted([tuple(map(int, input().split())) for i in range(n)])
	vis = [0] * n
	(px, py, res) = (0, 0, '')
	for (x, y) in pnt:
		if x < px or y < py:
			print('NO')
			break
		res += 'R' * (x - px)
		res += 'U' * (y - py)
		(px, py) = (x, y)
	else:
		print('YES')
		print(res)


t = int(input())
for i in range(t):
	ans = ''
	n = int(input())
	arr = []
	for j in range(n):
		x_y = list(map(int, input().split(' ')))
		arr.append(x_y)
	arr.sort()
	pos = [0, 0]
	flag = 1
	for elem in arr:
		(x, y) = elem
		if pos[0] > x or pos[1] > y:
			flag = 0
			break
		else:
			ans += 'R' * (x - pos[0])
			ans += 'U' * (y - pos[1])
			pos = [x, y]
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	l = []
	for __ in range(int(input())):
		l.append(tuple(map(int, input().split())))
	l.sort()
	l.insert(0, (0, 0))
	s = ''
	for i in range(len(l) - 1):
		x = l[i + 1][0] - l[i][0]
		y = l[i + 1][1] - l[i][1]
		if x >= 0 and y >= 0:
			s += x * 'R' + y * 'U'
		else:
			s = ''
			break
	if s == '':
		print('NO')
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l1 = list(map(int, input().split()))
		l.append(l1)
	l = sorted(l)
	flag = 0
	s = ''
	if l[0][0] > 0:
		s = s + l[0][0] * 'R'
	if l[0][1] > 0:
		s = s + l[0][1] * 'U'
	for i in range(len(l) - 1):
		if l[i][0] <= l[i + 1][0]:
			s = s + (l[i + 1][0] - l[i][0]) * 'R'
		else:
			flag = 1
			break
		if l[i][1] <= l[i + 1][1]:
			s = s + (l[i + 1][1] - l[i][1]) * 'U'
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


import math
for t in range(int(input())):
	n = int(input())
	l = []
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		l.append((x, y))
	l = sorted(l)
	ans = []
	(x, y) = (0, 0)
	flag = True
	for i in range(n):
		if y > l[i][1]:
			print('NO')
			flag = False
			break
		RR = 'R' * (l[i][0] - x)
		x = l[i][0]
		ans.append(RR)
		LL = 'U' * (l[i][1] - y)
		y = l[i][1]
		ans.append(LL)
	if flag:
		print('YES')
		print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	sachin = [(0, 0)]
	for x in range(n):
		sachin.append(tuple(map(int, input().split())))
	sachin.sort()
	count = int(0)
	ans = []
	for i in range(len(sachin) - 1):
		if sachin[i][1] > sachin[i + 1][1]:
			count = int(1)
			break
		for y in range(sachin[i + 1][0] - sachin[i][0]):
			ans.append('R')
		for y in range(sachin[i + 1][1] - sachin[i][1]):
			ans.append('U')
	if count == 1:
		print('NO')
	else:
		print('YES')
		for val in ans:
			print(val, end='')
		print('')


import functools
t = int(input())

def comp(a, b):
	disa = abs(a[0]) + abs(a[1])
	disb = abs(b[0]) + abs(b[1])
	if disa < disb:
		return -1
	elif disb > disa:
		return 1
	elif a[0] < b[0]:
		return -1
	elif a[0] > b[0]:
		return 1
	elif a[1] < b[1]:
		return -1
	else:
		return 1
while t > 0:
	t -= 1
	n = int(input())
	arr = []
	arr.append((0, 0))
	while n > 0:
		n -= 1
		e = tuple(map(int, input().split()))
		arr.append(e)
	list.sort(arr, key=functools.cmp_to_key(comp))
	ans = ''
	posi = True
	for pos in range(len(arr) - 1):
		xr = arr[pos + 1][0] - arr[pos][0]
		xu = arr[pos + 1][1] - arr[pos][1]
		if xr < 0 or xu < 0:
			print('NO')
			posi = False
			break
		else:
			while xr > 0:
				ans += 'R'
				xr -= 1
			while xu > 0:
				ans += 'U'
				xu -= 1
	if posi:
		print('YES')
		print('{}'.format(ans))


t = int(input())
for i in range(t):
	r = int(input())
	lis = []
	(q, w) = (0, 0)
	hh = 0
	dic = dict()
	for er in range(int(r)):
		(e, r) = map(int, input().split())
		ersum = e + r
		if ersum in dic:
			hh = 2
		else:
			dic[ersum] = [e, r]
	if hh == 2:
		print('NO')
		continue
	qwer = sorted(dic.keys())
	for k in qwer:
		lio = dic[k]
		e = lio[0]
		r = lio[1]
		if e < q or r < w:
			hh = 1
			break
		for j in range(e - q):
			lis.append('R')
		for l in range(r - w):
			lis.append('U')
		q = e
		w = r
	if hh == 1:
		print('NO')
		continue
	print('YES')
	print(''.join(lis))


for _ in range(int(input())):
	n = int(input())
	path = []
	for i in range(n):
		c = list(map(int, input().split()))
		path.append(c)
	path = sorted(path)
	ans = ''
	count = 0
	x = y = 0
	a = -1
	b = -1
	for i in range(n):
		while x < path[i][0]:
			x += 1
			ans += 'R'
		while y < path[i][1]:
			y += 1
			ans += 'U'
		if [x, y] in path and (x != a or y != b):
			count += 1
		a = x
		b = y
	if count == n:
		print('YES')
		print(ans)
	else:
		print('NO')


for i in range(int(input())):
	a = []
	for j in range(int(input())):
		(x, y) = map(int, input().split(' '))
		a.append((x, y))
	a = sorted(a)
	s = ''
	p = (0, 0)
	poss = True
	for j in range(len(a)):
		if a[j][0] >= p[0] and a[j][1] >= p[1]:
			for k in range(a[j][0] - p[0]):
				s += 'R'
			for k in range(a[j][1] - p[1]):
				s += 'U'
			p = a[j]
		else:
			poss = False
	if poss:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for T in range(t):
	n = int(input())
	pts = []
	flag = 0
	for i in range(n):
		pts.append([int(x) for x in input().split()])
	pts.sort()
	ans = ''
	(xval, yval) = (0, 0)
	for i in range(n):
		if xval <= pts[i][0]:
			ans += 'R' * (pts[i][0] - xval)
			xval += pts[i][0] - xval
		else:
			flag = -1
			break
		if yval <= pts[i][1]:
			ans += 'U' * (pts[i][1] - yval)
			yval += pts[i][1] - yval
		else:
			flag = -1
			break
	if flag == -1:
		print('NO')
		continue
	print('YES')
	print(ans)


from operator import itemgetter

def sort_path(path: list) -> list:
	sorted_path: list = path.copy()
	sorted_path.sort(key=itemgetter(0, 1))
	return sorted_path

def move_to(current_place: tuple, next_place: tuple) -> str:
	offset: tuple = (next_place[0] - current_place[0], next_place[1] - current_place[1])
	if offset[0] < 0 or offset[1] < 0:
		return None
	movement: str = 'R' * offset[0]
	movement += 'U' * offset[1]
	return movement

def collect_package(path: list) -> str:
	sorted_path: list = sort_path(path)
	current_place: tuple = (0, 0)
	track: str = ''
	for target_place in sorted_path:
		next_track: str = move_to(current_place, target_place)
		if next_track is None:
			return None
		else:
			track += next_track
			current_place = target_place
	return track
test_cases = int(input(''))
for i in range(test_cases):
	places = int(input(''))
	path = []
	for j in range(places):
		place = input('').split(' ')
		place_tuple = (int(place[0]), int(place[1]))
		path.append(place_tuple)
	result: str = collect_package(path)
	if result is None:
		print('NO')
	else:
		print('YES')
		print(result)


t = int(input())
for k in range(t):
	percurso = []
	q = int(input())
	for i in range(q):
		coordenadas = list(map(int, input().split(' ')))
		percurso.append(coordenadas)
	percurso.sort()
	flag = 0
	for j in range(1, q):
		if percurso[j][0] < percurso[j - 1][0] or percurso[j][1] < percurso[j - 1][1]:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		resultado = ''
		if percurso[0][0] != 0:
			resultado += 'R' * percurso[0][0]
		if percurso[0][1] != 0:
			resultado += 'U' * percurso[0][1]
		for p in range(1, q):
			if percurso[p][0] != percurso[p - 1][0]:
				resultado += 'R' * (percurso[p][0] - percurso[p - 1][0])
			if percurso[p][1] != percurso[p - 1][1]:
				resultado += 'U' * (percurso[p][1] - percurso[p - 1][1])
		print('YES')
		print(resultado)


t = int(input())
for i in range(t):
	n = int(input())
	arrx = []
	arry = []
	for i in range(n):
		(x, y) = map(int, input().split())
		arrx.append(x)
		arry.append(y)
	a = list(zip(arrx, arry))
	a.sort()
	X = []
	Y = []
	for i in range(n):
		X.append(a[i][0])
		Y.append(a[i][1])
	s = X[0] * 'R' + Y[0] * 'U'
	k = 0
	for i in range(1, n):
		c = X[i] - X[i - 1]
		d = Y[i] - Y[i - 1]
		if c >= 0 and d >= 0:
			s = s + c * 'R' + d * 'U'
		else:
			k = 1
			break
	if k == 1:
		print('NO')
	else:
		print('YES')
		print(s)


T = int(input())
for _ in range(T):
	n = int(input())
	L = [(0, 0)]
	for i in range(0, n):
		(x, y) = map(int, input().split())
		L.append((x, y))
	L.sort()
	flag = 0
	for i in range(1, len(L)):
		if L[i][0] == L[i - 1][0]:
			if L[i][1] <= L[i - 1][1]:
				flag = 1
				break
		elif L[i][0] > L[i - 1][0]:
			if L[i][1] < L[i - 1][1]:
				flag = 1
				break
	if flag != 0:
		print('NO')
	else:
		print('YES')
		st = ''
		for i in range(1, len(L)):
			if L[i][0] == L[i - 1][0]:
				for j in range(L[i][1] - L[i - 1][1]):
					st += 'U'
			elif L[i][0] > L[i - 1][0]:
				for j in range(L[i][0] - L[i - 1][0]):
					st += 'R'
				for j in range(L[i][1] - L[i - 1][1]):
					st += 'U'
		print(st)


t = int(input())
for i in range(t):
	n = int(input())
	L = []
	for j in range(n):
		(x, y) = list(map(int, input().split()))
		L.append((x, y))
	L.sort()
	(f, s) = (True, 'R' * L[0][0] + 'U' * L[0][1])
	for j in range(n - 1):
		if L[j + 1][0] >= L[j][0] and L[j + 1][1] >= L[j][1]:
			s += 'R' * (L[j + 1][0] - L[j][0]) + 'U' * (L[j + 1][1] - L[j][1])
		else:
			f = False
			break
	if f:
		print('YES')
		print(s)
	else:
		print('NO')


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, XY):
	XY.sort(key=lambda xy: [xy[1], xy[0]])
	ans = []
	currX = 0
	currY = 0
	for (x, y) in XY:
		if currY > y:
			return 'NO'
		if currX > x:
			return 'NO'
		while currX < x:
			currX += 1
			ans.append('R')
		while currY < y:
			currY += 1
			ans.append('U')
	return 'YES\n' + ''.join(ans)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N,) = [int(x) for x in input().split()]
	XY = [[int(x) for x in input().split()] for i in range(N)]
	ans = solve(N, XY)
	print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort(key=lambda x: x[0] + x[1])
	ans = ''
	f = 1
	x = 0
	y = 0
	for i in range(n):
		cx = l[i][0]
		cy = l[i][1]
		dx = cx - x
		dy = cy - y
		if dx < 0 or dy < 0:
			f = 0
			break
		ans += 'R' * dx
		ans += 'U' * dy
		x = cx
		y = cy
	if f:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	final = ''
	x = 0
	y = 0
	flag = 0
	lst = []
	for i in range(int(input())):
		temp = list(map(int, input().split()))
		lst.append(temp)
	lst = sorted(lst, key=lambda var: (var[0], var[1]))
	for i in lst:
		if y <= i[1] and x <= i[0]:
			final += 'R' * (i[0] - x)
			final += 'U' * (i[1] - y)
			x = i[0]
			y = i[1]
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(final)


for _ in range(int(input())):
	n = int(input())
	a = sorted((list(map(int, input().split()))[::-1] for _ in range(n)))
	(r, c) = (0, 0)
	s = ''
	for (x, y) in a:
		if y < c:
			print('NO')
			break
		s += 'R' * (y - c)
		s += 'U' * (x - r)
		(r, c) = (x, y)
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	l1 = [0, 0]
	l.append(l1)
	for _ in range(n):
		l1 = list(map(int, input().split()))
		l.append(l1)
	l.sort(key=lambda x: x)
	s = ''
	flag = 0
	for i in range(n):
		a = l[i]
		b = l[i + 1]
		if b[1] - a[1] < 0 or b[0] - a[0] < 0:
			flag = 1
			break
		s = s + (b[0] - a[0]) * 'R'
		s = s + (b[1] - a[1]) * 'U'
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(t):
	p = []
	n = int(input())
	for i in range(n):
		(x, y) = [int(j) for j in input().split()]
		p.append((x, y))
	p.sort(key=lambda tup: tup[0] ** 2 + tup[1] ** 2)
	a = b = 0
	r = ''
	for i in p:
		(x, y) = i
		if a > x or b > y:
			print('NO')
			break
		else:
			r += (x - a) * 'R' + (y - b) * 'U'
			a = x
			b = y
	else:
		print('YES')
		print(r)


t = int(input())
for i in range(t):
	n = int(input())
	points = []
	for j in range(n):
		xy = input().split()
		points.append((int(xy[0]), int(xy[1])))
	points.sort()
	prevx = points[0][0]
	prevy = points[0][1]
	s = 'R' * prevx
	s += 'U' * prevy
	for (x, y) in points[1:]:
		if prevy > y:
			print('NO')
			break
		s += 'R' * (x - prevx) + 'U' * (y - prevy)
		prevx = x
		prevy = y
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	l = []
	for _ in range(n):
		t = tuple(map(int, input().split()))
		l.append(t)
	l.sort()
	(x, y) = (0, 0)
	s = ''
	f = 0
	for i in l:
		if i[0] - x < 0 or i[1] - y < 0:
			f = 1
			break
		s += 'R' * (i[0] - x) + 'U' * (i[1] - y)
		(x, y) = (i[0], i[1])
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(s)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		s = ''
		a = []
		for i in range(n):
			(j, k) = map(int, input().split())
			a.append([j, k])
		a.sort()
		x = 0
		y = 0
		for i in a:
			if i[0] >= x and i[1] >= y:
				s += 'R' * (i[0] - x) + 'U' * (i[1] - y)
				(x, y) = i
			else:
				print('NO')
				y = -99
				break
		if y >= 0:
			print('YES')
			print(s)
	return
main()


for _ in range(int(input())):
	n = int(input())
	data = []
	for i in range(n):
		data.append(list(map(int, input().split())))
	data.sort()
	nach = 0
	ans = []
	up = 0
	for i in range(n):
		if up <= data[i][1]:
			ans.extend(['R'] * (data[i][0] - nach))
			ans.extend(['U'] * (data[i][1] - up))
			up = data[i][1]
			nach = data[i][0]
		else:
			print('NO')
			break
	else:
		print('YES')
		print(''.join(ans))


t = int(input())
for i in range(t):
	n = int(input())
	inputs = [list(map(int, input().split(' '))) for i in range(n)]
	coords = [0, 0]
	res = ''
	flag = True
	inputs = sorted(inputs)
	for j in range(len(inputs)):
		if coords[0] <= inputs[j][0] and coords[1] <= inputs[j][1]:
			res += (inputs[j][0] - coords[0]) * 'R'
			res += (inputs[j][1] - coords[1]) * 'U'
			coords = inputs[j].copy()
		else:
			print('NO')
			flag = False
			break
	if flag == True:
		print('YES')
		print(res)


for _ in range(int(input())):
	n = int(input())
	Points = []
	for _i in range(n):
		Points.append([int(x) for x in input().strip().split(' ')])
	Points.sort()
	(ix, iy) = (0, 0)
	path = ''
	flag = True
	for (x, y) in Points:
		if x < ix or y < iy:
			flag = False
			break
		path += 'R' * (x - ix)
		path += 'U' * (y - iy)
		ix = x
		iy = y
	if flag:
		print('YES')
		print(path)
	else:
		print('NO')


import bisect
t = int(input())
for i in range(t):
	n = int(input())
	points = []
	max_y = 0
	for j in range(n):
		p = list(map(int, input().split()))
		points.append(p)
		if p[1] > max_y:
			max_y = p[1]
	mins = [-1] * (max_y + 1)
	maxs = [-1] * (max_y + 1)
	for j in range(n):
		if mins[points[j][1]] == -1:
			mins[points[j][1]] = points[j][0]
			maxs[points[j][1]] = points[j][0]
		else:
			if points[j][0] < mins[points[j][1]]:
				mins[points[j][1]] = points[j][0]
			if points[j][0] > maxs[points[j][1]]:
				maxs[points[j][1]] = points[j][0]
	cur_x = 0
	ans = ''
	failed = False
	old_j = 0
	for j in range(max_y + 1):
		if mins[j] == -1:
			continue
		if cur_x > mins[j]:
			failed = True
			break
		ans += 'R' * (mins[j] - cur_x)
		cur_x = mins[j]
		ans += 'U' * (j - old_j)
		old_j = j
		if maxs[j] - cur_x > 0:
			ans += 'R' * (maxs[j] - cur_x)
			cur_x = maxs[j]
	if failed:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	path = []
	for j in range(n):
		(a, b) = map(int, input().split())
		path.append([a, b])
	path.sort()
	coor = [0, 0]
	flag = 0
	p = ''
	for j in range(0, n):
		if coor[0] > path[j][0] or coor[1] > path[j][1]:
			flag = 1
			break
		p += 'R' * (path[j][0] - coor[0])
		p += 'U' * (path[j][1] - coor[1])
		(coor[0], coor[1]) = (path[j][0], path[j][1])
	if flag:
		print('NO')
	else:
		print('YES')
		print(p)


t = int(input())
for i in range(t):
	n = int(input())
	dic = []
	for k in range(n):
		(a, b) = map(int, input().split(' '))
		dic.append([a, b])
	dic.sort()
	stri = ''
	(xaxis, yaxis) = (0, 0)
	ct = 0
	for j in range(n):
		if dic[j][0] - xaxis < 0 or dic[j][1] - yaxis < 0:
			ct += 1
			print('NO')
			break
		else:
			stri += 'R' * (dic[j][0] - xaxis) + 'U' * (dic[j][1] - yaxis)
			xaxis = dic[j][0]
			yaxis = dic[j][1]
	if ct == 0:
		print('YES')
		print(stri)


t = int(input())
from collections import deque
for _ in range(t):
	n = int(input())
	q = []
	for _ in range(n):
		(x, y) = [int(e) for e in input().split()]
		q.append((x, y))
	q.sort()
	q = deque(q)
	(x, y) = (0, 0)
	res = []
	bad = False
	while q:
		(gx, gy) = q.popleft()
		if x > gx or y > gy:
			bad = True
			break
		while x != gx:
			x += 1
			res.append('R')
		while y != gy:
			y += 1
			res.append('U')
	if bad:
		print('NO')
	else:
		print('YES')
		print(''.join(res))


for _ in range(int(input())):
	n = int(input())
	lis = []
	for i in range(n):
		(a, b) = map(int, input().split())
		lis.append((a, b))
	lis.sort()
	printx = []
	k = 0
	printx.append(lis[0][0] * 'R' + lis[0][1] * 'U')
	for i in range(1, len(lis)):
		if lis[i][0] >= lis[i - 1][0] and lis[i][1] >= lis[i - 1][1]:
			printx.append((lis[i][0] - lis[i - 1][0]) * 'R' + (lis[i][1] - lis[i - 1][1]) * 'U')
		else:
			print('NO')
			k = 1
			break
	if k == 1:
		continue
	print('YES')
	for i in printx:
		print(i, end='')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	points = []
	for i in range(n):
		l = list(map(int, input().split()))
		points.append(l)
	points.sort(key=lambda x: x[1])
	points.sort(key=lambda x: x[0])
	points.insert(0, [0, 0])
	ans = ''
	for i in range(n):
		j = i + 1
		secy = points[j][1]
		secx = points[j][0]
		firy = points[i][1]
		firx = points[i][0]
		diffy = secy - firy
		diffx = secx - firx
		if diffy < 0:
			ans = ''
			print('NO')
			break
		else:
			for i in range(diffx):
				ans += 'R'
			for j in range(diffy):
				ans += 'U'
	if ans != '':
		print('YES')
		print(ans)


import os
import sys
from io import BytesIO, IOBase
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')
testcases = int(input())
for j in range(testcases):
	n = int(input())
	coords = []
	for s in range(n):
		(x, y) = map(int, input().split())
		coords.append((x, y))
	coords.sort(key=lambda x: x[0] ** 2 + x[1] ** 2)
	broke = False
	movements = ''
	r = 'R' * coords[0][0]
	u = 'U' * coords[0][1]
	movements += r
	movements += u
	if n >= 2:
		for s in range(1, n):
			if coords[s][0] >= coords[s - 1][0] and coords[s][1] >= coords[s - 1][1]:
				xval = coords[s][0] - coords[s - 1][0]
				yval = coords[s][1] - coords[s - 1][1]
				r = 'R' * xval
				u = 'U' * yval
				movements += r
				movements += u
			else:
				broke = True
				break
	if broke == False:
		print('YES')
		print(movements)
	else:
		print('NO')


INF = 10 ** 10

def main():
	n = get_int()
	packets = [get_list() for _ in range(n)]
	packets.sort()
	(x, y) = (0, 0)
	res = []
	for (xd, yd) in packets:
		if xd < x or yd < y:
			print('NO')
			return
		for _ in range(xd - x):
			res.append('R')
			x = xd
		for _ in range(yd - y):
			res.append('U')
			y = yd
	print('YES')
	print(''.join(res))
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right
import math
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda : int(input())
get_list = lambda : list(map(int, input().split()))
[main() for _ in range(int(input()))]
print(*out, sep='\n')


t = int(input())
for i in range(t):
	n = int(input())
	parcels = []
	for i in range(n):
		(a, b) = map(int, input().split())
		parcels.append((a, b))
	parcels.sort(key=lambda x: (x[0], x[1]))
	path = ''
	s1 = s2 = 0
	ok = True
	for i in range(n):
		r = parcels[i][0] - s1
		u = parcels[i][1] - s2
		if r < 0 or u < 0:
			print('NO')
			ok = False
			break
		path += 'R' * r
		path += 'U' * u
		(s1, s2) = parcels[i]
	if ok:
		print('YES')
		print(path)


for _ in range(int(input())):
	n = int(input())
	sp = []
	ans = ''
	for i in range(n):
		sp.append(list(map(int, input().split())))
	sp = sorted(sorted(sp, key=lambda item: item[0]), key=lambda item: item[1])
	(x, y) = (0, 0)
	for g in range(n):
		if sp[g - 1][0] > sp[g][0] and g != 0:
			ans = 0
			break
		else:
			ans = ans + 'R' * (sp[g][0] - x) + 'U' * (sp[g][1] - y)
			x = sp[g][0]
			y = sp[g][1]
	if not ans:
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	lst = [list(map(int, input().split())) for _ in range(n)]
	lst.sort()
	b = [i[1] for i in lst]
	if b != sorted(b):
		print('NO')
		continue
	(lst, res) = ([[0, 0]] + lst, '')
	for i in range(1, n + 1):
		res += 'R' * (lst[i][0] - lst[i - 1][0])
		res += 'U' * (lst[i][1] - lst[i - 1][1])
	print('YES')
	print(res)


test = int(input())
for t in range(test):
	n = int(input())
	packets = []
	for i in range(n):
		packets.append(tuple([int(x) for x in input().split(' ')]))
	packets.sort()
	flag = True
	x = y = 0
	answer = []
	for (i, j) in packets:
		if x > i or y > j:
			flag = False
			break
		else:
			answer += ['R' for a in range(i - x)]
			answer += ['U' for a in range(j - y)]
			x = i
			y = j
	if flag:
		print('YES')
		print(''.join(answer))
	else:
		print('NO')


def main():
	n = int(input())
	p = []
	for i in range(n):
		(x, y) = map(int, input().split())
		p.append([x, y])
	p.sort()
	max_y = p[0][1]
	for i in range(n):
		if p[i][1] < max_y:
			print('NO')
			return
		else:
			max_y = p[i][1]
	print('YES')
	res = ''
	prev_x = 0
	prev_y = 0
	for i in range(n):
		res += 'R' * (p[i][0] - prev_x)
		res += 'U' * (p[i][1] - prev_y)
		prev_x = p[i][0]
		prev_y = p[i][1]
	print(res)
t = int(input())
for _ in range(t):
	main()


import os
import sys
from io import BytesIO, IOBase
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())

def main():
	try:
		for _ in range(inp()):
			n = inp()
			a = [(0, 0)]
			for __ in range(n):
				a.append(tuple(invr()))
			a.sort(key=lambda x: (x[0], x[1]))
			if a != sorted(a, key=lambda x: (x[1], x[0])):
				print('NO')
			else:
				print('YES')
				s = []
				for i in range(1, n + 1):
					s.append('R' * (a[i][0] - a[i - 1][0]))
					s.append('U' * (a[i][1] - a[i - 1][1]))
				print(''.join(s))
	except Exception as e:
		print(e)
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')
main()


q = int(input())
for i in range(q):
	n = int(input())
	cordins = []
	for j in range(n):
		cordins.append(tuple(map(int, input().split())))
	sortedcords = sorted(cordins, key=lambda x: (x[0], x[1]))
	go = True
	for i in range(len(cordins) - 1):
		if sortedcords[i][1] > sortedcords[i + 1][1]:
			print('NO')
			go = False
			break
	if not go:
		continue
	print('YES')
	ans = ''
	orgi = (0, 0)
	for cor in sortedcords:
		ans += 'R' * (cor[0] - orgi[0])
		ans += 'U' * (cor[1] - orgi[1])
		orgi = cor
	print(ans)


for tc in range(int(input().strip())):
	n = int(input().strip())
	l = []
	for _ in range(n):
		(a, b) = [int(__) for __ in input().strip().split()]
		l.append((a, b))
	l.sort(key=lambda x: (x[0], x[1]))
	ans = ''
	ma = 0
	xa = 0
	pos = True
	cur = (0, 0)
	for i in range(len(l)):
		if l[i][1] < ma or l[i][0] < xa:
			pos = False
			break
		elif l[i][0] == cur[0]:
			ans += 'U' * abs(l[i][1] - cur[1])
			cur = l[i]
		elif l[i][1] == cur[1]:
			ans += 'R' * abs(l[i][0] - cur[0])
			cur = l[i]
		else:
			ans += 'R' * abs(l[i][0] - cur[0])
			ans += 'U' * abs(l[i][1] - cur[1])
			cur = l[i]
		(xa, ma) = cur
	if pos:
		print('YES')
		print(ans)
	else:
		print('NO')


for i in range(int(input())):
	li = [[0, 0]]
	s = ''
	for j in range(int(input())):
		li.append(list(map(int, input().split())))
	li = sorted(li, key=lambda sl: (sl[0], sl[1]))
	f = 0
	for k in range(1, len(li)):
		if li[k - 1][1] <= li[k][1]:
			s = s + (li[k][0] - li[k - 1][0]) * 'R'
			s = s + (li[k][1] - li[k - 1][1]) * 'U'
		else:
			f = 1
	if f:
		print('NO')
	else:
		print('YES')
		print(s)


def main():
	from operator import itemgetter
	t = int(input())
	for i in range(t):
		flag = False
		n = int(input())
		xy = [list(map(int, input().split())) for _ in range(n)]
		xy = sorted(xy, key=itemgetter(0))
		xy = sorted(xy, key=itemgetter(1))
		(x, y) = (0, 0)
		ans = ''
		for j in xy:
			if j[0] - x < 0 or j[1] - y < 0:
				x = j[0]
				y = j[1]
				flag = True
			else:
				ans += 'R' * (j[0] - x) + 'U' * (j[1] - y)
				x = j[0]
				y = j[1]
		if flag:
			print('NO')
		else:
			print('YES')
			print(ans)
main()


from sys import stdin, stdout
t = 1
t = int(input())
for i in range(t):
	n = int(input())
	l = []
	x = 0
	y = 0
	ans = ''
	for i in range(n):
		l.append(list(map(int, input().split())))
	l.sort()
	for i in l:
		while x < i[0]:
			ans += 'R'
			x += 1
		while y < i[1]:
			ans += 'U'
			y += 1
		if y > i[1]:
			print('NO')
			break
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [[int(i) for i in input().split()] for j in range(n)]
	a.sort()
	(x, y) = (0, 0)
	ans = ''
	flag = True
	for (xp, yp) in a:
		if x > xp or y > yp:
			print('NO')
			flag = False
			break
		ans += 'R' * (xp - x)
		ans += 'U' * (yp - y)
		x = xp
		y = yp
	if flag:
		print('YES')
		print(ans)


def loadup(packages):
	points = []
	for k in range(packages):
		xy = input().split(' ')
		xy = [int(j) for j in xy]
		points.append(xy)
	return points

def road(points):
	word = ''
	position = [0, 0]
	for v in range(len(points)):
		while position != points[v]:
			if position[0] < points[v][0]:
				position[0] += 1
				word = word + 'R'
			else:
				position[1] += 1
				word = word + 'U'
	print(word)
loops = int(input())
for i in range(loops):
	packages = int(input())
	points = loadup(packages)
	points.sort()
	possible = 'YES'
	for v in range(len(points) - 1):
		if points[v][1] > points[v + 1][1]:
			possible = 'NO'
			break
	print(possible)
	if possible == 'YES':
		road(points)


def shortestPath(xy):
	xy = sorted(xy, key=lambda x: x[1])
	xy0 = sorted(xy, key=lambda x: x[0])
	xy = sorted(xy, key=lambda x: x[0])
	xy1 = sorted(xy, key=lambda x: x[1])
	if xy0 != xy1:
		return 'NO'
	else:
		st = ''
		for i in range(1, len(xy)):
			st += 'R' * (xy[i][0] - xy[i - 1][0])
			st += 'U' * (xy[i][1] - xy[i - 1][1])
		print('YES')
		return st
testCases = int(input())
for i in range(testCases):
	num = int(input())
	xy = [[0, 0]]
	for j in range(num):
		coor = list(map(int, input().split()))
		xy.append(coor)
	print(shortestPath(xy))


t = int(input())
for i in range(t):
	n = int(input())
	ls = []
	for ii in range(n):
		lss = list(map(int, input().split()))
		ls.append(lss)
	s = ''
	x = y = 0
	ls.sort()
	flag = 1
	for j in ls:
		if j[0] < x or j[1] < y:
			flag = 0
			break
		while 1:
			if j[0] > x:
				s = s + 'R'
				x = x + 1
			elif j[1] > y:
				s = s + 'U'
				y = y + 1
			else:
				break
	if flag == 0:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append((x, y))
	d = sorted(l)
	x = 0
	y = 0
	s = ''
	c = 0
	for (i, j) in d:
		if i < x or j < y:
			c = 1
			print('NO')
			break
		v = 'R' * (i - x)
		v1 = 'U' * (j - y)
		x = i
		y = j
		s = s + v + v1
	if c == 0:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for _ in range(n):
		p = list(map(int, input().split()))
		l.append(p)
	l.sort()
	tf = True
	x = y = 0
	s = ''
	for i in l:
		g1 = i[0] - x
		g2 = i[1] - y
		if g1 >= 0 and g2 >= 0:
			s += 'R' * g1 + 'U' * g2
			x = i[0]
			y = i[1]
		else:
			tf = False
			break
	if tf:
		print('YES')
		print(s)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = list()
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	ans = 'YES'
	out = ''
	(x, y) = (0, 0)
	for i in range(n):
		(a, b) = l[i]
		if a < x or b < y:
			ans = 'NO'
			break
		out += 'R' * (a - x) + 'U' * (b - y)
		(x, y) = (a, b)
	print(ans)
	if ans == 'YES':
		print(out)


for _ in range(int(input())):
	a = []
	b = []
	x = 0
	y = 0
	n = int(input())
	for i in range(0, n):
		a.append([*map(int, input().split())])
	a = sorted(a)
	for i in range(0, n):
		if a[i][0] >= x:
			ans = 'R' * (a[i][0] - x)
			b.append(ans)
			x = a[i][0]
			if a[i][1] >= y:
				ans = 'U' * (a[i][1] - y)
				b.append(ans)
				y = a[i][1]
			else:
				b = []
				break
		else:
			b = []
			break
	if b:
		print('YES')
		print(''.join(b))
	else:
		print('NO')


def find_path(coords):
	coords.sort(key=lambda x: (x[0], x[1]))
	prev_x = coords[0][0]
	highest_y = coords[0][1]
	path = []
	cc = (0, 0)
	for coord in coords:
		if coord[1] >= highest_y:
			prev_x = coord[0]
			highest_y = coord[1]
		elif coord[0] != prev_x:
			print('NO')
			return
		path.append('R' * abs(coord[0] - cc[0]) + 'U' * abs(coord[1] - cc[1]))
		cc = coord
	print('YES')
	print(''.join(path))
t = int(input())
for _ in range(t):
	n = int(input())
	coords = []
	for _ in range(n):
		input_string = input()
		vals = list(map(lambda x: int(x), input_string.strip().split()))
		coords.append((vals[0], vals[1]))
	find_path(coords)


import sys
input = sys.stdin.readline

def solve(n, points):
	ans = []
	(x, y) = (0, 0)
	for i in range(n):
		(xi, yi) = points[i]
		if xi < x or yi < y:
			print('NO')
			return
		ans += ['R'] * (xi - x) + ['U'] * (yi - y)
		(x, y) = (xi, yi)
	print('YES')
	print(''.join(ans))
for _ in range(int(input())):
	n = int(input())
	points = [list(map(int, input().split())) for i in range(n)]
	points.sort()
	solve(n, points)


import collections

class Solution:

	def solve(self, packages):
		packages.sort()
		currPosition = (0, 0)
		path = []
		for package in packages:
			if package[0] < currPosition[0] or package[1] < currPosition[1]:
				return (False, None)
			rPath = ['R'] * (package[0] - currPosition[0])
			uPath = ['U'] * (package[1] - currPosition[1])
			path += rPath
			path += uPath
			currPosition = package
		return (True, ''.join(path))
sol = Solution()
t = int(input().strip())
for i in range(t):
	n = int(input().strip())
	packages = []
	for _ in range(n):
		packages.append(tuple(list(map(int, input().strip().split()))))
	result = sol.solve(packages)
	if result[0]:
		print('YES')
		print(result[1])
	else:
		print('NO')


for t in range(int(input())):
	n = int(input())
	cord_list = []
	for i in range(n):
		(x, y) = map(int, input().split())
		cord_list.append((x, y))
	cord_list.sort()
	r = 0
	u = 0
	fir = 0
	sec = 0
	ans = ''
	while cord_list:
		r = abs(cord_list[0][0] - fir)
		u = abs(cord_list[0][1] - sec)
		ans += 'R' * r
		ans += 'U' * u
		if cord_list[0][0] < fir or cord_list[0][1] < sec:
			print('NO')
			break
		fir = cord_list[0][0]
		sec = cord_list[0][1]
		del cord_list[0]
	else:
		print('YES')
		print(ans)


import math
x = list(map(int, input().split()))
y = []
for i in range(0, x[0]):
	a = int(input())
	y.append([])
	for j in range(0, a):
		y[i].append(list(map(int, input().split())))
for i in range(0, x[0]):
	mx = []
	mn = []
	for j in range(0, 1001):
		mx.append(-1)
		mn.append(2000)
	for j in range(0, len(y[i])):
		if mx[y[i][j][0]] < y[i][j][1]:
			mx[y[i][j][0]] = y[i][j][1]
		if mn[y[i][j][0]] > y[i][j][1]:
			mn[y[i][j][0]] = y[i][j][1]
	mx2 = [0]
	mn2 = [0]
	R = [0]
	ch = ''
	for j in range(0, 1001):
		if mx[j] != -1:
			mx2.append(mx[j])
			mn2.append(mn[j])
			R.append(j)
	flag = 0
	for j in range(0, len(mn2) - 1):
		if mx2[j] > mn2[j + 1]:
			flag = 1
	if flag == 0:
		print('YES')
		for ii in range(0, len(R) - 1):
			for jj in range(0, R[ii + 1] - R[ii]):
				ch = ch + 'R'
			for jj in range(0, mx2[ii + 1] - mx2[ii]):
				ch = ch + 'U'
		print(ch)
	else:
		print('NO')


import sys

def solve(n, a):
	a.sort()
	ans = ''
	i = j = k = 0
	for (ti, tj) in a:
		if ti < i or tj < j:
			return ''
		ans += 'R' * (ti - i)
		ans += 'U' * (tj - j)
		(i, j) = (ti, tj)
	return ans
rl = lambda : next(sys.stdin)
t = int(rl())
for _ in range(t):
	a = []
	n = int(rl())
	for _ in range(n):
		(x, y) = map(int, rl().split())
		a.append((x, y))
	ans = solve(n, a)
	if ans:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	arr = []
	for _ in range(int(input())):
		(x, y) = map(int, input().split())
		arr.append((x, y))
	arr.sort()
	path = ''
	prev = (0, 0)
	flag = False
	for p in arr:
		if not p[1] - prev[1] >= 0:
			flag = True
			break
		path += 'R' * (p[0] - prev[0])
		path += 'U' * (p[1] - prev[1])
		prev = p
	if flag:
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
while t:
	n = int(input())
	l = []
	s = []
	flag = 0
	for i in range(n):
		l.append(list(map(int, input().split())))
	l.sort()
	for i in range(0, n - 1):
		if l[i + 1][0] - l[i][0] < 0 or l[i + 1][1] - l[i][1] < 0:
			print('NO')
			flag = 1
			break
		if flag != 1:
			s.append((l[i + 1][0] - l[i][0]) * 'R' + (l[i + 1][1] - l[i][1]) * 'U')
	if flag == 0:
		print('YES')
		print(l[0][0] * 'R', l[0][1] * 'U', sep='', end='')
		for i in s:
			print(i, end='')
		print()
	t = t - 1


num_cases = int(input())
for _ in range(num_cases):
	num_points = int(input())
	arr = []
	for i in range(num_points):
		temp_arr = [int(num) for num in input().split()]
		arr.append(temp_arr)
	arr.sort()
	arr_y = []
	for i in range(num_points):
		arr_y.append(arr[i][1])
	temp_arr = []
	for num in arr_y:
		temp_arr.append(num)
	temp_arr.sort()
	cont = True
	for i in range(num_points):
		if temp_arr[i] != arr_y[i]:
			cont = False
			break
	if not cont:
		print('NO')
	else:
		print('YES')
		point1 = [0, 0]
		counter = 0
		while counter < len(arr):
			R = arr[counter][0] - point1[0]
			U = arr[counter][1] - point1[1]
			for i in range(R):
				print('R', end='')
			for i in range(U):
				print('U', end='')
			point1 = arr[counter]
			counter = counter + 1
		print()


t = int(input())
while t != 0:
	i = int(input())
	ans = []
	for x in range(i):
		a = [*map(int, input().split())]
		ans.append(a)
	ans = sorted(ans)
	x = 0
	y = 0
	anss = ''
	can = True
	for a in ans:
		if a[0] - x < 0 or a[1] - y < 0:
			can = False
		for _ in range(a[0] - x):
			anss += 'R'
			x += 1
		for _ in range(a[1] - y):
			anss += 'U'
			y += 1
	if can:
		print('YES')
		print(anss)
	else:
		print('NO')
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	coords = []
	for __ in range(n):
		coords.append([int(x) for x in input().split()])
	ans = ''
	coords.sort(key=lambda x: (x[0], x[1]))
	maxY = 0
	prevX = 0
	for (x, y) in coords:
		if maxY > y:
			ans = ''
			break
		ans = ans + 'R' * (x - prevX)
		ans = ans + 'U' * (y - maxY)
		prevX = x
		maxY = y
	if ans == '':
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	coordinates = [list(map(int, input().split())) for i in range(n)]
	x = y = 0
	found = True
	ans = ''
	a = sorted(coordinates, key=lambda x: (x[0], x[1]))
	for coordinate in a:
		if coordinate[1] < y:
			found = False
			break
		ans += 'R' * (coordinate[0] - x)
		ans += 'U' * (coordinate[1] - y)
		x = coordinate[0]
		y = coordinate[1]
	if found:
		print('YES')
		print(ans)
	else:
		print('NO')


def move(next, position):
	st = ''
	while next[0] > position[0]:
		position[0] += 1
		st += 'R'
	while next[1] > position[1]:
		position[1] += 1
		st += 'U'
	return st
t = int(input())
for i in range(t):
	n = int(input())
	cord = []
	position = [0, 0]
	for i in range(n):
		cord.append(list(map(int, input().split())))
	cond = True
	s = ''
	while len(cord) > 0 and cond:
		dist = 200000000
		for (index, i) in enumerate(cord):
			xdist = i[0] - position[0]
			ydist = i[1] - position[1]
			if xdist < 0 or ydist < 0:
				print('NO')
				cond = False
				break
			if xdist + ydist < dist:
				next = i
				dist = xdist + ydist
				topop = index
		if not cond:
			break
		s += move(next, position)
		position = next
		cord.pop(topop)
	if cond:
		print('YES')
		print(s)


for _ in range(int(input())):
	f = []
	for i in range(int(input())):
		d = list(map(int, input().split()))
		f.append(d)
	f.sort()
	x = 0
	y = 0
	s = ''
	case = True
	for i in range(len(f)):
		stepr = f[i][0] - x
		stepu = f[i][1] - y
		x = f[i][0]
		y = f[i][1]
		if stepr < 0 or stepu < 0:
			case = False
			print('NO')
			break
		else:
			s = s + 'R' * stepr
			s = s + 'U' * stepu
	if case:
		print('YES')
		print(s)


def get_path(points):
	p = sorted(points)
	path = 'R' * p[0][0] + 'U' * p[0][1]
	for k in range(1, len(p)):
		if p[k][1] < p[k - 1][1]:
			return 'NO'
		path += 'R' * (p[k][0] - p[k - 1][0]) + 'U' * (p[k][1] - p[k - 1][1])
	print('YES')
	return path
t = int(input())
for i in range(t):
	n = int(input())
	points = []
	for j in range(n):
		points.append(tuple(map(int, input().split())))
	print(get_path(points))


import math
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	n = int(input())
	corr = []
	for i in range(n):
		(x, y) = map(int, input().split())
		corr.append([x, y])
	corr = sorted(corr)
	res = ''
	(x, y) = (0, 0)
	cnt = 0
	for i in range(n):
		while corr[i][0] > x:
			res += 'R'
			x += 1
		while corr[i][1] > y:
			res += 'U'
			y += 1
		if [x, y] == corr[i]:
			cnt += 1
	if cnt == n:
		print('YES')
		print(res)
	else:
		print('NO')
t = int(input())
for _ in range(t):
	main()


def put(mass):
	for j in range(n):
		for o in range(j + 1, n):
			if (mass[j][0] - mass[o][0]) * (mass[j][1] - mass[o][1]) < 0:
				print('NO')
				return
	print('YES')
	mass.sort()
	a = 0
	b = 0
	for i in range(n):
		print(''.join(['R'] * (mass[i][0] - b)), end='')
		b = mass[i][0]
		if mass[i][1] != a:
			print(''.join(['U'] * (mass[i][1] - a)), end='')
			a = mass[i][1]
	print()
t = int(input())
for i in range(t):
	n = int(input())
	mass = []
	for j in range(n):
		mass.append([int(x) for x in input().split()])
	put(mass)


import heapq as hq
for _ in range(int(input())):
	n = int(input())
	a = []
	hq.heapify(a)
	for i in range(n):
		(x, y) = map(int, input().split())
		hq.heappush(a, [x, y])
	s = ''
	p = 0
	q = 0
	for i in range(n):
		(x, y) = hq.heappop(a)
		u = x - p
		v = y - q
		if u < 0 or v < 0:
			print('NO')
			break
		else:
			s += 'R' * u + 'U' * v
			p = x
			q = y
	else:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	pac = [(0, 0)] + [tuple(map(int, input().split())) for i in range(n)]
	pac.sort()
	flag = True
	ans = ''
	for i in range(n):
		if pac[i][1] > pac[i + 1][1]:
			print('NO')
			flag = False
			break
		else:
			ans += 'R' * (pac[i + 1][0] - pac[i][0]) + 'U' * (pac[i + 1][1] - pac[i][1])
	if not flag:
		continue
	else:
		print('YES')
		print(ans)


case = int(input())
polje = []
xevi = []
yoni = []
visit = 0
xi = 0
yi = 0
ispis = ''
da = 0
while case:
	paketi = int(input())
	for i in range(paketi):
		(x, y) = map(int, input().split())
		xevi.append(x)
		yoni.append(y)
	usporedba = list(set(sorted(xevi)))
	for k in range(len(usporedba)):
		polje.append(list())
	for i in range(len(usporedba)):
		for j in range(len(xevi)):
			if usporedba[i] == xevi[j]:
				polje[i].append(yoni[j])
		polje[i].sort()
	for s in range(len(polje)):
		for j in range(s + 1, len(polje)):
			for k in range(len(polje[j])):
				if max(polje[s]) > polje[j][k]:
					visit = 1
					da = 1
					break
			if da:
				break
		if da:
			break
	da = 0
	if not visit:
		for f in range(len(polje)):
			if xi < usporedba[f]:
				for i in range(abs(xi - usporedba[f])):
					ispis += 'R'
				xi += abs(xi - usporedba[f])
			if yi < max(polje[f]):
				for i in range(abs(yi - max(polje[f]))):
					ispis += 'U'
				yi += abs(yi - max(polje[f]))
		print('YES')
		print(ispis)
		ispis = ''
		xi = 0
		yi = 0
		visit = 0
		polje = []
		xevi = []
		yoni = []
	else:
		print('NO')
		visit = 0
		polje = []
		xevi = []
		yoni = []
		xi = 0
		yi = 0
	case -= 1


from math import *
from collections import *
from functools import *
from bisect import *
from itertools import *
from heapq import *
from statistics import *
inf = float('inf')
ninf = -float('inf')
ip = input
alphal = 'abcdefghijklmnopqrstuvwxyz'
alphau = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def ipl():
	return list(map(int, ip().split()))

def ipn():
	return int(ip())

def ipf():
	return float(ip())

def solve():
	p = []
	for _ in range(ipn()):
		p.append(ipl())
	p.sort(key=lambda x: (x[0], x[1]))
	r = ''
	px = py = 0
	for (x, y) in p:
		if x < px or y < py:
			print('NO')
			return
		if x > px:
			r += 'R' * (x - px)
		if y > py:
			r += 'U' * (y - py)
		(px, py) = (x, y)
	print('YES')
	print(r)
t = ipn()
for _ in range(t):
	solve()


for i in range(int(input())):
	n = int(input())
	d = dict()
	mx = 0
	for j in range(n):
		(x, y) = list(map(int, input().split()))
		mx = max(mx, x)
		if x in d:
			d[x].add(y)
		else:
			d[x] = set()
			d[x].add(y)
	listok = []
	cury = 0
	k = 0
	for x in range(0, mx + 1):
		if x in d:
			y = max(d[x])
			my = min(d[x])
			if my >= cury:
				listok.append('U' * (y - cury))
				k += len(d[x])
			cury = y
		if k != n:
			listok.append('R')
	if k == n:
		print('YES')
		print(''.join(listok))
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(a, b) = map(int, input().split())
		arr.append([a, b])
	arr.sort()
	string = ''
	temp1 = 0
	temp2 = 0
	count = 0
	for i in arr:
		if i[0] >= temp1 and i[1] >= temp2:
			count += 1
			string += 'R' * (i[0] - temp1)
			string += 'U' * (i[1] - temp2)
			temp1 = i[0]
			temp2 = i[1]
	if count == n:
		print('YES')
		print(string)
	else:
		print('NO')


import sys
input = sys.stdin.buffer.readline
t = int(input())
while t:
	t -= 1
	n = int(input())
	z = []
	while n:
		n -= 1
		(x, y) = map(int, input().split())
		z.append((x, y))
	z.sort()
	s = ''
	i = 0
	k = 0
	k1 = 0
	zz = 0
	while i < len(z):
		if z[i][0] >= k:
			for j in range(k, z[i][0]):
				s += 'R'
			k = z[i][0]
			if z[i][1] >= k1:
				for j in range(k1, z[i][1]):
					s += 'U'
				k1 = z[i][1]
			else:
				zz = 1
				break
		else:
			zz = 1
			break
		i += 1
	if zz == 1:
		print('NO')
	else:
		print('YES')
		print(s)


n = int(input())
j = []
for i in range(n):
	m = int(input())
	list_point = []
	(x_start, y_start) = (0, 0)
	for i in range(m):
		a = [int(a) for a in input().split()]
		list_point.append(a)
	g = sorted(list_point)
	count = 0
	min = g[0][1]
	string = ''
	for i in range(len(g)):
		if g[i][1] >= min:
			count += 1
			min = g[i][1]
	if count == len(g):
		j.append('YES')
		for i in range(len(list_point)):
			a = g[i][0]
			b = g[i][1]
			string = string + 'R' * (a - x_start) + 'U' * (b - y_start)
			x_start = a
			y_start = b
		j.append(string)
	if count != len(g):
		j.append('NO')
for i in range(len(j)):
	print(j[i])


def main():
	for _ in range(int(input())):
		n = int(input())
		p = {}
		xx = []
		for i in range(n):
			(x, y) = map(int, input().split())
			if x in p:
				p[x].append(y)
			else:
				p[x] = [y]
			xx.append(x)
		xx = list(set(xx))
		xx = sorted(xx)
		ay = 0
		ax = 0
		ans = ''
		ok = ''
		for i in range(len(xx)):
			if min(p[xx[i]]) < ay:
				ok = 'NO'
				break
			new_ay = max(p[xx[i]])
			ans += (xx[i] - ax) * 'R'
			ax = xx[i]
			ans += (new_ay - ay) * 'U'
			ay = new_ay
		if not ok:
			print('YES')
			print(ans)
		else:
			print(ok)
main()


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

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

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	N = INT()
	XY = []
	for i in range(N):
		(x, y) = MAP()
		XY.append((x + y, x, y))
	XY.sort()
	ax = ay = 0
	ans = []
	for (d, x, y) in XY:
		bx = x - ax
		by = y - ay
		if bx < 0 or by < 0:
			NO()
			break
		ans.append('R' * bx)
		ans.append('U' * by)
		ax += bx
		ay += by
	else:
		YES()
		print(''.join(ans))


t = int(input())
while t > 0:
	n = int(input())
	map = list()
	for i in range(n):
		(x, y) = input().split()
		p = [int(x), int(y)]
		map.append(p)
	map.sort(key=lambda p: (p[0], p[1]))
	p = [0, 0]
	i = 0
	ch = ''
	ok = True
	while i < n:
		if map[i][0] > p[0]:
			for j in range(map[i][0] - p[0]):
				ch += 'R'
			p[0] = map[i][0]
		if map[i][0] == p[0] and map[i][1] > p[1]:
			for j in range(map[i][1] - p[1]):
				ch += 'U'
			p[1] = map[i][1]
		if map[i][0] == p[0] and map[i][1] == p[1]:
			i += 1
		else:
			print('NO')
			ok = False
			break
	if ok:
		print('YES')
		print(ch)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	ans = ''
	t = []
	(max_x, max_y) = (0, 0)
	for _ in range(n):
		(x, y) = map(int, input().split())
		t.append([x, y])
	cur = [0, 0]
	t.sort()
	ok = True
	for i in range(0, n):
		r = t[i][0] - cur[0]
		u = t[i][1] - cur[1]
		if r < 0 or u < 0:
			print('NO')
			ok = False
			break
		ans += 'R' * r
		ans += 'U' * u
		cur = t[i]
	if ok == True:
		print('YES\n' + ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = [[10000, -1] for i in range(1001)]
	maa = -1
	for j in range(n):
		(x, y) = map(int, input().split())
		a[x][1] = max(a[x][1], y)
		a[x][0] = min(a[x][0], y)
		maa = max(maa, x)
	x = 0
	y = 0
	f = 1
	cur = 0
	ans = ''
	f = 1
	while f and x <= maa:
		while x <= maa and a[x][1] == -1:
			x += 1
			ans += 'R'
		if x <= maa:
			if y <= a[x][0]:
				ans += 'U' * (a[x][1] - y)
				y = a[x][1]
			else:
				print('NO')
				f = 0
			x += 1
			ans += 'R'
	if f:
		print('YES')
		print(ans[:-1])


t = int(input())
for _ in range(t):
	n = int(input())
	l = [[0, 0]]
	for _ in range(n):
		l.append(list(map(int, input().split())))
	l.sort()
	k = True
	for i in l:
		if k == False:
			break
		(x, y) = i
		for j in l:
			(a, b) = j
			if a < x and b > y:
				print('NO')
				k = False
				break
	while k == True:
		print('YES')
		i = 0
		w = []
		while i < len(l) - 1:
			if l[i + 1][0] - l[i][0] > 0:
				for u in range(l[i + 1][0] - l[i][0]):
					w.append('R')
			if l[i + 1][1] - l[i][1] > 0:
				for v in range(l[i + 1][1] - l[i][1]):
					w.append('U')
			i += 1
		if i == len(l) - 1:
			print(''.join(w))
			break


t = int(input())
for _ in range(t):
	n = int(input())
	colis = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		colis.append((x + y, x, y))
	colis.sort()
	ans = ''
	point = (0, 0)
	for i in range(n):
		(_, x, y) = colis[i]
		dx = x - point[0]
		dy = y - point[1]
		if dx < 0 or dy < 0:
			print('NO')
			break
		ans += 'R' * dx + 'U' * dy
		point = (x, y)
	else:
		print('YES')
		print(ans)


t = int(input())
right = 'R'
up = 'U'
for i in range(0, t):
	n = int(input())
	b = True
	l = []
	for j in range(0, n):
		(x, y) = map(int, input().split())
		l.append([y, x])
	l.sort()
	res = ''
	pos = [0, 0]
	for e in l:
		while e[1] > pos[1]:
			res += 'R'
			pos[1] += 1
		while e[0] > pos[0]:
			res += 'U'
			pos[0] += 1
		if e[0] != pos[0] or e[1] != pos[1]:
			b = False
	if b:
		print('YES')
		print(res)
	else:
		print('NO')


t = int(input())
for i in range(t):
	(n, d, s) = (int(input()), dict(), '')
	for i in range(n):
		(a, b) = map(int, input().split())
		d[a] = d.get(a, []) + [b]
	for i in d:
		d[i] = sorted(d[i])
	(k, p, u) = (0, 0, 0)
	for i in sorted(d):
		if d[i][0] < u:
			p = 1
			break
		s = s + 'R' * (i - k) + 'U' * (d[i][-1] - u)
		(k, u) = (i, d[i][-1])
	if p == 0:
		print('YES')
		print(s)
	else:
		print('NO')


testcase = int(input())
for _ in range(testcase):
	n = int(input())
	l = []
	for j in range(n):
		(x, y) = [int(i) for i in input().split()]
		l.append([x, y])
	l.sort()
	k = True
	p = [l[0][0], l[0][1]]
	for i in l:
		if p[0] > i[0] or p[1] > i[1]:
			k = False
		else:
			p[0] = i[0]
			p[1] = i[1]
	if k:
		s = ''
		p = [0, 0]
		for i in l:
			r = 'R' * (i[0] - p[0])
			u = 'U' * (i[1] - p[1])
			p[0] = i[0]
			p[1] = i[1]
			s += r + u
		print('YES')
		print(s)
	else:
		print('NO')


import sys
r_input = sys.stdin.readline
T = int(r_input())
for _ in range(T):
	locations = {}
	N = int(r_input())
	maxi_row = 0
	maxi_col = 0
	for _ in range(N):
		(a, b) = map(int, r_input().split())
		maxi_row = max(maxi_row, a)
		maxi_col = max(maxi_col, b)
		if a not in locations:
			locations[a] = []
		locations[a].append(b)
	maxi = 0
	flag = 1
	for row in sorted(locations):
		if min(locations[row]) < maxi:
			flag = 0
			break
		else:
			maxi = max(locations[row])
	if not flag:
		print('NO')
	else:
		m_row = 0
		m_col = 0
		result = ''
		for row in sorted(locations):
			result += 'R' * (row - m_row)
			m_row = row
			col = max(locations[row])
			result += 'U' * (col - m_col)
			m_col = col
		print('YES')
		print(result)


import sys
inp = sys.stdin.readline
input = lambda : inp().strip()
flush = sys.stdout.flush

def iin():
	return int(input())

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

def main():
	t = iin()
	ans = ['YES', 'NO']
	while t:
		t -= 1
		n = iin()
		a = [lin() for i in range(n)]
		a.sort()
		y = a[0][1]
		check = 0
		for i in range(1, n):
			if a[i][1] < y:
				check = 1
				break
			y = max(a[i][1], y)
		if check:
			print(ans[1])
			continue
		sol = []
		(x, y) = (0, 0)
		for (i, j) in a:
			sol.append('R' * (i - x))
			sol.append('U' * (j - y))
			(x, y) = (i, j)
		print(ans[0])
		print(''.join(sol))
main()


t = int(input())
for i in range(t):
	a = int(input())
	(x, y) = (0, 0)
	l = []
	for i in range(a):
		(x1, y1) = map(int, input().split())
		l.append([x1, y1])
	l.sort()
	ll = 0
	ch = 1
	for i in range(1, a):
		if l[i][1] < l[i - 1][1]:
			ch = 0
			break
	if ch == 0:
		print('NO')
	else:
		print('YES')
		st = ''
		for i in l:
			st += 'R' * (i[0] - x)
			x = i[0]
			st += 'U' * (i[1] - y)
			y = i[1]
		print(st)


for _ in range(int(input())):
	n = int(input())
	packs = [0] * n
	for i in range(n):
		packs[i] = [*map(int, input().split())]
	packs.sort()
	(x, y) = (0, 0)
	(f, ans) = (True, '')
	for k in packs:
		if x > k[0] or y > k[1]:
			f = False
			break
		ans += (k[0] - x) * 'R' + (k[1] - y) * 'U'
		x = k[0]
		y = k[1]
	if not f:
		print('NO')
	else:
		print('YES')
		print(ans)


import sys
input = sys.stdin.readline
t = int(input())
for test in range(t):
	n = int(input())
	P = [tuple(map(int, input().split())) for i in range(n)]
	P.sort()
	ANS = []
	NOWX = 0
	NOWY = 0
	for (x, y) in P:
		if x < NOWX or y < NOWY:
			print('NO')
			break
		ANS.extend(['R'] * (x - NOWX) + ['U'] * (y - NOWY))
		NOWX = x
		NOWY = y
	else:
		print('YES')
		print(''.join(ANS))


t = int(input())
for _ in range(t):
	A = []
	n = int(input())
	for _ in range(n):
		(x, y) = map(int, input().split())
		A.append((x + y, x, y))
	A.sort()
	olda = (0, 0, 0)
	ans = ''
	for a in A:
		if olda[1] > a[1] or olda[2] > a[2]:
			ans = ''
			break
		else:
			ans += 'R' * (a[1] - olda[1])
			ans += 'U' * (a[2] - olda[2])
		olda = a
	if len(ans) > 0:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	arr = [[0, 0]]
	for __ in range(int(input())):
		arr.append([int(x) for x in input().split()])
	arr.sort()
	flag = False
	for i in range(__ + 1):
		if arr[i][1] > arr[i + 1][1]:
			flag = True
			break
	if flag:
		print('NO')
		continue
	print('YES')
	for i in range(__ + 1):
		(a, b) = (arr[i + 1][0] - arr[i][0], arr[i + 1][1] - arr[i][1])
		print(a * 'R' + b * 'U', end='')
	print()


c = int(input())

def handleCase(boxes):
	boxes = sorted(boxes)
	answer = ''
	curr = (0, 0)
	for (x, y) in boxes:
		(cx, cy) = curr
		if not (x >= cx and y >= cy):
			return False
		answer += 'R' * (x - cx) + 'U' * (y - cy)
		curr = (x, y)
	return answer
for _ in range(c):
	n = int(input())
	boxes = []
	for __ in range(n):
		s = input()
		(x, y) = s.split(' ')
		boxes.append((int(x), int(y)))
	ans = handleCase(boxes)
	if ans:
		print('YES')
		print(ans)
	else:
		print('NO')


import operator
import math
t = int(input())
for i in range(t):
	n = int(input())
	pos = []
	for i in range(n):
		(a, b) = map(int, input().split(' '))
		pos.append((a, b, math.sqrt(a * a + b * b)))
	pos = sorted(pos, key=operator.itemgetter(2))
	path = pos[0][0] * 'R' + pos[0][1] * 'U'
	isinc = True
	for i in range(1, n):
		if pos[i][0] >= pos[i - 1][0] and pos[i][1] >= pos[i - 1][1]:
			xinc = pos[i][0] - pos[i - 1][0]
			yinc = pos[i][1] - pos[i - 1][1]
			path += xinc * 'R' + yinc * 'U'
		else:
			isinc = False
	if isinc == True:
		print('YES')
		print(path)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = [list(map(int, input().split())) for i in range(n)]
	a.sort()
	(cx, cy, nx, ny) = (0, 0, 0, 0)
	ans = ''
	for i in a:
		(cx, cy, nx, ny) = (nx, ny, i[0], i[1])
		if ny < cy:
			print('NO')
			break
		else:
			ans += 'R' * (nx - cx) + 'U' * (ny - cy)
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(list(map(int, input().split())))
	l.sort()
	s = ''
	k = [0, 0]
	f = 0
	for i in l:
		if i[0] - k[0] < 0 or i[1] - k[1] < 0:
			f = 1
			break
		s += 'R' * (i[0] - k[0]) + 'U' * (i[1] - k[1])
		k = i
	if f:
		print('NO')
	else:
		print('YES' + '\n' + s)


def mi():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	c = [0] * n
	for i in range(n):
		c[i] = list(mi())
	c.sort()
	ans = ''
	(cx, cy) = (0, 0)
	flag = 0
	for i in range(n):
		if c[i][0] < cx or c[i][1] < cy:
			flag = 1
			print('NO')
			break
		ans += 'R' * (c[i][0] - cx) + 'U' * (c[i][1] - cy)
		(cx, cy) = (c[i][0], c[i][1])
	if not flag:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	arr = [(0, 0)]
	for i in range(n):
		(a, b) = map(int, input().split())
		arr.append((a, b))
	arr.sort()
	s = ''
	f = True
	for i in range(1, n + 1):
		curr = arr[i - 1]
		togo = arr[i]
		if togo[0] - curr[0] < 0 or togo[1] - curr[1] < 0:
			f = False
			break
		s += abs(togo[0] - curr[0]) * 'R' + abs(togo[1] - curr[1]) * 'U'
	if f:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for test in range(t):
	points = []
	n = int(input())
	flag = 1
	for i in range(n):
		points.append(list(map(int, input().split())))
	points.sort()
	path = 'R' * points[0][0] + 'U' * points[0][1]
	for i in range(len(points) - 1):
		if points[i + 1][1] >= points[i][1]:
			path += 'R' * (points[i + 1][0] - points[i][0]) + 'U' * (points[i + 1][1] - points[i][1])
		else:
			flag = -1
			break
	if flag == -1:
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
for i in range(t):
	s = ''
	n = int(input())
	a = [[int(j) for j in input().split()] for i in range(n)]
	a.sort()
	k = 0
	m = 0
	c = 0
	for i in range(n):
		if a[i][0] >= k and a[i][1] >= m:
			s = s + 'R' * (a[i][0] - k)
			s = s + 'U' * (a[i][1] - m)
		else:
			c += 1
		k = a[i][0]
		m = a[i][1]
	if c == 0:
		print('YES')
		print(s)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	p = [] * n
	for _ in range(n):
		(a, b) = map(int, input().split())
		p.append((a, b))
	p.sort()
	ans = []
	f = 0
	ans.extend('R' * p[0][0])
	ans.extend('U' * p[0][1])
	for i in range(1, n):
		x = p[i][0] - p[i - 1][0]
		y = p[i][1] - p[i - 1][1]
		if x >= 0 and y >= 0:
			ans.extend('R' * x)
			ans.extend('U' * y)
		else:
			f = 1
			break
	if f == 0:
		print('YES')
		ans1 = ''.join(map(str, ans))
		print(ans1)
	else:
		print('NO')


outputs = []
for __ in range(int(input())):
	N = int(input())
	A = []
	for __ in range(N):
		A.append(tuple([int(num) for num in input().split()]))
	A[:] = sorted(A, key=lambda t: (t[0], t[1]), reverse=False)
	out = ''
	pos = (0, 0)
	flag = True
	for i in A:
		if i[0] - pos[0] < 0 or i[1] - pos[1] < 0:
			flag = False
			break
		else:
			out += 'R' * (i[0] - pos[0])
			out += 'U' * (i[1] - pos[1])
			pos = i
	if flag:
		outputs.append('YES\n' + out)
	else:
		outputs.append('NO')
for output in outputs:
	print(output)


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	for j in range(n):
		a.append(list(map(int, input().split())))
	a.sort()
	ans = ''
	now = [0, 0]
	flag = True
	for j in range(n):
		if a[j][0] >= now[0] and a[j][1] >= now[1]:
			for elem in range(a[j][0] - now[0]):
				ans += 'R'
			now[0] = a[j][0]
			for elem in range(a[j][1] - now[1]):
				ans += 'U'
			now[1] = a[j][1]
		else:
			print('NO')
			flag = False
			break
	if flag:
		print('YES')
		print(ans)


t = int(input())
m = {'U': (0, 1), 'R': (1, 0)}
for _ in range(t):
	n = int(input())
	p = []
	for i in range(n):
		p.append(tuple(map(int, input().split())))
	p.sort()
	res = []
	lp = (0, 0)
	while len(p):
		np = p.pop(0)
		if np[1] < lp[1]:
			print('NO')
			res = []
			break
		res.append('R' * (np[0] - lp[0]) + 'U' * (np[1] - lp[1]))
		lp = np
	if len(res):
		print('YES')
		print(''.join(res))


import sys
queries = int(sys.stdin.readline())
for query in range(queries):
	robot_coordinates = [0, 0]
	coordinates_count = int(sys.stdin.readline())
	coordinates = {}
	for inp_pos in range(coordinates_count):
		(x, y) = map(int, sys.stdin.readline().strip().split())
		try:
			coordinates[x].append(y)
		except:
			coordinates[x] = [y]
	coordinates_x = [x for x in coordinates]
	coordinates_x.sort()
	for x in coordinates_x:
		coordinates[x].sort()
	last_y = 0
	last_x = 0
	steps = ''
	canCollectAll = True
	for x in coordinates_x:
		steps = steps + 'R' * (x - last_x)
		last_x = x
		for y in coordinates[x]:
			if y < last_y:
				canCollectAll = False
				break
			else:
				steps = steps + 'U' * (y - last_y)
				last_y = y
	if canCollectAll:
		print('YES')
		print(steps)
	else:
		print('NO')


import sys

def getN():
	return int(input())

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

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

def getArray(intn):
	return [int(input()) for i in range(intn)]

def input():
	return sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = getN()
	coors = []
	for _ in range(n):
		(x, y) = getNM()
		coors.append((x, y))
	coors.sort()
	coors.insert(0, (0, 0))
	check = False
	path = ''
	for i in range(1, n + 1):
		if coors[i - 1][1] > coors[i][1]:
			check = True
			break
		path += 'R' * (coors[i][0] - coors[i - 1][0]) + 'U' * (coors[i][1] - coors[i - 1][1])
	if check:
		print('NO')
		continue
	print('YES')
	print(path)


from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())
mod = int(1000000000.0) + 7

def solve(adj, colors, n):
	pass

def root(parent, a):
	while parent[a] != a:
		parent[a] = parent[parent[a]]
		a = parent[a]
	return a

def union(parent, size, a, b):
	(roota, rootb) = (root(parent, a), root(parent, b))
	if roota == rootb:
		return
	parent[rootb] = roota
	size[roota] += size[rootb]
	size[rootb] = 0

def prime_factors(n):
	num = n
	count = 0
	index = 0
	t = [2, 3, 5, 7]
	f = []
	while t[index] ** 2 <= n:
		count += 1
		if len(t) == index + 1:
			t.append(t[-2] + 6)
		if n % t[index]:
			index += 1
		else:
			n = n // t[index]
			f.append(t[index])
	if n > 1:
		f.append(n)
	return f
for _ in range(iinput()):
	n = iinput()
	s = []
	for i in range(n):
		(a, b) = rinput()
		s.append((a, b))
	s.sort()
	ans = ''
	curr = [0, 0]
	flag = True
	for i in range(n):
		x = s[i][0] - curr[0]
		y = s[i][1] - curr[1]
		if x < 0 or y < 0:
			flag = False
			break
		ans += 'R' * x + 'U' * y
		curr = [s[i][0], s[i][1]]
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


def sortt(x):
	return (x[1], x[0])
for i in range(int(input())):
	n = int(input())
	s = []
	check = 0
	for i in range(n):
		(x, y) = map(int, input().split())
		s.append([x, y])
	s.sort(key=sortt)
	for i in range(1, n):
		if s[i - 1][0] > s[i][0]:
			check = 1
			break
	if check == 1:
		print('NO')
	else:
		lx = 0
		ly = 0
		ans = ''
		for o in s:
			x = o[0]
			y = o[1]
			ans += 'R' * (x - lx)
			ans += 'U' * (y - ly)
			ly = y
			lx = x
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	A = []
	for z in range(n):
		l = []
		l = list(map(int, input().split()))
		A.append(l)
	A.sort()
	x = 0
	y = 0
	c = 0
	s = ''
	for i in range(n):
		tempx = A[i][0]
		tempy = A[i][1]
		if tempx - x >= 0:
			for j in range(tempx - x):
				s += 'R'
			x = tempx
			if tempy - y >= 0:
				for k in range(tempy - y):
					s += 'U'
				y = tempy
				c = c + 1
			else:
				break
		else:
			break
	if c == n:
		print('YES')
		print(s)
	else:
		print('NO')


import sys
sys.setrecursionlimit(10 ** 9)
IA = lambda : map(int, input().split())
T = int(input())
for t in range(0, T):
	n = int(input())
	a = []
	for i in range(0, n):
		(x, y) = IA()
		a.append([x, y])
	a.sort()
	sx = 0
	sy = 0
	ans = ''
	flag = 1
	for item in a:
		if item[0] >= sx and item[1] >= sy:
			ans = ans + (item[0] - sx) * 'R' + (item[1] - sy) * 'U'
			sx = item[0]
			sy = item[1]
		else:
			print('NO')
			flag = -1
			break
	if flag == 1:
		print('YES')
		print(ans)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	pack = []
	for i in range(n):
		pack.append(iia())
	pack.sort()
	res = ''
	cur = [0, 0]
	for i in pack:
		if i[0] < cur[0] or i[1] < cur[1]:
			print('NO')
			break
		else:
			res += 'R' * (i[0] - cur[0])
			res += 'U' * (i[1] - cur[1])
			cur = i
	else:
		print('YES')
		print(res)


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	p = list(sorted([list(map(int, input().split())) for _ in range(n)]))
	(xmax, ind) = ([[0, 0]], 0)
	xmin = [[0, 0]]
	while ind < n:
		(cur1, cur2) = ([p[ind][0], p[ind][1]], [p[ind][0], p[ind][1]])
		ind += 1
		while ind < n and p[ind][0] == cur1[0]:
			cur1[1] = max(cur1[1], p[ind][1])
			cur2[1] = min(cur2[1], p[ind][1])
			ind += 1
		xmax.append([cur1[0], cur1[1]])
		xmin.append([cur2[0], cur2[1]])
	top = ''
	xmax.sort()
	xmin.sort()
	for i in range(1, len(xmax)):
		cur = [xmax[i][0] - xmax[i - 1][0], xmax[i][1] - xmax[i - 1][1]]
		if xmin[i][1] < xmax[i - 1][1]:
			return 'NO'
		top += 'R' * cur[0] + 'U' * cur[1]
	return 'YES\n' + top
for _ in range(int(input())):
	print(solve())


def robot():
	nbrOPacks = int(input())
	packs = []
	for i in range(0, nbrOPacks):
		unprocessed = input()
		splitted = unprocessed.split()
		packs.append([int(splitted[0]), int(splitted[1])])
	packs.sort(key=lambda x: x[0])
	position = [0, 0]
	string = ''
	while len(packs) != 0:
		currentPack = packs[0]
		if currentPack == position:
			packs = packs[1:]
		elif position[0] == currentPack[0] and position[1] <= currentPack[1]:
			low = position[1]
			high = currentPack[1]
			packs = packs[1:]
			while len(packs) != 0 and packs[0][0] == position[0]:
				if packs[0][1] < low:
					return False
				elif packs[0][1] > high:
					high = packs[0][1]
					packs = packs[1:]
				else:
					packs = packs[1:]
			string += 'U' * (high - low)
			position[1] += high - low
		elif position[0] == currentPack[0]:
			return False
		else:
			string += 'R'
			position[0] += 1
	return string
repeats = int(input())
for i in range(0, repeats):
	tempo = robot()
	if not tempo:
		print('NO')
	else:
		print('YES')
		print(tempo)


for i in range(int(input())):
	s = ''
	r = []
	x = 0
	y = 0
	for i in range(int(input())):
		r.append(list(map(int, input().split())))
	r.sort()
	for i in r:
		m = x - i[0]
		n = y - i[1]
		if m <= 0 and n <= 0:
			s += 'R' * abs(m) + 'U' * abs(n)
			x = i[0]
			y = i[1]
		else:
			s = ''
			break
	if len(s) == 0:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(t):
	f = True
	n = int(input())
	a = [[] for i in range(n)]
	for j in range(n):
		(x, y) = [int(i) for i in input().split()]
		a[j] = [x, y]
	for j in range(n):
		for k in range(j, n):
			if a[j][0] > a[k][0] and a[j][1] < a[k][1] or (a[j][0] < a[k][0] and a[j][1] > a[k][1]):
				f = False
				break
	if f:
		(x, y) = (0, 0)
		print('YES')
		a.sort()
		for i in range(n):
			print('R' * (a[i][0] - x), end='')
			print('U' * (a[i][1] - y), end='')
			x = a[i][0]
			y = a[i][1]
		print()
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	packs = {}
	path = ''
	for j in range(n):
		(x, y) = list(map(int, input().split()))
		if y not in packs:
			packs[y] = [x]
		else:
			packs[y].append(x)
	cx = 0
	cy = 0
	valid = True
	for k in sorted(packs.keys()):
		ty = k
		packs[k].sort()
		if valid:
			while len(packs[k]) > 0 and valid:
				tx = packs[k].pop(0)
				if tx < cx:
					valid = False
					print('NO')
					break
				else:
					path += (tx - cx) * 'R'
					cx = tx
				path += (ty - cy) * 'U'
				cy = ty
		else:
			break
	if valid:
		print('YES')
		print(path)


t = int(input())
for _ in range(t):
	a = int(input())
	l = [[0, 0]]
	while a:
		(n, k) = map(int, input().rstrip().split(' '))
		l.append([n, k])
		a -= 1
	l.sort()
	s = ''
	for i in range(1, len(l)):
		if l[i][0] == l[i - 1][0]:
			if l[i][1] < l[i - 1][1]:
				s = 'NO'
				break
			else:
				s += 'U' * (l[i][1] - l[i - 1][1])
		elif l[i][0] > l[i - 1][0]:
			s += 'R' * (l[i][0] - l[i - 1][0])
			if l[i][1] < l[i - 1][1]:
				s = 'NO'
				break
			elif l[i][1] > l[i - 1][1]:
				s += 'U' * (l[i][1] - l[i - 1][1])
		else:
			s = 'NO'
			break
	if s == 'NO':
		print('NO')
	else:
		print('YES')
		print(s)


def fun(x, n):
	s = 'R' * x[0][0] + 'U' * x[0][1]
	for i in range(1, n):
		if x[i][1] < x[i - 1][1]:
			return 'NO'
		s += 'R' * (x[i][0] - x[i - 1][0]) + 'U' * (x[i][1] - x[i - 1][1])
	return s
tc = int(input())
for _ in range(tc):
	n = int(input())
	x = []
	for i in range(n):
		l = list(map(int, input().split()))
		x.append(l)
	x.sort()
	an = fun(x, n)
	if an == 'NO':
		print('NO')
	else:
		print('YES')
		print(an)


for _ in range(int(input())):
	n = int(input())
	coord = []
	for _ in range(n):
		coord.append(list(map(int, input().split())))
	coord.sort()
	rt = ''
	curr = [0, 0]
	flag = 0
	for i in range(n):
		if curr[0] <= coord[i][0] and curr[1] <= coord[i][1]:
			rt += 'R' * (coord[i][0] - curr[0]) + 'U' * (coord[i][1] - curr[1])
			curr[0] = coord[i][0]
			curr[1] = coord[i][1]
		else:
			flag = 1
			print('NO')
			break
	if flag != 1:
		print('YES')
		print(rt)


t = int(input())
for i in range(t):
	n = int(input())
	a = []
	G = {}
	for k in range(n):
		a1 = [int(x) for x in input().split()]
		if a1[1] in G:
			l = []
			l = list(G[a1[1]])
			l.append(a1[0])
			G[a1[1]] = l
		else:
			l = []
			l.append(a1[0])
			G[a1[1]] = l
	a = list(G.keys())
	a.sort()
	res = ''
	x = 0
	y = 0
	fail = False
	for k in a:
		if min(G[k]) < x:
			fail = True
			break
		else:
			for z in range(x, min(G[k])):
				res += 'R'
			x = min(G[k])
			for z in range(y, k):
				res += 'U'
			y = k
			for z in range(x, max(G[k])):
				res += 'R'
			x = max(G[k])
	if fail:
		print('NO')
	else:
		print('YES')
		print(res)


t = int(input())
for i in range(t):
	n = int(input())
	packages = []
	no = False
	for i in range(n):
		a = list(map(int, input().split()))
		packages.append(a)
	packages.sort(key=lambda x: (x[0], x[1]))
	for i in range(n - 1):
		if packages[i][0] > packages[i + 1][0] and packages[i][1] < packages[i + 1][1] or (packages[i][0] < packages[i + 1][0] and packages[i][1] > packages[i + 1][1]):
			print('NO')
			no = True
			break
	if no:
		continue
	print('YES')
	posX = 0
	posY = 0
	ans = []
	for x in packages:
		ans.append('R' * (x[0] - posX))
		posX = x[0]
		ans.append('U' * (x[1] - posY))
		posY = x[1]
	print(''.join(ans))


for i in range(0, int(input())):
	n = int(input())
	l = []
	for j in range(0, n):
		l.append(list(map(int, input().split())))
	l.sort()
	f = 0
	for j in range(1, n):
		if l[j][1] < l[j - 1][1]:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		l.insert(0, [0, 0])
		print('YES')
		for j in range(1, len(l)):
			for k in range(l[j - 1][0], l[j][0]):
				print('R', end='')
			for k in range(l[j - 1][1], l[j][1]):
				print('U', end='')
		print('')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for l in range(n):
		(a, b) = map(int, input().split())
		arr.append((a, b))
	arr = sorted(arr)
	a = 0
	b = 0
	flag = 0
	ans = ''
	for (i, j) in arr:
		if j < b:
			flag = 1
			break
		ans += (i - a) * 'R' + (j - b) * 'U'
		a = i
		b = j
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(ans)


from sys import stdin
inp = (s.rstrip() for s in stdin).__next__

def mpint():
	return map(int, inp().split())
for case in range(int(inp())):
	n = int(inp())
	points = [tuple(mpint()) for i in range(n)]
	points.sort()
	ans = ''
	robot = (0, 0)
	while points:
		p = points.pop(0)
		if p[0] < robot[0] or p[1] < robot[1]:
			ans = 'NO'
			break
		else:
			ans += 'R' * (p[0] - robot[0]) + 'U' * (p[1] - robot[1])
			robot = p
	if ans == 'NO':
		print(ans)
	else:
		print('YES')
		print(ans)


t = int(input())
while t:
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append((x, y))
	l.sort()
	prev = (0, 0)
	flag = True
	ans = ''
	for i in range(n):
		if l[i][0] < prev[0] or l[i][1] < prev[1]:
			flag = False
			break
		elif l[i][0] == prev[0] and l[i][1] >= prev[1]:
			ans += 'U' * (l[i][1] - prev[1])
		elif l[i][1] == prev[1] and l[i][0] >= prev[0]:
			ans += 'R' * (l[i][0] - prev[0])
		else:
			ans += 'R' * (l[i][0] - prev[0])
			ans += 'U' * (l[i][1] - prev[1])
		prev = l[i]
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')
	t -= 1


def increasingcheck(coords):
	increasingcheck = list(zip(*coords))
	for i in increasingcheck:
		for j in range(len(i) - 1):
			if i[j] > i[j + 1]:
				return False
	return True

def getpaths(coords):
	movement = ''
	coord_cur = [0, 0]
	for coord in coords:
		movementright = coord[0] - coord_cur[0]
		movementup = coord[1] - coord_cur[1]
		movement += 'R' * movementright
		movement += 'U' * movementup
		coord_cur = coord
	return movement
for _ in range(int(input())):
	coords = []
	for j in range(int(input())):
		coords.append(input())
	coords = sorted([list(map(int, x.split())) for x in coords])
	if not increasingcheck(coords):
		print('NO')
		continue
	print('YES')
	print(getpaths(coords))


t = int(input())
for test in range(t):
	n = int(input())
	points = []
	for i in range(n):
		c = [int(x) for x in input().split()]
		points.append(c)
	points = sorted(points, key=lambda x: (x[0], x[1]))
	FLAG = 0
	for i in range(n):
		for j in range(i, n):
			if points[i][0] < points[j][0] and points[i][1] > points[j][1]:
				FLAG = 1
				break
	if FLAG == 1:
		print('NO')
		continue
	pr = 0
	pu = 0
	ans = ''
	for i in range(n):
		r = points[i][0]
		u = points[i][1]
		dr = r - pr
		du = u - pu
		for i in range(dr):
			ans += 'R'
		for j in range(du):
			ans += 'U'
		pr = r
		pu = u
	print('YES')
	print(ans)


t = int(input())
for i in range(t):
	answer = ''
	n = int(input())
	points = [(0, 0)]
	for i in range(n):
		points.append(tuple(map(int, input().split())))
	points.sort(key=lambda p: (p[0], p[1]))
	f = True
	for i in range(1, n + 1):
		if points[i][1] < points[i - 1][1]:
			f = False
	if not f:
		print('NO')
	else:
		print('YES')
		for i in range(1, n + 1):
			answer += 'R' * (points[i][0] - points[i - 1][0])
			answer += 'U' * (points[i][1] - points[i - 1][1])
		print(answer)


for i in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append([x, y])
	l.sort()
	ans = ''
	(x, y) = (0, 0)
	flag = 1
	for i in range(n):
		if l[i][0] > x:
			for j in range(abs(l[i][0] - x)):
				ans += 'R'
			x = l[i][0]
		if l[i][0] < x:
			flag = 0
			break
		if l[i][0] == x and l[i][1] > y:
			for j in range(abs(l[i][1] - y)):
				ans += 'U'
			y = l[i][1]
		if l[i][1] < y:
			flag = 0
			break
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	lis = []
	ans = ''
	for i in range(n):
		(a, b) = map(int, input().split())
		lis.append([a, b])
	lis.sort()
	x = y = c = 0
	for i in range(n):
		x1 = lis[i][0]
		y1 = lis[i][1]
		if x1 < x or y1 < y:
			print('NO')
			c = 1
			break
		else:
			ans += 'R' * (x1 - x) + 'U' * (y1 - y)
			x = x1
			y = y1
	if c == 0:
		print('YES')
		print(ans)


test = int(input())
for q in range(test):
	n = int(input())
	points = []
	for i in range(n):
		(x, y) = map(int, input().split())
		points.append((x, y))
	points.sort(key=lambda x: (x[0], x[1]))
	points.insert(0, (0, 0))
	s = ''
	flag = 0
	for i in range(len(points) - 1):
		if points[i + 1][1] >= points[i][1]:
			s += 'R' * (points[i + 1][0] - points[i][0])
			s += 'U' * (points[i + 1][1] - points[i][1])
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


def create_str_u(xs):
	string = ''
	for i in range(xs):
		string += 'U'
	return string

def create_str_r(xs):
	string = ''
	for i in range(xs):
		string += 'R'
	return string

def revesed(x):
	string = ''
	for i in x:
		string += min(i, i[::-1])
	return string
sx = int(input())
for i in range(sx):
	(x, y) = (0, 0)
	Err = False
	lines = int(input())
	ll = [list(map(int, input().split())) for i in range(lines)]
	ll.sort(key=lambda i: i[0:2])
	los = []
	for j in ll:
		(nx, ny) = (j[0], j[1])
		if nx >= x and ny >= y:
			sxs = create_str_u(ny - y)
			sys = create_str_r(nx - x)
			los.append(sxs + sys)
			(x, y) = (nx, ny)
		else:
			print('NO')
			Err = True
			break
	if not Err:
		print('YES')
		print(revesed(los))


t = int(input())
for _ in range(t):
	n = int(input())
	pack = []
	flg = 0
	for i in range(n):
		(a, b) = map(int, input().strip().split())
		pack.append((a, b))
		if a < 0 or b < 0:
			flg = 1
	if flg:
		print('NO')
	else:
		pack = sorted(pack)
		flg = 0
		ans = ''
		curr = [0, 0]
		for i in range(n):
			r = curr[0]
			c = curr[1]
			row = pack[i][0]
			col = pack[i][1]
			if r > row or c > col:
				flg = 1
				break
			ans += 'R' * (row - r)
			ans += 'U' * (col - c)
			curr = [row, col]
		if flg:
			print('NO')
		else:
			print('YES')
			print(ans)


for _ in range(int(input())):
	n = int(input())
	p = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		p.append((x, y))
	p.sort()
	(x, y) = (0, 0)
	ans = ''
	while p:
		ans += 'R' * (p[0][0] - x)
		if p[0][1] < y:
			print('NO')
			break
		ans += 'U' * (p[0][1] - y)
		(x, y) = p[0]
		p.pop(0)
	else:
		print('YES', ans, sep='\n')


from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from heapq import heappush, heappop
import math
import io
import os
import math
import bisect

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def digits(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def ceil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def mapin():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	d = defaultdict(lambda : [])
	n = int(input())
	(a, b) = (0, 0)
	for i in range(n):
		(x, y) = mapin()
		d[x].append(y)
	s = []
	fl = 1
	for i in sorted(d.keys()):
		for m in range(i - a):
			s.append('R')
		a = i
		d[i].sort()
		for j in d[i]:
			if j >= b:
				for m in range(j - b):
					s.append('U')
				b = j
			else:
				fl = 0
				break
	if fl == 0:
		print('NO')
	else:
		print('YES')
		print(''.join(s))


t = int(input())
for _ in range(t):
	n = int(input())
	packages = [(0, 0)]
	for _ in range(n):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	packages.sort()
	path = []
	for (prev, cur) in zip(packages, packages[1:]):
		if prev[1] > cur[1]:
			print('NO')
			break
		xdif = cur[0] - prev[0]
		ydif = cur[1] - prev[1]
		path.append('R' * xdif)
		path.append('U' * ydif)
	else:
		print('YES')
		print(''.join(path))


def read():
	n = int(input())
	a = []
	for i in range(n):
		a.append(tuple(map(int, input().split())))
	return (n, a)

def solve(n: int, a: list):
	for i in range(n - 1):
		for j in range(i + 1, n):
			swap = False
			if a[j][0] < a[i][0]:
				swap = True
			elif a[j][0] == a[i][0] and a[j][1] < a[i][1]:
				swap = True
			if swap:
				(a[i], a[j]) = (a[j], a[i])
	(x, y) = (0, 0)
	s = ''
	for ai in a:
		dx = ai[0] - x
		dy = ai[1] - y
		if dx < 0 or dy < 0:
			return None
		s += dx * 'R' + dy * 'U'
		(x, y) = (ai[0], ai[1])
	return s
for t in range(int(input())):
	result = solve(*read())
	if result:
		print('YES')
		print(result)
	else:
		print('NO')


t = int(input())

def merge(cords, p, m, q):
	i = p
	j = m + 1
	l = [0] * (m - p + 1)
	r = [0] * (q - (m + 1) + 1)
	for i in range(p, m + 1):
		l[i - p] = cords[i]
	for i in range(m + 1, q + 1):
		r[i - m - 1] = cords[i]
	i = 0
	j = 0
	k = p
	while i <= m - p and j <= q - (m + 1):
		if l[i][0] < r[j][0]:
			cords[k] = l[i]
			i += 1
			k += 1
		elif l[i][0] > r[j][0]:
			cords[k] = r[j]
			j += 1
			k += 1
		elif l[i][1] < r[j][1]:
			cords[k] = l[i]
			i += 1
			k += 1
		elif l[i][1] > r[j][1]:
			cords[k] = r[j]
			j += 1
			k += 1
	while i <= m - p:
		cords[k] = l[i]
		i += 1
		k += 1
	while j <= q - (m + 1):
		cords[k] = r[j]
		j += 1
		k += 1
	return cords

def mergesort(cords, p, q):
	if p < q:
		m = int(p + (q - p) / 2)
		cords = mergesort(cords, p, m)
		cords = mergesort(cords, m + 1, q)
		return merge(cords, p, m, q)
	return cords

def getpath(cords):
	path = ''
	index = [0, 0]
	for i in range(len(cords)):
		x_diff = cords[i][0] - index[0]
		if x_diff >= 0:
			for j in range(x_diff):
				path += 'R'
			index[0] += x_diff
		else:
			return ''
		y_diff = cords[i][1] - index[1]
		if y_diff >= 0:
			for j in range(y_diff):
				path += 'U'
			index[1] += y_diff
		else:
			return ''
	return path
for i in range(t):
	n = int(input())
	cords = []
	for j in range(n):
		p = input().split()
		xy = [int(e) for e in p]
		cords.append(xy)
	cords = mergesort(cords, 0, n - 1)
	path = getpath(cords)
	if path == '':
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
for i in range(t):
	n = int(input())
	s = []
	f = 0
	for i in range(n):
		(a, b) = map(int, input().split())
		s.append((a, b))
	for i in range(n):
		for j in range(n):
			if s[i][0] < s[j][0] and s[i][1] > s[j][1]:
				f = 1
				break
	if f == 1:
		print('NO')
	else:
		print('YES')
		s.sort()
		print('R' * s[0][0], end='')
		print('U' * s[0][1], end='')
		for i in range(1, n):
			print('R' * (s[i][0] - s[i - 1][0]), end='')
			print('U' * (s[i][1] - s[i - 1][1]), end='')
		print()


t = int(input())
for i in range(t):
	n = int(input())
	package = []
	(pre_x, pre_y) = (0, 0)
	flag = False
	ans = ''
	for j in range(n):
		(x, y) = map(int, input().split())
		package.append([x, y])
	package.sort()
	for (x, y) in package:
		if x - pre_x < 0 or y - pre_y < 0:
			print('NO')
			flag = True
			break
		else:
			for k in range(x - pre_x):
				ans += 'R'
			for k in range(y - pre_y):
				ans += 'U'
			pre_x = x
			pre_y = y
	if flag:
		continue
	print('YES')
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	lis = []
	for i in range(n):
		(x, y) = map(int, input().split())
		lis.append([x, y])
	lis = sorted(lis, key=lambda x: x[0] + x[1])
	lastx = 0
	lasty = 0
	flag = 1
	for item in lis:
		x = item[0]
		y = item[1]
		if lastx <= x and lasty <= y:
			lastx = x
			lasty = y
			continue
		else:
			print('NO')
			flag = 0
			break
	if flag == 1:
		print('YES')
		lastx = 0
		lasty = 0
		for item in lis:
			x = item[0]
			y = item[1]
			print('R' * (x - lastx), end='')
			print('U' * (y - lasty), end='')
			lasty = y
			lastx = x
		print('')


nt = int(input())
for q in range(nt):
	n = int(input())
	l = []
	for z in range(n):
		e = list(map(int, input().split()))
		l.append(e)
	l.sort()
	b = []
	for i in range(len(l)):
		b.append(l[i][1])
	B = b.copy()
	B.sort()
	if B == b:
		print('YES')
		y = l[0][1]
		X = 0
		Y = 0
		ans = ''
		for i in range(len(l)):
			if y < l[i][1]:
				y = l[i][1]
			x = l[i][0]
			ans += (x - X) * 'R'
			X = x
			ans += (y - Y) * 'U'
			Y = y
		print(ans)
	else:
		print('NO')


for k in range(0, int(input())):
	n = int(input())
	a = []
	for i in range(0, n):
		(x, y) = list(map(int, input().split()))
		a.append([x, y])
	a.sort()
	x = 0
	y = 0
	m = 0
	ans = ''
	i = 0
	while i < n:
		if a[i][0] < x or a[i][1] < y:
			break
		elif a[i][0] == x:
			ans += 'U'
			y += 1
		else:
			ans += 'R'
			x += 1
		if a[i][0] == x and a[i][1] == y:
			i += 1
	if i < n:
		print('NO')
	else:
		print('YES')
		print(ans)


def solution(n, pos):
	sol = 'R' * pos[0][0] + 'U' * pos[0][1]
	for i in range(1, n):
		x = pos[i][0] - pos[i - 1][0]
		y = pos[i][1] - pos[i - 1][1]
		if y < 0:
			print('NO')
			return
		sol += 'R' * x + 'U' * y
	print('YES')
	print(sol)
	return
t = int(input())
for i in range(t):
	n = int(input())
	pos = []
	for j in range(n):
		pos.append(list(map(int, input().split())))
	pos.sort()
	solution(n, pos)


from collections import defaultdict as dd
from collections import Counter as ccd
from itertools import permutations as pp
from itertools import combinations as cc
from random import randint as rd
from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq as hq
from math import gcd
mod = pow(10, 9) + 7

def inp(flag=0):
	if flag == 0:
		return list(map(int, input().strip().split(' ')))
	else:
		return int(input())
t = inp(1)
while t:
	t -= 1
	n = inp(1)
	l = []
	for i in range(n):
		(a, b) = inp()
		l.append((a, b))
	l = sorted(l)
	possible = True
	ans = ''
	prev = (0, 0)
	for i in range(n):
		if l[i][1] < prev[1]:
			possible = False
			break
		ans += (l[i][0] - prev[0]) * 'R' + (l[i][1] - prev[1]) * 'U'
		prev = l[i]
	if possible:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
while t > 0:
	d = []
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		d.append((a, b))
	d = sorted(d)
	for i in range(n - 1):
		if d[i][1] > d[i + 1][1]:
			print('NO')
			break
	else:
		print('YES')
		j = 0
		k = 0
		i = 0
		while i < n:
			while j < d[i][0]:
				j += 1
				print('R', end='')
			while k < d[i][1]:
				k += 1
				print('U', end='')
			i += 1
		print()
	t -= 1


for _ in [0] * int(input()):
	n = int(input())
	coords = []
	for i in [0] * n:
		coords.append(list(map(int, input().split())))
	coords = sorted(coords, key=lambda x: x)
	ans = 'R' * coords[0][0] + 'U' * coords[0][1]
	for i in range(1, n):
		if coords[i - 1][1] > coords[i][1]:
			ans = 'F'
			break
		else:
			ans += 'R' * (coords[i][0] - coords[i - 1][0]) + 'U' * (coords[i][1] - coords[i - 1][1])
	if ans == 'F':
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		a = list((int(x) for x in input().split()))
		(a[0], a[1]) = (a[1], a[0])
		l.append(a)
	l.sort()
	for i in range(len(l)):
		(l[i][0], l[i][1]) = (l[i][1], l[i][0])
	(a, b) = (0, 0)
	st = ''
	ans = 0
	for i in range(len(l)):
		if a <= l[i][0] and b <= l[i][1]:
			d = 'R' * (l[i][0] - a)
			e = 'U' * (l[i][1] - b)
			st = st + d + e
			a = l[i][0]
			b = l[i][1]
			ans += 1
		else:
			ans = -1
			break
	if ans == n:
		print('YES')
		print(st)
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	l = int(input())
	lis = []
	for ii in range(0, l):
		lis.append([int(x) for x in input().split()])
	lis.sort(key=lambda x: (x[0], x[1]))
	pre = [0, 0]
	s = ''
	p = True
	for ii in range(0, l):
		cur = lis[ii]
		dx = cur[0] - pre[0]
		if dx < 0:
			p = False
			break
		else:
			s = s + 'R' * dx
		dy = cur[1] - pre[1]
		if dy < 0:
			p = False
			break
		else:
			s = s + 'U' * dy
		pre = cur
	if p:
		print('YES')
		print(s)
	else:
		print('NO')


for _ in range(int(input())):
	h = []
	h.append(0)
	l = []
	l.append(0)
	n = int(input())
	for _ in range(n):
		(a, b) = map(int, input().split())
		h.append(a)
		l.append(b)
	for i in range(n):
		for j in range(i + 1, n + 1):
			if h[i] > h[j]:
				(h[i], h[j]) = (h[j], h[i])
				(l[i], l[j]) = (l[j], l[i])
	t = 0
	while t <= n:
		w = h.count(h[t]) + t - 1
		for i in range(t, w):
			for j in range(i + 1, w + 1):
				if l[i] > l[j]:
					(l[i], l[j]) = (l[j], l[i])
		t = w + 1
	s = ''
	f = True
	for i in range(1, n + 1):
		hf = h[i] - h[i - 1]
		lf = l[i] - l[i - 1]
		if hf < 0 or lf < 0:
			f = False
			continue
		else:
			s += 'R' * hf
			s += 'U' * lf
	if f == True:
		print('YES')
		print(s)
	else:
		print('NO')


from collections import *
import sys

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	n = ri()
	packages = []
	for i in range(n):
		packages.append(rl())
	packages.sort()
	ans2 = ''
	ans1 = 'YES'
	(curr_x, curr_y) = (0, 0)
	for (x, y) in packages:
		if y >= curr_y:
			ans2 += 'R' * (x - curr_x) + 'U' * (y - curr_y)
			curr_x = x
			curr_y = y
		else:
			ans1 = 'NO'
	print(ans1)
	if ans1 == 'YES':
		print(ans2)


def validPath(positions):
	roboPos = [0, 0]
	path = ''
	targetPos = positions.pop(0)
	fin = False
	while not fin:
		if roboPos[0] > targetPos[0]:
			return False
		elif roboPos[1] > targetPos[1]:
			return False
		if roboPos[0] < targetPos[0]:
			roboPos[0] += 1
			path += 'R'
		elif roboPos[1] < targetPos[1]:
			roboPos[1] += 1
			path += 'U'
		elif roboPos == targetPos:
			if positions != []:
				targetPos = positions.pop(0)
			else:
				fin = True
		else:
			print('ERROR')
			break
	return path
input()
while True:
	try:
		count = int(input())
		poss = []
		while count != 0:
			poss.append(input().split(' '))
			count -= 1
		for elem in poss:
			for i in range(len(elem)):
				elem[i] = int(elem[i])
		poss.sort()
		path = validPath(poss)
		if path == False:
			print('NO')
		else:
			print('YES')
			print(path)
	except EOFError:
		break


def get_answer():
	n = int(input())
	arr = [(0, 0)]
	for i in range(n):
		arr.append(tuple(map(int, input().split())))
	arr = sorted(arr, key=lambda element: (element[0], element[1]))
	dis_array = []
	for i in range(1, len(arr)):
		(x2, y2) = arr[i]
		(x1, y1) = arr[i - 1]
		dis_array.append((x2 - x1, y2 - y1))
	answer = []
	for (x, y) in dis_array:
		if x < 0 or y < 0:
			return ('NO', '')
		s1 = 'R' * x
		s2 = 'U' * y
		answer.append(s1)
		answer.append(s2)
	return ('YES', ''.join(answer))
t = int(input())
while t:
	t -= 1
	(s, ans) = get_answer()
	print(s)
	if s == 'YES':
		print(ans)


t = int(input())
for emay in range(t):
	error = False
	n = int(input())
	arr = []
	for i in range(n):
		a = list(map(int, input().split()))
		arr.append(a)
	arr.sort()
	ans = ''
	ans += 'R' * arr[0][0] + 'U' * arr[0][1]
	for i in range(1, n):
		if arr[i][1] < arr[i - 1][1]:
			error = True
			break
		else:
			ans += 'R' * (arr[i][0] - arr[i - 1][0]) + 'U' * (arr[i][1] - arr[i - 1][1])
	if error == True:
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	tp = []
	for i in range(n):
		(l, r) = map(int, input().split())
		tp.append((l, r))
	tp.sort(key=lambda x: (x[0], x[1]))
	s = ''
	q = 0
	mn = 0
	ch = 1
	for i in range(n):
		(l, r) = (tp[i][0], tp[i][1])
		if l > q:
			h = l - q
			s += 'R' * h
			q = l
		if r < mn:
			ch = 0
			break
		else:
			h = r - mn
			mn = r
			s += 'U' * h
	if ch == 0:
		print('NO')
	else:
		print('YES')
		print(s)


def sor(x, y):
	for j in range(len(x)):
		for i in range(len(x) - 1):
			if x[i] > x[i + 1]:
				u = x[i + 1] * 1
				x[i + 1] = x[i] * 1
				x[i] = u * 1
				y[i] > y[i + 1]
				u = y[i + 1] * 1
				y[i + 1] = y[i] * 1
				y[i] = u * 1
			elif x[i] == x[i + 1]:
				if y[i] > y[i + 1]:
					u = x[i + 1] * 1
					x[i + 1] = x[i] * 1
					x[i] = u * 1
					y[i] > y[i + 1]
					u = y[i + 1] * 1
					y[i + 1] = y[i] * 1
					y[i] = u * 1
	return y
k = int(input())
ant = []
d = []
for j in range(k):
	x = []
	y = []
	x0 = 0
	y0 = 0
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append(a)
		y.append(b)
	y = sor(x, y)
	x.sort()
	dummy = 'YES'
	ans = ''
	for i in range(n):
		if x[i] >= x0 and y[i] >= y0:
			ans += (x[i] - x0) * 'R' + (y[i] - y0) * 'U'
			x0 = x[i] * 1
			y0 = y[i] * 1
		else:
			dummy = 'NO'
	d.append(dummy)
	ant.append(ans)
for i in range(k):
	if d[i] == 'NO':
		print(d[i])
	else:
		print(d[i])
		print(ant[i])


import sys
t = int(sys.stdin.readline())

def solve(packages):
	packages = sorted(packages)
	(x, y) = (0, 0)
	s = ''
	for (px, py) in packages:
		while px > x:
			x += 1
			s += 'R'
		if py < y:
			print('NO')
			return
		while py > y:
			y += 1
			s += 'U'
	print('YES')
	print(s)
for i in range(t):
	p = int(sys.stdin.readline())
	packages = []
	for j in range(p):
		packages.append(tuple((int(v) for v in sys.stdin.readline().split())))
	solve(packages)


def solve(packages):
	path = []
	(x_, y_) = (0, 0)
	for (x, y) in sorted(packages):
		if x < x_ or y < y_:
			return None
		if x > x_:
			path.append('R' * (x - x_))
			x_ = x
		if y > y_:
			path.append('U' * (y - y_))
			y_ = y
	return path
for T in range(int(input())):
	packages = []
	for i in range(int(input())):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	path = solve(packages)
	if path is None:
		print('NO')
	else:
		print('YES')
		print(''.join(path))


import sys
import math
import itertools
import functools
import collections
import operator

def ii():
	return int(input())

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

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

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

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)
t = ii()
for _ in range(t):
	n = ii()
	arr = []
	f = True
	for i in range(n):
		arr.append(li())
	arr.sort()
	t = [0, 0]
	ans = ''
	for i in range(n):
		if arr[i][0] < t[0] or arr[i][1] < t[1]:
			print('NO')
			f = False
			break
		else:
			ans += 'R' * (arr[i][0] - t[0]) + 'U' * (arr[i][1] - t[1])
			t[0] = arr[i][0]
			t[1] = arr[i][1]
	if f:
		print('YES')
		print(ans)


from sys import stdin, stdout

def solve():
	n = int(input())
	A = []
	S = []
	for i in range(n):
		(x, y) = [int(i) for i in stdin.readline().split()]
		A.append([x, y])
	A.sort()
	p = [0, 0]
	for i in A:
		if i[0] >= p[0] and i[1] >= p[1]:
			S += ['R'] * (i[0] - p[0])
			S += ['U'] * (i[1] - p[1])
			p = i
		else:
			print('NO')
			return 0
	print('YES')
	print(''.join(S))
	return 0
t = int(input())
for i in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(tuple(map(int, input().split())))
	l.sort()
	f = 0
	res = ''
	for j in range(n):
		if j == 0:
			(x, y) = l[j]
			res += 'R' * x + 'U' * y
		else:
			(x, y) = (l[j][0] - l[j - 1][0], l[j][1] - l[j - 1][1])
			if x >= 0 and y >= 0:
				res += 'R' * x + 'U' * y
			else:
				f = 1
				break
	if f == 0:
		print('YES')
		print(res)
	else:
		print('NO')


def available(coords):
	for i in range(len(coords) - 1):
		if coords[i][1] > coords[i + 1][1]:
			return False
	return True

def solve(coords):
	coords.sort()
	if available(coords):
		print('YES')
		(currX, currY) = (0, 0)
		res = ''
		for i in range(len(coords)):
			while coords[i][0] > currX:
				res += 'R'
				currX += 1
			while coords[i][1] > currY:
				res += 'U'
				currY += 1
		print(res)
	else:
		print('NO')
tests = int(input())
for t in range(tests):
	packages = int(input())
	coords = []
	for p in range(packages):
		(x, y) = [int(i) for i in input().split()]
		coords.append((x, y))
	solve(coords)


test_cases = int(input())

def handle():
	lines = int(input())
	points = []
	for _ in range(lines):
		(x, y) = input().split(' ')
		x = int(x)
		y = int(y)
		points.append((x, y))
	points.sort()
	y_so_far = points[0][1]
	for (x, y) in points[1:]:
		if y < y_so_far:
			return ['NO']
		y_so_far = y
	current_x = 0
	current_y = 0
	path = ''
	for (x, y) in points:
		while current_x != x:
			path += 'R'
			current_x += 1
		while current_y != y:
			path += 'U'
			current_y += 1
	return ['YES', path]
for _ in range(test_cases):
	result = handle()
	for line in result:
		print(line)


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	a.sort()
	(x, y) = (0, 0)
	cor = 0
	s = ''
	while cor < n:
		if a[cor][0] < x or a[cor][1] < y:
			s = 'NO'
			break
		if a[cor][0] > x:
			x += 1
			s += 'R'
		elif a[cor][1] > y:
			y += 1
			s += 'U'
		else:
			cor += 1
	if s == 'NO':
		print(s)
	else:
		print('YES')
		print(s)


q = int(input())
for q in range(q):
	qq = int(input())
	dat = []
	s = ''
	for _ in range(qq):
		(x, y) = map(int, input().split())
		dat.append([x, y])
		dat.sort(key=lambda a: a[0] + a[1])
	(cx, cy) = (0, 0)
	f = True
	for i in range(qq):
		(x, y) = (dat[i][0], dat[i][1])
		if x < cx or y < cy:
			f = False
			break
		s += 'R' * (x - cx)
		s += 'U' * (y - cy)
		(cx, cy) = (dat[i][0], dat[i][1])
	if f:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	x = []
	x1 = []
	for j in range(n):
		(a, b) = input().strip().split(' ')
		(a, b) = [int(a), int(b)]
		x.append([a, b])
		x1.append([b, a])
	x.sort()
	x1.sort()
	k = 0
	for j in range(n):
		if x[j][1] != x1[j][0]:
			k = 1
			break
	s = ''
	if k == 1:
		print('NO')
	if k == 0:
		print('YES')
		f = 0
		ff = 0
		for jj in range(n):
			if x[jj][1] == ff:
				for kk in range(f, x[jj][0]):
					s += 'R'
				f = x[jj][0]
			elif x[jj][0] == f:
				for kk in range(ff, x[jj][1]):
					s += 'U'
				ff = x[jj][1]
			else:
				for kk in range(f, x[jj][0]):
					s += 'R'
				f = x[jj][0]
				for kk in range(ff, x[jj][1]):
					s += 'U'
				ff = x[jj][1]
		print(s)


for _ in range(int(input())):
	flag = 0
	l = []
	n = int(input())
	for i in range(n):
		l1 = []
		(a, b) = map(int, input().split())
		l1.append(a)
		l1.append(b)
		l.append(l1)
	l = sorted(l)
	s = ''
	for i in range(n):
		if i == 0:
			if l[0][0] == 0:
				k = l[0][1]
				while k > 0:
					s += 'U'
					k -= 1
			else:
				k = l[0][0]
				while k > 0:
					s += 'R'
					k -= 1
				k = l[0][1]
				while k > 0:
					s += 'U'
					k -= 1
		elif l[i][1] < l[i - 1][1]:
			print('NO')
			flag = 1
			break
		elif l[i][0] - l[i - 1][0] == 0:
			k = l[i][1] - l[i - 1][1]
			while k > 0:
				s += 'U'
				k -= 1
		elif l[i][1] - l[i - 1][1] == 0:
			k = l[i][0] - l[i - 1][0]
			while k > 0:
				s += 'R'
				k -= 1
		else:
			k = l[i][0] - l[i - 1][0]
			while k > 0:
				s += 'R'
				k -= 1
			k = l[i][1] - l[i - 1][1]
			while k > 0:
				s += 'U'
				k -= 1
	if flag == 0:
		print('YES')
		print(s)


t = int(input())
while t != 0:
	n = int(input())
	pos = []
	for _ in range(n):
		l = input().split()
		l = [int(x) for x in l]
		pos.append((l[0], l[1]))
	pos.sort()
	is_possible = True
	curr_x = 0
	curr_y = 0
	op = ''
	for (x, y) in pos:
		if curr_x > x:
			is_possible = False
			break
		else:
			op += 'R' * (x - curr_x)
			curr_x = x
		if curr_y > y:
			is_possible = False
			break
		else:
			op += 'U' * (y - curr_y)
			curr_y = y
	if is_possible:
		print('YES')
		print(op)
	else:
		print('NO')
	t -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	x = 0
	y = 0
	z = 0
	l = []
	l1 = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l1.append([a, b])
	l2 = sorted(l1, key=lambda x: (x[0], x[1]))
	for i in l2:
		a1 = i[0] - x
		b1 = i[1] - y
		x = i[0]
		y = i[1]
		if a1 >= 0 and b1 >= 0:
			for i in range(a1):
				l.append('R')
			for j in range(b1):
				l.append('U')
		else:
			z = -1
	if z == 0:
		print('YES')
		print(''.join(l))
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	li = [(0, 0)]
	for _ in range(n):
		(x, y) = map(int, input().split())
		li.append((x, y))
	li.sort(key=lambda x: (x[0], x[1]))
	(prev_x, prev_y) = (li[0][0], li[0][1])
	step = []
	for cord in li:
		(x, y) = (cord[0], cord[1])
		(nx, ny) = (x - prev_x, y - prev_y)
		if y < prev_y:
			print('NO')
			break
		t = 'R' * nx + 'U' * ny
		step.append(t)
		(prev_x, prev_y) = (cord[0], cord[1])
	else:
		print('YES')
		a = ''.join(step)
		print(a)


for _ in range(int(input())):
	n = int(input())
	d = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		if d.get(x) == None:
			d[x] = [y]
		else:
			d[x].append(y)
	k = sorted(list(d.keys()))
	mn = -1
	flag = True
	st = str()
	currx = 0
	curry = 0
	for i in k:
		for _ in range(i - currx):
			st += 'R'
		currx = i
		mx = max(d[i])
		if mn > min(d[i]):
			flag = False
			break
		mn = mx
		for _ in range(mx - curry):
			st += 'U'
		curry = mx
	if flag:
		print('YES')
		print(st)
	else:
		print('NO')


import math
t = int(input())
B = []
for i in range(t):
	A = []
	total = int(input())
	for j in range(total):
		A.append(list(map(int, input().split())))
	A.sort()
	C = []
	for k in A:
		C.append(k[1])
	if sorted(C) == C:
		print('YES')
		x = 0
		y = 0
		it = 0
		ans = ''
		while it < total:
			qq = A[it][0] - x
			ww = A[it][1] - y
			for nn in range(qq):
				ans = ans + 'R'
			for mm in range(ww):
				ans = ans + 'U'
			x = A[it][0]
			y = A[it][1]
			it = it + 1
		print(ans)
	else:
		print('NO')


from collections import defaultdict
import bisect
import math
x = int(input())
for _ in range(x):
	n = int(input())
	lol = []
	for __ in range(n):
		(a, b) = map(int, input().split())
		lol.append([a, b])
	lol.sort()
	s = ''
	a = 0
	b = 0
	f = 0
	for i in lol:
		if i[0] - a < 0 or i[1] - b < 0:
			f = 1
			break
		s += 'R' * (i[0] - a) + 'U' * (i[1] - b)
		a = i[0]
		b = i[1]
	if f:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for j in range(n):
		(x, y) = [int(p) for p in input().split()]
		l.append([x, y])
	l.sort()
	xoriginal = 0
	yoriginal = 0
	s = ''
	c = 0
	for j in range(0, n):
		if l[j][0] - xoriginal >= 0 and l[j][1] - yoriginal >= 0:
			s += (l[j][0] - xoriginal) * 'R' + (l[j][1] - yoriginal) * 'U'
			xoriginal = l[j][0]
			yoriginal = l[j][1]
		else:
			c += 1
			break
	if c == 0:
		print('YES')
		print(s)
	elif c > 0:
		print('NO')


for i in range(int(input())):
	n = int(input())
	(x, y) = (0, 0)
	arr = []
	ans = 'YES'
	s = ''
	for i in range(n):
		arr.append([int(i) for i in input().split()])
	arr.sort()
	for i in range(n):
		x1 = arr[i][0]
		y1 = arr[i][1]
		if x1 >= x and y1 >= y:
			s += 'R' * (x1 - x) + 'U' * (y1 - y)
			x = x1
			y = y1
		else:
			ans = 'NO'
	if ans == 'NO':
		print(ans)
	else:
		print(ans)
		print(s)


for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		(x, y) = map(int, input().split())
		arr.append([x, y])
	arr.sort()
	path = ''
	for x in range(arr[0][0]):
		path = path + 'R'
	for y in range(arr[0][1]):
		path = path + 'U'
	for i in range(n - 1):
		if arr[i][1] > arr[i + 1][1]:
			print('NO')
			path = ''
			break
		else:
			delta_x = arr[i + 1][0] - arr[i][0]
			delta_y = arr[i + 1][1] - arr[i][1]
			for x in range(delta_x):
				path = path + 'R'
			for y in range(delta_y):
				path = path + 'U'
	if path != '':
		print('YES')
		print(path)


import os, sys, math, random
(t, n) = (int(input()), 0)
ps = []

def path(p0, p1):
	(x0, y0) = (p0[0], p0[1])
	(x1, y1) = (p1[0], p1[1])
	return 'R' * (x1 - x0) + 'U' * (y1 - y0)

def solve():
	for i in range(0, n):
		for j in range(i + 1, n):
			(xi, yi) = (ps[i][0], ps[i][1])
			(xj, yj) = (ps[j][0], ps[j][1])
			if xi < xj and yi > yj or (xj < xi and yj > yi):
				return 'NO'
	ps.sort(key=lambda p: p[0] * 10000 + p[1])
	cp = [0, 0]
	res = ''
	for p in ps:
		res += path(cp, p)
		cp = p
	return 'YES\n' + res
for _ in range(t):
	n = int(input())
	ps = []
	for j in range(n):
		ps.append(list(map(int, input().split())))
	print(solve())


for _ in range(int(input())):
	l = []
	n = int(input())
	for _ in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	x = 0
	y = 0
	ans = ''
	f = 0
	for i in range(n):
		a = 10000
		b = 10000
		for j in range(n):
			if (l[j][0] > x or l[j][1] > y) and (l[j][0] - x < a or l[j][1] - y < b):
				if l[j][0] - x >= 0 and l[j][1] - y >= 0:
					a = l[j][0] - x
					b = l[j][1] - y
		if a != 10000:
			x = x + a
			y = y + b
			ans += 'R' * a + 'U' * b
		else:
			f = 1
			break
	if not f:
		print('YES')
		print(ans)
	else:
		print('NO')


def get_least_path():
	n = int(input())
	cs = []
	dct = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		cs.append((x, y))
		if x in dct:
			dct[x].append(y)
		else:
			dct[x] = [y]
	for (_, y) in dct.items():
		y.sort()
	cx = 0
	cy = 0
	ts = ''
	for i in range(1001):
		if i in dct:
			for y in dct[i]:
				ts += 'R' * (i - cx)
				if y < cy:
					return ['NO']
				ts += 'U' * (y - cy)
				cx = i
				cy = y
	return ['YES', ts]
for _ in range(int(input())):
	for s in get_least_path():
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	packages = []
	for _ in range(n):
		(xi, yi) = map(int, input().split())
		packages.append((xi, yi))
	packages.sort()
	path = []
	r = (0, 0)
	valid_path = True
	while valid_path and len(packages) > 0:
		p = packages.pop(0)
		x = p[0] - r[0]
		if x < 0:
			valid_path = False
			break
		for _ in range(x):
			path.append('R')
			r = (r[0] + 1, r[1])
		y = p[1] - r[1]
		if y < 0:
			valid_path = False
			break
		for _ in range(y):
			path.append('U')
			r = (r[0], r[1] + 1)
	if valid_path:
		print('YES')
		print(''.join(path))
	else:
		print('NO')


from math import factorial
from collections import Counter
from sys import stdin

def RL():
	return map(int, stdin.readline().rstrip().split())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 1000000007
N = int(input())
for _ in range(N):
	n = int(input())
	lis = []
	for _ in range(n):
		lis.append(list(RL()))
	lis.sort()
	res = ''
	las = (0, 0)
	for (x, y) in lis:
		if x < las[0] or y < las[1]:
			print('NO')
			break
		dx = x - las[0]
		dy = y - las[1]
		res += 'R' * dx
		res += 'U' * dy
		las = (x, y)
	else:
		print('YES')
		print(res)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	arr = []
	for __ in range(n):
		arr.append(list(map(int, stdin.readline().split())))
	arr_sorted = sorted(arr)
	flag = False
	order = ''
	order += 'R' * arr_sorted[0][0]
	order += 'U' * arr_sorted[0][1]
	for index in range(1, n):
		if arr_sorted[index][1] < arr_sorted[index - 1][1]:
			flag = True
			break
		order += 'R' * (arr_sorted[index][0] - arr_sorted[index - 1][0])
		order += 'U' * (arr_sorted[index][1] - arr_sorted[index - 1][1])
	if flag:
		print('NO')
	else:
		print('YES')
		print(order)


t = int(input())
for you in range(t):
	n = int(input())
	l = [(0, 0)]
	for i in range(n):
		lo = input().split()
		u = int(lo[0])
		v = int(lo[1])
		l.append((u, v))
	l.sort()
	poss = 1
	s = ''
	for i in range(1, n + 1):
		if l[i][1] < l[i - 1][1]:
			poss = 0
			break
		for j in range(l[i][0] - l[i - 1][0]):
			s = s + 'R'
		for j in range(l[i][1] - l[i - 1][1]):
			s = s + 'U'
	if poss:
		print('YES')
		print(s)
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	x = [list(map(int, input().split())) for j in range(n)]
	x.sort()
	if any((x[q][1] < x[q - 1][1] for q in range(1, n))):
		print('NO')
	else:
		print('YES')
		r = 'R' * (x[0][0] - 0) + 'U' * (x[0][1] - 0)
		e = 0
		while e < n - 1:
			if x[e][0] == x[e + 1][0]:
				r += 'U' * (x[e + 1][1] - x[e][1])
			else:
				r += 'R' * (x[e + 1][0] - x[e][0])
				if x[e][1] != x[e + 1][1]:
					r += 'U' * (x[e + 1][1] - x[e][1])
			e += 1
		print(r)


import sys
numCases = int(input())
casesCount = 0
while casesCount < numCases:
	casesCount += 1
	collectedPackages = 0
	numPackages = int(input())
	packagesCount = 0
	moveString = ''
	minX = [1001] * 1001
	maxX = [-1] * 1001
	maxRight = 0
	xHasPack = [False] * 1001
	while packagesCount < numPackages:
		packagesCount += 1
		packCoordArray = input().split(' ')
		for (i, val) in enumerate(packCoordArray):
			packCoordArray[i] = int(val)
		packX = packCoordArray[0]
		packY = packCoordArray[1]
		xHasPack[packX] = True
		if minX[packX] > packY:
			minX[packX] = packY
		if maxX[packX] < packY:
			maxX[packX] = packY
		if packX > maxRight:
			maxRight = packX
	isValidPath = True
	checkMax = 0
	for i in range(0, maxRight + 1):
		if xHasPack[i] == True:
			if minX[i] < checkMax:
				isValidPath = False
				break
			else:
				for j in range(checkMax, maxX[i]):
					moveString += 'U'
				checkMax = maxX[i]
		if i != maxRight:
			moveString += 'R'
	if isValidPath:
		print('YES')
		print(moveString)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	pack = []
	for __ in range(n):
		(x, y) = map(int, input().split())
		pack.append([x, y])
	pack.sort()
	(x, y) = pack[0]
	px = x * 'R'
	py = y * 'U'
	path = px + py
	valid = True
	for i in range(1, len(pack)):
		if pack[i][1] < pack[i - 1][1]:
			valid = False
			break
		x = pack[i][0] - pack[i - 1][0]
		y = pack[i][1] - pack[i - 1][1]
		px = x * 'R'
		py = y * 'U'
		path += px + py
	if valid:
		print('YES')
		print(path)
	else:
		print('NO')


for _ in range(int(input())):
	num = int(input())
	arr = []
	for i in range(num):
		(x, y) = map(int, input().split())
		arr.append((x, y))
	arr = sorted(arr, key=lambda l: l[0])
	arr = sorted(arr, key=lambda l: l[1])
	prevx = 0
	prevy = 0
	string = ''
	ans = 'YES'
	for pair in arr:
		if pair[0] > prevx and pair[1] >= prevy:
			for i in range(pair[0] - prevx):
				string += 'R'
			prevx = pair[0]
		elif pair[0] > prevx and pair[1] < prevy:
			ans = 'NO'
			break
		if pair[1] > prevy and pair[0] >= prevx:
			for i in range(pair[1] - prevy):
				string += 'U'
			prevy = pair[1]
		elif pair[1] > prevy and pair[0] < prevx:
			ans = 'NO'
			break
	print('YES\n' + string if ans == 'YES' else 'NO')


def solution(cells):
	(cmd, prev_x, prev_y) = ('', 0, 0)
	for cell in sorted(cells):
		if cell[0] < prev_x or cell[1] < prev_y:
			return ('NO',)
		else:
			cmd += 'R' * (cell[0] - prev_x)
			cmd += 'U' * (cell[1] - prev_y)
			(prev_x, prev_y) = cell
	return ('YES', cmd)

def read():
	cnt_v = int(input())
	for tmp in range(cnt_v):
		cnt = int(input())
		cells = []
		for _ in range(cnt):
			(x, y) = tuple(map(int, input().split()))
			cells.append((x, y))
		for item in solution(cells):
			print(item)
read()


def check(arr):
	for i in range(len(arr) - 1):
		if arr[i][0] > arr[i + 1][0]:
			return False
		if arr[i][1] > arr[i + 1][1]:
			return False
	return True
t = int(input())
for _ in range(t):
	n = int(input())
	arr = [list(map(int, input().split())) for i in range(n)]
	arr.sort()
	curx = 0
	cury = 0
	if check(arr):
		print('YES')
		for i in arr:
			cx = i[0] - curx
			curx += cx
			print('R' * cx, end='')
			cy = i[1] - cury
			cury += cy
			print('U' * cy, end='')
		print()
	else:
		print('NO')


import sys, collections

def get_dist(x1, y1, x2, y2):
	return 'R' * abs(x1 - x2) + 'U' * abs(y1 - y2)
tc = int(sys.stdin.readline())
for _ in range(tc):
	q = collections.deque()
	n = int(sys.stdin.readline())
	arr = [(0, 0)]
	for _ in range(n):
		(a, b) = map(int, sys.stdin.readline().split())
		arr.append((a, b))
	arr.sort(key=lambda x: (x[0], x[1]))
	can = True
	for i in range(n):
		if arr[i][0] > arr[i + 1][0]:
			can = False
			break
		if arr[i][1] > arr[i + 1][1]:
			can = False
			break
	if can:
		print('YES')
		ans = ''
		for i in range(n):
			ans += get_dist(arr[i][0], arr[i][1], arr[i + 1][0], arr[i + 1][1])
		print(ans)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	p = []
	for __ in range(n):
		p.append(list(map(int, input().split(' '))))
	p.sort()
	(a, b) = (0, 0)
	ans = ''
	f = 1
	for point in p:
		(x, y) = point
		if x >= a and y >= b:
			ans += 'R' * (x - a)
			a = x
			ans += 'U' * (y - b)
			b = y
		else:
			print('NO')
			f = 0
			break
	if f == 1:
		print('YES')
		print(ans)


def sorting_key(item):
	return (item[1], item[0])

def solve(prev, nexti):
	if nexti[1] < prev[1] or nexti[0] < prev[0]:
		return -1
	ans = ''
	x = 'R' * (nexti[0] - prev[0])
	ans = ans + x
	x = 'U' * (nexti[1] - prev[1])
	ans = ans + x
	return ans
t = int(input())
for i in range(t):
	n = int(input())
	pair = []
	x = []
	y = []
	for j in range(n):
		(a, b) = [int(s) for s in input().split()]
		x.append(a)
		y.append(b)
		pair.append((a, b))
	pair = sorted(pair, key=sorting_key)
	prev = (0, 0)
	next = prev
	flag = True
	ans = ''
	for j in range(n):
		nexti = pair[j]
		x = solve(prev, pair[j])
		prev = nexti
		if x == -1:
			flag = False
			break
		ans = ans + x
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	data = [list(map(int, input().split())) for j in range(n)]
	data.sort(key=lambda x: x[1])
	data.sort(key=lambda x: x[0])
	ans = 'R' * data[0][0] + 'U' * data[0][1]
	for i in range(n - 1):
		if data[i][1] > data[i + 1][1]:
			print('NO')
			break
		else:
			ans += 'R' * (data[i + 1][0] - data[i][0]) + 'U' * (data[i + 1][1] - data[i][1])
	else:
		print('YES')
		print(ans)


import math

def sort(arr=[]):
	for i in range(len(arr)):
		for j in range(len(arr) - i - 1):
			if arr[j][2] > arr[j + 1][2]:
				(arr[j], arr[j + 1]) = (arr[j + 1], arr[j])
	return arr

def check(n, arr=[]):
	ret = ''
	for i in range(n):
		if arr[i + 1][0] - arr[i][0] < 0 or arr[i + 1][1] - arr[i][1] < 0:
			return 'NO'
		ret += 'R' * (arr[i + 1][0] - arr[i][0]) + 'U' * (arr[i + 1][1] - arr[i][1])
	return ret
x = int(input())
out = []
for i in range(0, x):
	y = int(input())
	z = [[0, 0, 0]]
	for j in range(0, y):
		inp = list(map(int, input().split()))
		inp.append(math.sqrt(inp[0] ** 2 + inp[1] ** 2))
		z.append(inp)
	z = sort(z)
	o = check(y, z)
	if o == 'NO':
		out.append('NO')
	else:
		out.append('YES')
		out.append(o)
for i in out:
	print(i)


MOD = 1000000007
MOD2 = 998244353
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
for _ in range(ii()):
	n = ii()
	l = [list(f()) for _ in range(n)]
	l.sort()
	s = l[0][0] * 'R' + l[0][1] * 'U'
	fg = 0
	for i in range(1, n):
		if l[i][0] >= l[i - 1][0] and l[i][1] >= l[i - 1][1]:
			s += (l[i][0] - l[i - 1][0]) * 'R' + (l[i][1] - l[i - 1][1]) * 'U'
		else:
			fg = 1
			break
	if fg:
		print('NO')
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	a = int(input())
	b = []
	for _ in range(a):
		b.append(list(map(int, input().split())))
	ans = []
	b = sorted(b, key=lambda x: (x[0], x[1]))
	boo = 0
	(pr, pu) = (0, 0)
	for i in range(0, a):
		(r, u) = (b[i][0], b[i][1])
		if boo == 1:
			break
		if i == 0:
			ans += ['R'] * r + ['U'] * u
			pr = r
			pu = u
		elif r - pr >= 0 and u - pu >= 0 and (i != 0):
			ans += ['R'] * (r - pr) + ['U'] * (u - pu)
			pr = r
			pu = u
		else:
			boo = 1
	if boo == 0:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	package = [[0, 0]]
	ans = ''
	f = 0
	for i in range(n):
		t = list(map(int, input().split()))
		l = t[::-1]
		package.append(l)
	package.sort()
	i = 0
	while i < n:
		if package[i + 1][0] == package[i][0]:
			ans += 'R' * (package[i + 1][1] - package[i][1])
		elif package[i + 1][1] >= package[i][1]:
			ans += 'R' * (package[i + 1][1] - package[i][1])
			ans += 'U' * (package[i + 1][0] - package[i][0])
		else:
			f = 1
			break
		i += 1
	if f == 0:
		print('YES')
		print(ans)
	else:
		print('NO')


a_ = int(input())
for _ in range(a_):
	n = int(input())
	l = []
	for _ in range(n):
		l.append(list(map(int, input().split())))
	points = sorted(l)
	c = ''
	x = 0
	y = 0
	bool_ = True
	for (a, b) in points:
		if a > x:
			c += 'R' * (a - x)
			x = a
		if b < y:
			bool_ = False
			print('NO')
			break
		if b > y:
			c += 'U' * (b - y)
			y = b
	if bool_:
		print('YES')
		print(c)


t = int(input())
result = []
for _ in range(t):
	n = int(input())
	packages = []
	for i in range(n):
		package = list(map(int, input().split()))
		packages.append([sum(package), package])
	packages.sort()
	path = ''
	current = [0, 0]
	flag = True
	for (i, p) in packages:
		dx = p[0] - current[0]
		dy = p[1] - current[1]
		if dx < 0 or dy < 0:
			result.append('NO')
			flag = False
			break
		path += 'R' * dx
		path += 'U' * dy
		current = p
	if flag:
		result.append('YES')
		result.append(path)
for i in result:
	print(i)


for _ in range(int(input())):
	n = int(input())
	a = []
	b = ''
	for i in range(n):
		a += [list(map(int, input().split()))]
	a.sort()
	x = y = 0
	for i in range(n):
		if a[i][0] != x:
			b += 'R' * (a[i][0] - x)
			x = a[i][0]
		if a[i][1] != y:
			if y > a[i][1]:
				print('NO')
				break
			else:
				b += 'U' * (a[i][1] - y)
				y = a[i][1]
	else:
		print('YES')
		print(b)


T = int(input())
for _ in range(T):
	n = int(input())
	packages = []
	for package in range(n):
		packages.append(list(map(int, input().split())))
	packages.sort(key=lambda x: (x[0], x[1]))
	pos = [0, 0]
	moves = []
	lost = False
	for package in packages:
		if pos[0] > package[0]:
			lost = True
			break
		while pos[0] < package[0]:
			pos[0] += 1
			moves.append('R')
		if pos[1] > package[1]:
			lost = True
			break
		while pos[1] < package[1]:
			pos[1] += 1
			moves.append('U')
	if lost == True:
		print('NO')
	else:
		print('YES')
		print(''.join(map(str, moves)))


for i in range(int(input())):
	l1 = []
	for j in range(int(input())):
		l1.append([int(x) for x in input().split()])
	l1.sort()
	l1 = [[0, 0]] + l1
	flag = True
	for j in range(len(l1) - 1):
		if l1[j + 1][1] < l1[j][1]:
			flag = False
	ans = ''
	if flag == False:
		print('NO')
	else:
		for j in range(len(l1) - 1):
			ans = ans + 'R' * (l1[j + 1][0] - l1[j][0])
			ans = ans + 'U' * (l1[j + 1][1] - l1[j][1])
		print('YES')
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	lst = []
	for k in range(n):
		lst.append([int(i) for i in input().split()])
	lst = sorted(lst)
	for z in range(len(lst) - 1):
		if lst[z][1] > lst[z + 1][1]:
			print('NO')
			break
	else:
		print('YES')
		final = ''
		current_r = 0
		current_u = 0
		for elem in lst:
			final += 'R' * (elem[0] - current_r)
			final += 'U' * (elem[1] - current_u)
			current_r = elem[0]
			current_u = elem[1]
		print(final)


t = int(input())
for n in range(t):
	n = int(input())
	H = [[0, 0]]
	h = ''
	for u in range(n):
		a = list(map(int, input().split()))
		H.append(a)
	H.sort(key=lambda a: a[0] + a[1])
	for i in range(1, n + 1):
		if H[i][0] < H[i - 1][0] or H[i][1] < H[i - 1][1]:
			k = False
			break
		else:
			k = True
			h += 'R' * (H[i][0] - H[i - 1][0])
			h += 'U' * (H[i][1] - H[i - 1][1])
	if k == True:
		print('YES')
		print(h)
	else:
		print('NO')


def solve(coords, n):
	moves = []
	coords.sort()
	(x, y) = (0, 0)
	for i in coords:
		(yc, xc) = (i[0], i[1])
		if yc < y or xc < x:
			print('NO')
			return
		for j in range(xc - x):
			moves.append('R')
		for j in range(yc - y):
			moves.append('U')
		(x, y) = (xc, yc)
	print('YES')
	for i in moves:
		print(i, end='')
	print()

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		coords = []
		for j in range(n):
			(x, y) = map(int, input().split())
			coords.append((y, x))
		solve(coords, n)
main()


n = int(input())
for a in range(n):
	boxes = int(input())
	height = 0
	positions = {}
	result = ''
	currentX = 0
	currentY = 0
	works = True
	for b in range(boxes):
		xy = list(map(int, input().split()))
		if xy[1] > height:
			height = xy[1]
		if xy[1] in positions:
			positions[xy[1]].append(xy[0])
		else:
			positions[xy[1]] = [xy[0]]
	for b in range(0, height + 1):
		if b in positions:
			positions[b] = sorted(positions[b])
			if positions[b][0] < currentX:
				print('NO')
				works = False
				break
			else:
				result += 'R' * (positions[b][0] - currentX) + 'U' * (b - currentY)
				currentX = positions[b][0]
				result += 'R' * (positions[b][-1] - currentX)
				currentX = positions[b][-1]
				currentY = b
	if works == True:
		print('YES')
		print(result)


t = int(input())
for _ in range(t):
	n = int(input())
	packages = list()
	for _ in range(n):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	packages.sort()
	(max_x, max_y, ans, possible) = (0, 0, list(), True)
	for idx in range(len(packages)):
		(x, y) = packages[idx]
		if max_x <= x and max_y <= y:
			(max_x, max_y) = (x, y)
		else:
			possible = False
			break
		if idx == 0:
			ans.extend(['R'] * x)
			ans.extend(['U'] * y)
		else:
			ans.extend(['R'] * (x - packages[idx - 1][0]))
			ans.extend(['U'] * (y - packages[idx - 1][1]))
	if possible:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


t = input()
t = int(t)
for i in range(t):
	n = int(input())
	a = []
	for j in range(n):
		(x, y) = input().split()
		a.append((int(x), int(y)))
	a.sort(key=lambda su: su[0] + su[1])
	start = (0, 0)
	ans = ''
	for z in a:
		if z[0] >= start[0] and z[1] >= start[1]:
			ans += 'R' * (z[0] - start[0]) + 'U' * (z[1] - start[1])
		else:
			ans = 'NO'
			break
		start = z
	if ans != 'NO':
		print('YES')
	print(ans)


t = int(input())
for kek in range(t):
	n = int(input())
	gift = list()
	for i in range(n):
		gift.append(list(map(int, input().split())))
	gift.sort()
	flag = True
	x = 0
	y = 0
	leng = list()
	for i in range(n):
		if gift[i][0] >= x and gift[i][1] >= y:
			leng.append('R' * (gift[i][0] - x))
			leng.append('U' * (gift[i][1] - y))
			x = gift[i][0]
			y = gift[i][1]
		else:
			flag = False
			break
	if flag:
		print('YES')
		print(''.join(leng))
	else:
		print('NO')


import sys
rl = lambda : next(sys.stdin)

def solve(a):
	a.sort()
	ans = ''
	cx = cy = 0
	for (tx, ty) in a:
		if tx < cx or ty < cy:
			return ''
		ans += 'R' * (tx - cx)
		ans += 'U' * (ty - cy)
		(cx, cy) = (tx, ty)
	return ans

def main():
	t = int(rl())
	for _ in range(t):
		n = int(rl())
		a = []
		for _ in range(n):
			(x, y) = map(int, rl().split())
			a.append((x, y))
		ans = solve(a)
		if ans:
			print('YES')
			print(ans)
		else:
			print('NO')
main()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	packages = []
	for i in range(n):
		iline = input().rstrip().split()
		(x, y) = map(int, iline)
		packages.append((x, y))
	packages = sorted(packages, key=lambda a: (a[0], a[1]))
	cx = 0
	cy = 0
	path = ''
	ispossible = True
	for (x, y) in packages:
		r = x - cx
		u = y - cy
		if u < 0:
			ispossible = False
			break
		path = path + 'R' * r + 'U' * u
		cx = x
		cy = y
	if ispossible:
		print('YES\n' + path)
	else:
		print('NO')


for i in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	(x, y, f) = (0, 0, 1)
	ans = ''
	for i in range(n):
		(a, b) = l[i]
		if a < x or b < y:
			print('NO')
			f = 0
			break
		ans += 'R' * (a - x) + 'U' * (b - y)
		(x, y) = (a, b)
	if f:
		print('YES')
		print(ans)


t = int(input())
while t:
	t -= 1
	n = int(input())
	coo = [[]]
	for i in range(n):
		r = []
		r = list(map(int, input().split()))
		coo.append(r)
	coo = coo[1:n + 1]
	coo.sort()
	res = ''
	flag = 1
	for i in range(coo[0][0]):
		res += 'R'
	for i in range(coo[0][1]):
		res += 'U'
	for i in range(n - 1):
		if coo[i + 1][1] - coo[i][1] < 0 or coo[i + 1][0] - coo[i][0] < 0:
			print('NO')
			flag = 0
			break
		v = coo[i + 1][1] - coo[i][1]
		h = coo[i + 1][0] - coo[i][0]
		for j in range(h):
			res += 'R'
		for j in range(v):
			res += 'U'
	if flag == 1:
		print('YES')
		print(res)


t = int(input())
for j in range(t):
	n = int(input())
	l = []
	for j in range(n):
		l.append(list(map(int, input().split(' '))))
	lx = sorted(l)
	curr = [0, 0]
	ans = []
	flag = 0
	for i in range(len(lx)):
		if lx[i][0] < curr[0] or lx[i][1] < curr[1]:
			print('NO')
			flag = 1
			break
		else:
			ans.append('R' * (lx[i][0] - curr[0]) + 'U' * (lx[i][1] - curr[1]))
			curr = lx[i]
	if flag == 0:
		print('YES')
		for i in ans:
			print(i, end='')
		print()


n = int(input())
for i in range(n):
	t = int(input())
	x = y = 0
	z = []
	g = 1
	s = ''
	for i in range(t):
		(a, b) = map(int, input().split())
		z.append((a, b))
	p = sorted(z, key=lambda k: [k[1], k[0]])
	for i in p:
		p = i[0]
		q = i[1]
		if p >= x and q >= y and (g == 1):
			for j in range(x, p):
				x += 1
				s += 'R'
			for j in range(y, q):
				y += 1
				s += 'U'
		else:
			g = 0
			break
	if g:
		print('YES')
		print(s)
	else:
		print('NO')


class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __lt__(self, other):
		if self.x < other.x:
			return True
		elif self.x == other.x:
			return self.y <= other.y
		return False
t = int(input())
while t != 0:
	n = int(input())
	arrCor = []
	for i in range(n):
		(x, y) = map(int, input().split())
		arrCor.append(Point(x, y))
	arrCor.sort()
	result = ''
	curX = 0
	curY = 0
	for i in range(n):
		if curY > arrCor[i].y:
			result = 'NO'
			break
		if curX < arrCor[i].x:
			for j in range(curX, arrCor[i].x, 1):
				result += 'R'
			curX = arrCor[i].x
		if curY < arrCor[i].y:
			for j in range(curY, arrCor[i].y, 1):
				result += 'U'
			curY = arrCor[i].y
	if result != 'NO':
		print('YES')
		print(result)
	else:
		print(result)
	t -= 1


from sys import stdin, stdout
rl = lambda : stdin.readline()
rll = lambda : stdin.readline().split()

def main():
	T = int(rl())
	(case, cases) = ([], [])
	curr = rll()
	while curr:
		while len(curr) == 2:
			case.append([int(x) for x in curr])
			curr = rll()
		if len(case) > 0:
			cases.append(case)
		case = []
		curr = rll()
	for case in cases:
		xsorted = sorted(case, key=lambda I: (I[0], I[1]))
		(path, prevx, prevy, flag) = ([], 0, 0, False)
		for (x, y) in xsorted:
			if flag:
				continue
			if y < prevy:
				(path, flag) = ([], True)
				continue
			(xdiff, ydiff) = (x - prevx, y - prevy)
			path.extend(['R'] * xdiff)
			path.extend(['U'] * ydiff)
			(prevx, prevy) = (x, y)
		if len(path) > 0:
			stdout.write(str('YES') + '\n')
			stdout.write(''.join(path) + '\n')
		else:
			stdout.write(str('NO') + '\n')
		path = []
	stdout.close()
main()


for _ in range(int(input())):
	n = int(input())
	dic = {}
	for _ in range(n):
		(x, y) = map(int, input().split())
		if x not in dic:
			dic[x] = [y]
		elif y > dic[x][-1]:
			dic[x].append(y)
		else:
			dic[x] = [y] + dic[x]
	ans = 'YES'
	out = ''
	curr_max = 0
	(prev_x, prev_y) = (0, 0)
	for i in sorted(dic.keys()):
		out += (i - prev_x) * 'R'
		if min(dic[i]) < curr_max:
			ans = 'NO'
			break
		else:
			curr_max = max(dic[i])
			out += (curr_max - prev_y) * 'U'
		(prev_x, prev_y) = (i, max(dic[i]))
	if ans == 'NO':
		print(ans)
	else:
		print(ans)
		print(out)


m = int(input())
for i in range(m):
	n = int(input())
	pack_vis = [0] * n
	packs = []
	packs_dis = []
	flag_NO = 0
	for j in range(n):
		t = [int(x) for x in input().split()]
		packs.append(t)
		packs_dis.append(sum(t))
	packs = sorted(packs, key=lambda x: x[0] + x[1])
	if len(set(packs_dis)) < len(packs_dis):
		flag_NO = 1
	(x, y) = (0, 0)
	res = ''
	for (tx, ty) in packs:
		if tx < x or ty < y:
			flag_NO = 1
			break
		else:
			res += 'R' * (tx - x) + 'U' * (ty - y)
			(x, y) = (tx, ty)
	if flag_NO == 1:
		print('NO')
	else:
		print('YES')
		print(res)


t = int(input())
for _ in range(t):
	n = int(input())
	p = []
	for __ in range(n):
		(x, y) = map(int, input().split())
		p.append((x, y))
	p.sort()
	path = []
	(xAct, yAct) = (0, 0)
	impossible = False
	for (x, y) in p:
		if x >= xAct and y >= yAct:
			path.extend(['R'] * (x - xAct))
			xAct = x
			path.extend(['U'] * (y - yAct))
			yAct = y
		else:
			print('NO')
			impossible = True
			break
	if not impossible:
		print('YES')
		print(''.join(path))


import os
import sys
from io import BytesIO, IOBase
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 list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	n = int(ri())
	lis = []
	for i in range(n):
		lis.append(tuple(Ri()))
	lis.sort(key=lambda x: (x[0], x[1]))
	flag = True
	(x, y) = (0, 0)
	ans = []
	for i in range(len(lis)):
		if x > lis[i][0] or y > lis[i][1]:
			flag = False
			break
		else:
			ans = ans + ['R'] * (lis[i][0] - x)
			ans = ans + ['U'] * (lis[i][1] - y)
			x = lis[i][0]
			y = lis[i][1]
	if flag:
		YES()
		print(''.join(ans))
	else:
		NO()


def q_2():
	n = int(input())
	is_pos = True
	s = ''
	list_1 = []
	for package in range(n):
		l = input().split(' ')
		p = []
		p = p + [int(l[0])] + [int(l[1])]
		list_1 = list_1 + [p]
	a = sorted(list_1)
	for i in range(len(a)):
		if a[i][1] < a[i - 1][1] and a[i][0] > a[i - 1][0]:
			is_pos = False
		else:
			pass
	if is_pos is True:
		b = [[0, 0]] + a
		for j in range(1, len(b)):
			e1 = b[j][0] - b[j - 1][0]
			e2 = b[j][1] - b[j - 1][1]
			s = s + (e1 * 'R' + e2 * 'U')
		print('YES')
		print(s)
	else:
		print('NO')
test_cases = int(input())
for l in range(test_cases):
	q_2()


for _ in range(int(input())):
	n = int(input())
	A = []
	x = 0
	y = 0
	for i in range(n):
		p = list((int(i) for i in input().split()))
		A.append(p)
	A.sort()
	ans = ''
	bool = True
	for ele in A:
		if ele[0] - x < 0 or ele[1] - y < 0:
			bool = False
			break
		ans = ans + 'R' * (ele[0] - x)
		ans = ans + 'U' * (ele[1] - y)
		x = ele[0]
		y = ele[1]
	if bool is True:
		print('YES')
		print(ans)
	else:
		print('NO')


def minn(l, n):
	for i in range(1, n):
		if l[i - 1][1] > l[i][1]:
			return False
	return True

def right(a, b):
	return b[0] - a[0]

def left(a, b):
	return b[1] - a[1]
for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(list(map(int, input().split())))
	l.sort()
	if not minn(l, n):
		print('NO')
	else:
		s = ''
		for i in range(n):
			if i == 0:
				ri = right([0, 0], l[i])
				le = left([0, 0], l[i])
			else:
				ri = right(l[i - 1], l[i])
				le = left(l[i - 1], l[i])
			s += 'R' * ri
			s += 'U' * le
		print('YES')
		print(s)


from operator import itemgetter

def more(a, b):
	if a[0] > b[0]:
		return 0
	if a[0] == b[0]:
		if a[1] > b[1]:
			return 0
	return 1
t = int(input())
for i in range(t):
	n = int(input())
	s = []
	res = ''
	for j in range(n):
		s.append(list(map(int, input().split())))
	s.sort()
	b = 0
	U = 0
	R = 0
	for k in range(n):
		for h in range(n):
			if h == k:
				continue
			elif s[h][0] < s[k][0] and s[h][1] > s[k][1]:
				print('NO')
				b = 1
				break
		if b == 1:
			break
	if b == 1:
		continue
	for j in range(len(s)):
		for j1 in range(s[j][0] - R):
			res += 'R'
		R = s[j][0]
		for j1 in range(s[j][1] - U):
			res += 'U'
		U = s[j][1]
	print('YES')
	print(res)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [0] * n
	for i in range(n):
		(x, y) = map(int, input().split())
		a[i] = (x, y)
	a = sorted(a)
	ans = ''
	l_x = 0
	l_y = 0
	tr = True
	for i in range(n):
		x = a[i][0]
		y = a[i][1]
		if x - l_x < 0 and y - l_y < 0 or l_x > x or l_y > y:
			tr = False
			break
		else:
			ans += 'R' * (x - l_x) + 'U' * (y - l_y)
			l_x = x
			l_y = y
	if tr:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	d = []
	for i in range(n):
		(x, y) = map(int, input().split())
		d.append([x, y])
	d.sort()
	flag = 0
	(x1, y1) = (0, 0)
	ans = ''
	for i in range(n):
		r = d[i][0] - x1
		u = d[i][1] - y1
		if r < 0 or u < 0:
			print('NO')
			flag = 1
			break
		ans += 'R' * r
		ans += 'U' * u
		(x1, y1) = (d[i][0], d[i][1])
	if flag == 0:
		print('YES')
		print(ans)


def single_test():
	num_package = int(input())
	packages = []
	for _ in range(num_package):
		package = input().split()
		package[0] = int(package[0])
		package[1] = int(package[1])
		packages.append(package)
	start = [0, 0]
	packages = sorted(packages)
	result = ''
	for package in packages:
		if package[1] - start[1] < 0:
			print('NO')
			return
		else:
			result = result + 'R' * (package[0] - start[0])
			result = result + 'U' * (package[1] - start[1])
		start = package
	print('YES')
	print(result)
num_test = int(input())
for test in range(num_test):
	single_test()


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for _ in range(n):
		(x, y) = input().split()
		arr.append((int(x), int(y)))
	arr.sort()
	cur = (0, 0)
	step = None
	steps = ''
	while len(arr):
		needly = arr[0]
		if cur[0] == needly[0] and cur[1] == needly[1]:
			arr.pop(0)
			continue
		if cur[0] < needly[0]:
			steps += 'R'
			cur = (cur[0] + 1, cur[1])
		elif cur[1] < needly[1]:
			steps += 'U'
			cur = (cur[0], cur[1] + 1)
		else:
			print('NO')
			break
	else:
		print('YES')
		print(steps)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(100000000)
	threading.stack_size(40960000)
	thread = threading.Thread(target=main)
	thread.start()
from collections import deque, Counter, OrderedDict, defaultdict
from math import ceil, floor, log, sqrt, factorial, pi
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	for _ in range(ii()):
		n = ii()
		l = defaultdict(list)
		x = []
		y = []
		for i in range(n):
			xx = li()
			l[xx[0]].append(xx[1])
			l[xx[0]].sort()
			x.append(xx[0])
		x = list(set(x))
		u = 0
		r = 0
		i = 0
		ans = ''
		flag = 1
		if True:
			for j in x:
				ans += 'R' * (j - r)
				r = j
				for k in l[j]:
					if k < u:
						flag = 0
						break
					if k == u:
						continue
					ans += 'U' * (k - u)
					u = k
				if flag == 0:
					break
		if flag == 0:
			print('NO')
		else:
			print('YES')
			print(ans)
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	x = []
	y = []
	for i in l:
		x.append(i[0])
		y.append(i[1])
	f = 1
	if sorted(x) != x or sorted(y) != y:
		f = 0
	if f == 0:
		print('NO')
	else:
		x = 0
		y = 0
		s = ''
		print('YES')
		for i in range(n):
			p = l[i][0] - x
			q = l[i][1] - y
			x += p
			y += q
			s += 'R' * p
			s += 'U' * q
		print(s)


import sys
from operator import itemgetter
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		XY = []
		f = True
		maX = 0
		maY = 0
		for _ in range(N):
			(x, y) = [int(x) for x in input().split()]
			XY.append([x, y])
		XY.sort(key=itemgetter(0, 1))
		for (x, y) in XY:
			if x < maX or y < maY:
				f = False
				break
			maX = max(maX, x)
			maY = max(maY, y)
		if f:
			print('YES')
			for _ in range(XY[0][0]):
				print('R', end='')
			for _ in range(XY[0][1]):
				print('U', end='')
			for i in range(1, N):
				for _ in range(XY[i][0] - XY[i - 1][0]):
					print('R', end='')
				for _ in range(XY[i][1] - XY[i - 1][1]):
					print('U', end='')
			print('')
		else:
			print('NO')
main()


for _ in range(int(input())):
	n = int(input())
	a = [(0, 0)] + list(sorted([tuple(map(int, input().split())) for _ in range(n)]))
	res = []
	for i in range(1, n + 1):
		if a[i][0] > a[i - 1][0]:
			res.append('R' * (a[i][0] - a[i - 1][0]))
		if a[i][1] < a[i - 1][1]:
			print('NO')
			break
		elif a[i][1] > a[i - 1][1]:
			res.append('U' * (a[i][1] - a[i - 1][1]))
	else:
		print('YES')
		print(''.join(res))


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	p = []
	for _ in range(n):
		(x, y) = list(map(int, sys.stdin.readline().split()))
		sumVal = x + y
		p.append([x, y, sumVal])
	p = sorted(p, key=lambda ele: ele[2])
	string = ''
	now = [0, 0]
	judge1 = True
	for ele in p:
		x_dist = ele[0] - now[0]
		y_dist = ele[1] - now[1]
		if x_dist < 0 or y_dist < 0:
			judge1 = False
			break
		else:
			if x_dist != 0:
				for _ in range(x_dist):
					string += 'R'
			if y_dist != 0:
				for _ in range(y_dist):
					string += 'U'
		now = [ele[0], ele[1]]
	if judge1 == True:
		print('YES')
		print(string)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	tab = []
	for i in range(n):
		(x, y) = map(int, input().split())
		tab += [[x, y]]
	tab.sort()
	path = ''
	last = [0, 0]
	p = 1
	for x in range(tab[-1][0] + 1):
		m = -1
		for coor in tab:
			if coor[0] <= x:
				if coor[0] == x:
					m = max(m, coor[1])
					if coor[1] < last[1]:
						p = 0
			else:
				if m == -1:
					path += 'R'
					last = [x, last[1]]
				elif m >= last[1] and x >= last[0]:
					path += 'U' * (m - last[1])
					last = [x, m]
					if x < tab[-1][0]:
						path += 'R'
				else:
					p = 0
				break
	if p:
		if m >= last[1] and tab[-1][0] >= last[0]:
			path += 'U' * (m - last[1])
			print('YES')
			print(path)
		else:
			print('NO')
	else:
		print('NO')


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	l = defaultdict(list)
	for i in range(n):
		(x, y) = map(int, input().split())
		l[x].append(y)
	j = 0
	p = []
	g = 0
	t = sorted(l)
	for i in t:
		if j == 0:
			k = min(l[i])
			m = max(l[i])
			p.append(['R'] * i)
			p.append(['U'] * m)
			y = i
		else:
			k = min(l[i])
			if m <= k:
				d = max(l[i])
				p.append(['R'] * (i - y))
				p.append(['U'] * (d - m))
				m = d
				y = i
			else:
				g = 1
				break
		j += 1
	if g == 1:
		print('NO')
	else:
		print('YES')
		for i in p:
			for j in range(len(i)):
				print(i[j], end='')
		print()


from sys import stdin
t = int(stdin.readline())
while t:
	t -= 1
	n = int(stdin.readline())
	p = [[0, 0]]
	for _ in range(n):
		(x, y) = map(int, stdin.readline().split())
		p.append([x, y])
	p.sort()
	b = 0
	path = ''
	(x, y) = (0, 0)
	for i in range(1, n + 1):
		if p[i][1] < p[i - 1][1]:
			b = 1
			break
		else:
			r = p[i][0] - x
			u = p[i][1] - y
			path += 'R' * r + 'U' * u
			(x, y) = p[i]
	if b:
		print('NO')
	else:
		print('YES')
		print(path)


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	coor = []
	for i in range(n):
		(x, y) = map(int, input().split())
		coor.append([x, y])
	coor.sort(key=lambda x: (x[0], x[1]))
	turn = ''
	(x, y) = (0, 0)
	er = []
	for i in range(n):
		turn += 'R' * abs(coor[i][0] - x)
		x = coor[i][0]
		turn += 'U' * abs(coor[i][1] - y)
		y = coor[i][1]
	if len(turn) == coor[n - 1][0] + coor[n - 1][1]:
		ans.append(['YES', turn])
	else:
		ans.append(['NO'])
for i in range(len(ans)):
	print(*ans[i], sep='\n')


from sys import stdin, stdout
(readln, write) = (stdin.readline, stdout.write)

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

def get_p():
	(x, y) = map(int, readln().split())
	return Point(x, y)

def pos(p1, p2):
	return p1.x >= p2.x and p1.y >= p2.y
for t in range(int(input())):
	n = int(input())
	a = [get_p() for _ in range(n)]
	a.sort(key=lambda p: p.x + p.y)
	for i in range(1, n):
		if not pos(a[i], a[i - 1]):
			print('NO')
			break
	else:
		print('YES')
		write('R' * a[0].x)
		write('U' * a[0].y)
		for i in range(1, n):
			write('R' * (a[i].x - a[i - 1].x))
			write('U' * (a[i].y - a[i - 1].y))
		print()


t = int(input())
cou = []

def lab(x1, y1, x, y):
	return abs(x - x1) + abs(y1 - y)

def xadder(x0, y0, gv):
	x1 = a[2 * gv]
	y1 = a[2 * gv + 1]
	x1 = x1 - x0
	y1 = y1 - y0
	if x1 < 0 or y1 < 0:
		return 'NO'
	else:
		return 'R' * x1 + 'U' * y1
for i in range(t):
	n = int(input())
	ft = True
	a = []
	b = []
	ff = ''
	x1 = 0
	y1 = 0
	c = []
	for j in range(n):
		(x, y) = map(int, input().split())
		a.append(x)
		a.append(y)
		b.append(lab(x, y, x1, y1))
	for j in range(n):
		gj = min(b)
		gv = b.index(gj)
		if xadder(x1, y1, gv) == 'NO':
			cou.append('NO')
			ft = False
			break
		else:
			ff += xadder(x1, y1, gv)
		c.append(gv)
		x1 = a[2 * gv]
		y1 = a[2 * gv + 1]
		b = []
		for k in range(n):
			b.append(lab(x1, y1, a[2 * k], a[2 * k + 1]))
		for i in range(len(c)):
			b[c[i]] = 99999999
	if ft:
		cou.append('YES' + '\n' + ff)
for i in range(len(cou)):
	print(cou[i])


import sys
from collections import defaultdict
t = int(input())
for _ in range(t):
	n = int(sys.stdin.readline())
	(p_x, p_y) = (defaultdict(list), defaultdict(list))
	for (x, y) in (map(int, sys.stdin.readline().split()) for _ in range(n)):
		p_x[x].append(y)
		p_y[y].append(x)
	(px, py) = (0, 0)
	(x, y) = (0, 0)
	count = 0
	path = []
	visited = set()
	while x <= 1000 and y <= 1000:
		if not p_x[x] and (not p_y[y]):
			x += 1
			y += 1
			continue
		if p_x[x]:
			p_x[x].sort()
			for dy in p_x[x]:
				if y > dy or (x, dy) in visited:
					continue
				visited.add((x, dy))
				count += 1
				path += ['R'] * (x - px) + ['U'] * (dy - py)
				(px, py) = (x, dy)
				y = dy
			p_x[x].clear()
		if p_y[y]:
			p_y[y].sort()
			for dx in p_y[y]:
				if x > dx or (dx, y) in visited:
					continue
				visited.add((dx, y))
				count += 1
				path += ['R'] * (dx - px) + ['U'] * (y - py)
				(px, py) = (dx, y)
				x = dx
			p_y[y].clear()
	if n == count:
		print('YES')
		print(*path, sep='')
	else:
		print('NO')


for t in range(int(input())):
	adj = [[] for i in range(1001)]
	for z in range(int(input())):
		(x, y) = map(int, input().split())
		adj[x].append(y)
	(x, y) = (0, 0)
	s = ''
	ans = 'YES'
	for i in range(1001):
		adj[i].sort()
		if len(adj[i]) != 0:
			s += 'R' * (i - x)
			x = i
			for j in range(len(adj[i])):
				if adj[i][j] - y < 0:
					ans = 'NO'
					break
				else:
					s += 'U' * (adj[i][j] - y)
					y = adj[i][j]
		if ans == 'NO':
			break
	if ans == 'YES':
		print(ans)
		print(s)
	else:
		print(ans)


def sort(x, y):
	if x[0] < y[0]:
		return (x, y)
	if y[0] < x[0]:
		return (y, x)
	if x[0] == y[0]:
		if x[1] <= y[1]:
			return (x, y)
		if y[1] < x[1]:
			return (y, x)

def GetPath(n):
	package = [[0, 0]]
	for i in range(n):
		package.append([int(i) for i in input('').split(' ')])
	for i in range(0, n + 1):
		for j in range(i + 1, n + 1):
			(package[i], package[j]) = sort(package[i], package[j])
	path = ''
	for i in range(0, n):
		p = package[i]
		q = package[i + 1]
		if q[0] < p[0] or q[1] < p[1]:
			print('NO')
			return
		else:
			R = q[0] - p[0]
			U = q[1] - p[1]
			path += 'R' * R
			path += 'U' * U
	print('YES')
	print(path)
t = int(input(''))
for i in range(t):
	n = int(input(''))
	GetPath(n)


q = int(input())
for i in range(q):
	n = int(input())
	k = [[0, 0]]
	for j in range(n):
		k.append([int(i) for i in input().split()])
	k = sorted(k)
	l = ''
	for i in range(n):
		(x1, y1) = k[i]
		(x2, y2) = k[i + 1]
		if x2 >= x1:
			if y2 >= y1:
				l += 'R' * (x2 - x1)
				l += 'U' * (y2 - y1)
			else:
				print('NO')
				break
		else:
			print('NO')
			break
	else:
		print('YES')
		print(l)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(x, y) = map(int, input().split(' '))
		arr.append([x, y])
	arr = sorted(arr)
	s = ''
	xi = 0
	yi = 0
	flag = 0
	for i in arr:
		if i[0] - xi >= 0 and i[1] - yi >= 0:
			s1 = 'R' * (i[0] - xi) + 'U' * (i[1] - yi)
			s = s + s1
			xi = i[0]
			yi = i[1]
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
for _ in range(int(inp())):
	n = int(inp())
	ml = [(0, 0)]
	for i in range(n):
		(x, y) = mp()
		ml.append((x, y))
	ml.sort()
	t = True
	b = ''
	for i in range(n):
		if ml[i][1] > ml[i + 1][1]:
			t = False
			break
		else:
			b += 'R' * (ml[i + 1][0] - ml[i][0]) + 'U' * (ml[i + 1][1] - ml[i][1])
	if t:
		print('YES')
		print(b)
	else:
		print('NO')


def sortThird(val):
	return val[2]
for _ in range(int(input())):
	n = int(input())
	xy = list()
	robotCoords = [0, 0]
	moves = [0, 0]
	isImpossible = False
	path = str()
	for _ in range(n):
		(x, y) = list(map(int, input().split()))
		z = x + y
		xy.append([x, y, z])
	xy.sort(key=sortThird)
	for i in range(len(xy)):
		if xy[i][0] < robotCoords[0] or xy[i][1] < robotCoords[1]:
			isImpossible = True
		else:
			robotCoords[0] = xy[i][0]
			robotCoords[1] = xy[i][1]
			diffx = xy[i][0] - moves[0]
			diffy = xy[i][1] - moves[1]
			moves[0] += diffx
			moves[1] += diffy
			if diffx > 0:
				path += 'R' * diffx + 'U' * diffy
			else:
				path += 'U' * diffy + 'R' * diffx
	if isImpossible:
		print('NO')
		continue
	else:
		print('YES')
		print(path)


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
for _ in range(int(stdin.readline())):
	x = int(stdin.readline())
	out = []
	for i in range(x):
		(a, b) = map(int, stdin.readline().strip().split())
		out.append((a, b))
	out.sort()
	s = ''
	x = y = 0
	flag = True
	for i in out:
		if i[0] >= x and i[1] >= y:
			s += 'R' * (i[0] - x)
			s += 'U' * (i[1] - y)
			x = i[0]
			y = i[1]
		else:
			flag = False
			break
	if flag == True:
		print('YES')
		print(s)
	else:
		print('NO')


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

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

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

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	boxes = []
	for i in range(n):
		(x, y) = inputnums()
		p = (x, y)
		boxes.append(p)
	boxes.sort()
	rtn = ''
	curx = 0
	cury = 0
	good = True
	for i in range(n):
		(x, y) = boxes[i]
		if curx > x or cury > y:
			print('NO')
			good = False
			break
		while curx < x:
			curx += 1
			rtn += 'R'
		while cury < y:
			cury += 1
			rtn += 'U'
	if good:
		print('YES')
		print(rtn)


for _ in range(int(input())):
	n = int(input())
	point = []
	for i in range(n):
		(x, y) = map(int, input().split())
		point.append((x, y))
	sor = sorted(sorted(point, key=lambda x: x[0]), key=lambda x: x[1])
	(i, j) = (0, 0)
	out = ''
	broke = False
	for (x, y) in sor:
		if i > x or j > y:
			broke = True
			break
		if i < x:
			out += (x - i) * 'R'
			i = x
		if j < y:
			out += (y - j) * 'U'
			j = y
	if not broke:
		print('YES')
		print(out)
	else:
		print('NO')


import sys
from operator import itemgetter
t = int(sys.stdin.readline().rstrip())
for _ in range(t):
	n = int(sys.stdin.readline().rstrip())
	num = []
	for i in range(n):
		num.append(list(map(int, sys.stdin.readline().rstrip().split())))
	num.sort(key=itemgetter(0, 1))
	prev = [0, 0]
	res = 'YES'
	res2 = ''
	for i in range(0, n):
		if prev[1] > num[i][1]:
			res = 'NO'
			break
		res2 += 'R' * (num[i][0] - prev[0])
		res2 += 'U' * (num[i][1] - prev[1])
		prev = num[i]
	print(res)
	if res == 'YES':
		print(res2)


I = input
pr = print

def dist(x):
	return x[0] ** 2 + x[1] ** 2

def main():
	for _ in range(int(I())):
		ar = [[0, 0, 0]]
		s = []
		f = 0
		for _ in range(int(I())):
			c = list(map(int, I().split()))
			c.append(dist(c))
			ar.append(c)
		ar.sort(key=dist)
		for i in range(len(ar) - 1):
			if ar[i][2] == ar[i + 1][2] or ar[i + 1][0] < ar[i][0] or ar[i + 1][1] < ar[i][1]:
				pr('NO')
				f = 1
				break
			s.append('R' * (ar[i + 1][0] - ar[i][0]))
			s.append('U' * (ar[i + 1][1] - ar[i][1]))
		if not f:
			pr('YES', ''.join(s), sep='\n')
main()


def kek():
	n = int(input())
	a = []
	for i in range(n):
		a.append(list(reversed(list(map(int, input().split())))))
	a = sorted(a)
	(x, y) = (0, 0)
	ans = ''
	for i in range(len(a)):
		if a[i][1] - x >= 0:
			ans += (a[i][1] - x) * 'R'
			x = a[i][1]
		else:
			print('NO')
			return
		if a[i][0] - y >= 0:
			ans += (a[i][0] - y) * 'U'
			y = a[i][0]
		else:
			print('NO')
			return
	print('YES')
	print(ans)
t = int(input())
for i in range(t):
	kek()


for _ in range(int(input())):
	n = int(input())
	x = y = 0
	a = []
	for j in range(n):
		now = list(map(int, input().split()))
		a.append(now)
	a.sort()
	ok = 1
	ans = ''
	for i in a:
		(q, w) = i
		if w < y:
			ok = 0
			break
		while x < q:
			ans += 'R'
			x += 1
		while y < w:
			ans += 'U'
			y += 1
	if ok:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for j in range(n):
		x = list(map(int, input().split()))
		l.append(x)
	l.sort()
	x = l[0]
	x = x[1]
	a = 0
	for j in l:
		y = j[1]
		if y < x:
			print('NO')
			a = 1
			break
		x = y
	if a == 0:
		print('YES')
		x = l[0]
		a = x[0]
		b = x[1]
		for k in range(a):
			print('R', end='')
		for k in range(b):
			print('U', end='')
		for j in range(1, n):
			x = l[j]
			c = x[0]
			d = x[1]
			for k in range(c - a):
				print('R', end='')
			for k in range(d - b):
				print('U', end='')
			a = c
			b = d
		print()


t = int(input())
while t > 0:
	n = int(input())
	p = [(0, 0)]
	for i in range(n):
		(x, y) = map(int, input().split())
		pi = (x, y)
		p.append(pi)
	p.sort()
	r = 0
	for i in range(len(p) - 1):
		if p[i][0] < p[i + 1][0] and p[i][1] > p[i + 1][1]:
			r = 1
	if r:
		print('NO')
	else:
		st = ''
		for i in range(len(p) - 1):
			st += (p[i + 1][0] - p[i][0]) * 'R'
			st += (p[i + 1][1] - p[i][1]) * 'U'
		print('YES')
		print(st)
	t -= 1


from operator import lt, gt
points = []
sequence = []
error_code = 0

def compare(point_a, point_b):
	if point_a[0] > point_b[0]:
		return 0
	if point_a[0] == point_b[0]:
		if point_b[1] > point_b[1]:
			return 1
		else:
			return 0
	return 1

def __compare(string1, string2, less=True):
	op = lt if less else gt
	l = list(zip(string1, string2))
	l.reverse()
	for (char1, char2) in l:
		(ordinal1, ordinal2) = (ord(char1), ord(char2))
		if ordinal1 == ordinal2:
			continue
		elif op(ordinal1, ordinal2):
			return True
		else:
			return False
	return False

def closest(point_pr, point_x, point_y):
	global error_code
	dif_a = [point_pr[0] - point_x[0], point_pr[1] - point_x[1]]
	dif_b = [point_pr[0] - point_y[0], point_pr[1] - point_y[1]]
	if (dif_a[0] < 0 or dif_a[1] < 0) and (dif_b[0] < 0 or dif_b[1] < 0):
		error_code = 1
	if dif_a[0] < 0 or dif_a[1] < 0:
		return 1
	if dif_b[0] < 0 or dif_b[1] < 0:
		return 0
	if sum(dif_a) == sum(dif_b):
		string1 = ''.join([chr(point_x[0]), chr(point_x[1])])
		string2 = ''.join([chr(point_y[0]), chr(point_y[1])])
		return not __compare(string1, string2)
	return compare(dif_a, dif_b)

def prepare_points():
	global points
	points = sorted(points, key=lambda x: x[0] * 1000 + x[1])

def node(point):
	return closest(points[0], [point[0] + 1, point[1]], [point[0], point[1] + 1])
for i in range(int(input())):
	points = []
	for j in range(int(input())):
		points.append(list(map(lambda x: int(x), input().split(' '))))
	prepare_points()
	current = [0, 0]
	while len(points) > 0:
		if node(current) == 0:
			current = [current[0] + 1, current[1]]
			sequence.append('R')
		else:
			current = [current[0], current[1] + 1]
			sequence.append('U')
		if error_code == 1:
			break
		if current == points[0]:
			del points[0]
	if error_code == 1:
		print('NO')
		error_code = 0
	else:
		print('YES')
		print(''.join(sequence))
	sequence = []


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	it = [list(map(int, input().split())) for i in range(n)]
	st = 1
	for i in range(n):
		for j in range(n):
			if it[i][0] < it[j][0] and it[i][1] > it[j][1]:
				st = 0
	if st == 0:
		print('NO')
	else:
		it.sort()
		x = 0
		y = 0
		print('YES')
		for i in range(n):
			if it[i][0] == x:
				print('U' * (it[i][1] - y), end='')
				y = it[i][1]
			elif it[i][1] == y:
				print('R' * (it[i][0] - x), end='')
				x = it[i][0]
			else:
				print('R' * (it[i][0] - x), end='')
				print('U' * (it[i][1] - y), end='')
				(x, y) = it[i]
		print()


t = int(input())
for q in range(t):
	n = int(input())
	main_lst = []
	for q2 in range(n):
		(x, y) = map(int, input().split())
		main_lst.append([y, x])
	main_lst.sort()
	lst = []
	last = [-1, []]
	for x in main_lst:
		if x[0] != last[0]:
			lst.append(last)
			last = [x[0], [x[1]]]
		else:
			last[1].append(x[1])
	lst.append(last)
	del lst[0]
	pred = 0
	answer = ''
	(x, y) = (0, 0)
	er = 0
	for xd in range(len(lst)):
		if er == 1:
			break
		if lst[xd][1][0] < pred:
			er = 1
			break
		else:
			answer += 'R' * (lst[xd][1][0] - x)
			x = lst[xd][1][0]
			pred = x
		answer += 'U' * (lst[xd][0] - y)
		y = lst[xd][0]
		for xdd in lst[xd][1][1:]:
			if pred > xdd:
				er = 1
				break
			else:
				answer += 'R' * (xdd - x)
				x = xdd
				pred = x
	if er == 0:
		print('YES')
		print(answer)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	l = [list(map(int, input().split())) for i in range(n)]
	l.sort()
	x = 0
	y = 0
	s = ''
	f = 1
	for i in range(n):
		a = l[i]
		if x <= a[0] and y <= a[1]:
			while x < a[0]:
				s += 'R'
				x += 1
			while y < a[1]:
				s += 'U'
				y += 1
		else:
			f = 0
			break
	if f == 1:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for a in range(t):
	n = int(input())
	Y = []
	Z = []
	for b in range(n):
		(x, y) = map(int, input().split())
		Y.append([x, y])
	Y.sort(key=lambda x: x[0])
	current = Y[0][0]
	tmp = [Y[0]]
	for i in range(1, n):
		if current != Y[i][0]:
			tmp.sort(key=lambda a: a[1])
			Z.extend(tmp)
			tmp = []
			tmp.append(Y[i])
			current = Y[i][0]
		else:
			tmp.append(Y[i])
	tmp.sort()
	Z.extend(tmp)
	p = True
	path = 'R' * Z[0][0]
	path += 'U' * Z[0][1]
	for j in range(1, n):
		if Z[j][1] < Z[j - 1][1]:
			p = False
			break
		else:
			path = path + 'R' * (Z[j][0] - Z[j - 1][0])
			path = path + 'U' * (Z[j][1] - Z[j - 1][1])
	if not p:
		print('NO')
	else:
		print('YES')
		print(path)


def func():
	t = int(input().strip())
	cases = []
	for _ in range(t):
		n = int(input().strip())
		coordinates = []
		for _ in range(n):
			(x, y) = map(int, input().strip().split())
			coordinates.append([x, y])
		cases.append([coordinates, n])
	for case in cases:
		res = shortest_path(case[0], case[1])
		if res == 'NO':
			print(res)
		else:
			print('YES')
			print(res)

def shortest_path(coordinates, n):
	coordinates_sorted = sorted(coordinates, key=lambda k: (k[0], k[1]))
	res = 'R' * coordinates_sorted[0][0] + 'U' * coordinates_sorted[0][1]
	for i in range(1, n):
		x = coordinates_sorted[i][0] - coordinates_sorted[i - 1][0]
		y = coordinates_sorted[i][1] - coordinates_sorted[i - 1][1]
		if y < 0:
			return 'NO'
		res = res + 'R' * x + 'U' * y
	return res
func()


from operator import itemgetter, attrgetter
for i in range(0, int(input())):
	l = []
	for j in range(0, int(input())):
		l.append(list(map(int, input().split())))
	l.sort(key=itemgetter(0, 1))
	check = 1
	for i in range(0, len(l) - 1):
		if l[i][0] > l[i + 1][0] or l[i][1] > l[i + 1][1]:
			check = 0
	if check != 0:
		(a, b) = (0, 0)
		st = ''
		for k in l:
			Xdiff = k[0] - a
			Ydiff = k[1] - b
			a = k[0]
			b = k[1]
			st = st + 'R' * Xdiff + 'U' * Ydiff
		print('YES')
		print(st)
	else:
		print('NO')


def do():
	n = int(input())
	node = []
	for i in range(n):
		tem = input().split()
		(x, y) = (int(tem[0]), int(tem[1]))
		node.append([x, y])
	arrn = sorted(node)
	juno = 0
	for i in range(len(arrn)):
		if arrn[i][1] >= juno:
			juno = arrn[i][1]
		else:
			print('NO')
			return
	print('YES')
	ans = ''
	(cur_x, cur_y) = (0, 0)
	for i in range(len(arrn)):
		for _ in range(arrn[i][0] - cur_x):
			ans = ans + 'R'
		for _ in range(arrn[i][1] - cur_y):
			ans = ans + 'U'
		cur_x = arrn[i][0]
		cur_y = arrn[i][1]
	print(ans)
N = int(input())
for _ in range(N):
	do()


t = int(input())
for _ in range(t):
	n = int(input())
	coords = [[0, 0]]
	for _ in range(n):
		c = [int(i) for i in input().split()]
		coords.append(c)
	coords.sort()
	ans = 'YES'
	path = ''
	for i in range(1, n + 1):
		if coords[i][1] < coords[i - 1][1]:
			ans = 'NO'
		dx = coords[i][0] - coords[i - 1][0]
		path += 'R' * dx
		dy = coords[i][1] - coords[i - 1][1]
		path += 'U' * dy
	print(ans)
	if ans == 'YES':
		print(path)


def solve(n, arr):
	arr.sort()
	(pa, pb) = (0, 0)
	ans = ''
	for (i, [a, b]) in enumerate(arr):
		if pb > b:
			print('NO')
			return
		ans += (a - pa) * 'R' + (b - pb) * 'U'
		(pa, pb) = (a, b)
	print('YES')
	print(ans)

def main():
	tc = int(input())
	for _ in range(tc):
		n = int(input())
		arr = []
		for __ in range(n):
			(a, b) = [int(x) for x in input().split()]
			arr.append([a, b])
		solve(n, arr)
main()


from sys import stdin, stdout
fin = lambda : stdin.readline()
fout = lambda *args: stdout.write(' '.join((str(i) for i in args)) + '\n')
for _ in range(int(input())):
	n = int(fin())
	l = [[int(x) for x in fin().split()] for _ in range(n)]
	x = [0, 0]
	l.sort(key=sum)
	res = ''
	for i in l:
		if i[0] < x[0] or i[1] < x[1]:
			res += 'x'
		res += ''.join(('R' for _ in range(i[0] - x[0])))
		res += ''.join(('U' for _ in range(i[1] - x[1])))
		x = i
	fout('NO' if 'x' in res else 'YES\n' + res)


for _ in range(int(input())):
	n = int(input())
	nlist = []
	for __ in range(n):
		nlist.append(list(map(int, input().split())))
	nlist = sorted(nlist)
	sol = []
	flag = 0
	for ___ in range(nlist[0][0]):
		sol.append('R')
	for ____ in range(nlist[0][1]):
		sol.append('U')
	for ___ in range(1, len(nlist)):
		if nlist[___][0] - nlist[___ - 1][0] >= 0:
			for ____ in range(nlist[___][0] - nlist[___ - 1][0]):
				sol.append('R')
		else:
			flag = 1
			break
		if nlist[___][1] - nlist[___ - 1][1] >= 0:
			for _____ in range(nlist[___][1] - nlist[___ - 1][1]):
				sol.append('U')
		else:
			flag = 1
			break
	if flag == 0:
		print('YES')
		print(*sol, sep='')
	else:
		print('NO')


def collectOne(n, coordinate):
	coordinate.sort(key=lambda x: x[1])
	coordinate.sort(key=lambda x: x[0])
	for i in range(len(coordinate) - 1):
		if coordinate[i][1] > coordinate[i + 1][1]:
			return 'NO'
	path = list()
	coordinate.insert(0, [0, 0])
	for i in range(len(coordinate) - 1):
		path.append('R' * (coordinate[i + 1][0] - coordinate[i][0]))
		path.append('U' * (coordinate[i + 1][1] - coordinate[i][1]))
	return 'YES\n' + ''.join(path)

def main():
	t = int(input())
	outcome = list()
	for i in range(t):
		n = int(input())
		coordinate = [list(map(int, input().split())) for _ in range(n)]
		outcome.append(collectOne(n, coordinate))
	print('\n'.join(outcome))
main()


kl = int(input())
for l in range(kl):
	n = int(input())
	x = [0 for i in range(n + 2)]
	y = [0 for i in range(n + 2)]
	r = [0 for i in range(n + 2)]
	(x[n + 1], y[n + 1], r[n + 1]) = (1001, 1001, 1001 * 1001 + 1001 * 1001)
	s = [0, n + 1]
	pr = 0
	for i in range(1, n + 1):
		(x[i], y[i]) = [int(i) for i in input().split()]
		if pr:
			continue
		r[i] = x[i] ** 2 + y[i] ** 2
		for j in range(1, len(s)):
			if r[i] < r[s[j]]:
				if x[s[j - 1]] <= x[i] <= x[s[j]] and y[s[j - 1]] <= y[i] <= y[s[j]]:
					s.insert(j, i)
				else:
					pr = 1
				break
	if pr:
		print('NO')
	else:
		print('YES')
		for i in range(1, n + 1):
			for ii in range(x[s[i]] - x[s[i - 1]]):
				print('R', end='')
			for ii in range(y[s[i]] - y[s[i - 1]]):
				print('U', end='')
		print()


for _ in range(int(input())):
	a = []
	ans = []
	x = 0
	y = 0
	t = int(input())
	for i in range(t):
		a.append([*map(int, input().split())])
	a = sorted(a)
	for i in range(t):
		x1 = a[i][0]
		y1 = a[i][1]
		if x1 >= x:
			temp = 'R' * (x1 - x)
			ans.append(temp)
			x = x1
			if y1 >= y:
				temp = 'U' * (y1 - y)
				ans.append(temp)
				y = y1
			else:
				ans = []
				break
		else:
			ans = []
			break
	if ans:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	nodes = [[] for _ in range(1001)]
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		nodes[x].append(y)
	found_count = 0
	curr = 0
	early_break = False
	rv = []
	for i in range(len(nodes)):
		nodes[i].sort()
		for j in range(len(nodes[i])):
			found_count += 1
			if curr > nodes[i][j]:
				print('NO')
				early_break = True
				break
			for k in range(nodes[i][j] - curr):
				rv.append('U')
			curr = nodes[i][j]
		if early_break:
			break
		if found_count == n:
			break
		rv.append('R')
	if early_break:
		continue
	print('YES')
	print(''.join(rv))


import sys
from bisect import bisect_left as bl, bisect_right as br, bisect
import math
from timeit import default_timer as dt
from itertools import zip_longest as zl
from itertools import groupby as gb
from itertools import combinations as comb
from itertools import combinations_with_replacement as cwr
from collections import defaultdict as dd
from collections import deque as dq
from collections import Counter as c
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return input()

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [[val for i in range(n)] for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	mat = list()
	for i in range(n):
		mat.append(l())
	mat = sorted(mat, key=lambda x: x[1])
	mat = sorted(mat, key=lambda x: x[0])
	(x, y) = (0, 0)
	result = True
	ans = list()
	for i in range(len(mat)):
		if mat[i][1] - y < 0 or mat[i][0] - x < 0:
			result = False
			break
		else:
			ans += ['R'] * (mat[i][0] - x)
			ans += ['U'] * (mat[i][1] - y)
			(x, y) = (mat[i][0], mat[i][1])
	if result:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


t = int(input())
while t > 0:
	n = int(input())
	pkgs = [(0, 0)]
	for i in range(n):
		(x, y) = map(int, input().split())
		pkgs.append((x, y))
	pkgs.sort()
	has_path = True
	route = ''
	for i in range(1, len(pkgs)):
		cur = pkgs[i]
		pre = pkgs[i - 1]
		has_path = has_path and cur[0] >= pre[0] and (cur[1] >= pre[1])
		if has_path:
			if cur[0] == pre[0]:
				route += 'U' * abs(cur[1] - pre[1])
			elif cur[1] == pre[1]:
				route += 'R' * abs(cur[0] - pre[0])
			else:
				route += 'R' * abs(cur[0] - pre[0])
				route += 'U' * abs(cur[1] - pre[1])
	if has_path:
		print('YES')
		print(route)
	else:
		print('NO')
	t = t - 1


t = int(input())
for _ in range(t):
	n = int(input())
	coord = []
	for i in range(n):
		coord.append(list(map(int, input().split())))
	coord.sort()
	ansy = 'YES'
	ans = ''
	c = (0, 0)
	for i in range(len(coord)):
		if coord[i][0] - c[0] < 0 or coord[i][1] - c[1] < 0:
			ansy = 'NO'
			break
		else:
			ans += 'R' * (coord[i][0] - c[0]) + 'U' * (coord[i][1] - c[1])
			c = coord[i]
	if ansy == 'YES':
		print(ansy)
		print(ans)
	else:
		print(ansy)


import sys
from collections import defaultdict as dc
import math
from bisect import bisect, bisect_left, bisect_right
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		l.append(list(map(int, input().split())))
	l.sort(key=lambda x: (x[0], x[1]))
	l.insert(0, [0, 0])
	s = []
	f = 1
	for i in range(1, n + 1):
		p = l[i][0] - l[i - 1][0]
		q = l[i][1] - l[i - 1][1]
		if p < 0 or q < 0:
			f = 0
			break
		s += ['R'] * p + ['U'] * q
	if f:
		print('YES')
		print(''.join(s))
	else:
		print('NO')


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7
spf = [i for i in range(MAXN)]
spf[0] = spf[1] = -1

def sieve():
	for i in range(2, MAXN, 2):
		spf[i] = 2
	for i in range(3, int(MAXN ** 0.5) + 1):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def fib(n, m):
	if n == 0:
		return [0, 1]
	else:
		(a, b) = fib(n // 2)
		c = a % m * (b % m * 2 - a % m) % m
		d = a % m * (a % m) % m + b % m * b % m % m
		if n % 2 == 0:
			return [c, d]
		else:
			return [d, c + d]

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()
for _ in range(int(input())):
	n = int(input())
	a = [arrIN() for i in range(n)]
	a.sort(key=lambda x: x[1])
	a.sort(key=lambda x: x[0])
	s = ''
	cx = cy = 0
	for i in range(n):
		(x, y) = a[i]
		if x == cx:
			s += 'U' * (y - cy)
			cy = y
		elif y < cy:
			print('NO')
			break
		else:
			s += 'R' * (x - cx)
			cx = x
			s += 'U' * (y - cy)
			cy = y
	else:
		print('YES')
		print(s)


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())

def pr_list(a):
	print(*a, sep=' ')

def main():
	tests = inp()
	for test in range(tests):
		n = inp()
		package = []
		for i in range(n):
			[a, b] = inlt()
			package.append([a, b])
		package.sort()
		out = ''
		curr_x = 0
		curr_y = 0
		flag = 1
		i = 0
		while i < len(package):
			[x, y] = package[i]
			step = 'R' * (x - curr_x)
			out = out + step
			curr_x = x
			if y < curr_y:
				flag = 0
				break
			else:
				while i < len(package) and curr_x == package[i][0]:
					[x, y] = package[i]
					step = 'U' * (y - curr_y)
					out = out + step
					curr_y = y
					i = i + 1
		if flag == 0:
			print('NO')
		else:
			print('YES')
			print(out)
	return
main()


t = int(input())
for i in range(t):
	n = int(input())
	cord = []
	for j in range(n):
		(x, y) = map(int, input().split())
		cord.append((x, y))
	cord.sort()
	flag = 1
	for j in range(len(cord) - 1):
		if cord[j + 1][1] < cord[j][1]:
			flag = 0
			break
	if flag:
		print('YES')
		x = 0
		y = 0
		for item in cord:
			print('R' * (item[0] - x), end='')
			print('U' * (item[1] - y), end='')
			x = item[0]
			y = item[1]
		print('')
	else:
		print('NO')


def solve(mat, n):
	ans = 'R' * mat[0][0] + 'U' * mat[0][1]
	for i in range(1, len(mat)):
		p = mat[i][0] - mat[i - 1][0]
		q = mat[i][1] - mat[i - 1][1]
		if p < 0 or q < 0:
			return -1
		else:
			ans += 'R' * p + 'U' * q
	return ans
for _ in range(int(input())):
	n = int(input())
	mat = []
	for i in range(n):
		a = list(map(int, input().split()))
		mat.append(a)
	mat.sort()
	p = solve(mat, n)
	if p == -1:
		print('NO')
	else:
		print('YES')
		print(p)


t = int(input())
v = 1
b = ''
va_a_decir = []

def mayor(elem):
	return int(elem.split(' ')[0]) + int(elem.split(' ')[1])
while v <= t:
	b = ''
	robotito = [0, 0]
	ord = []
	estado = 'idle'
	c = int(input())
	for i in range(0, c):
		a = input()
		ord.append(a)
	ord.sort(key=mayor)
	for i in range(0, len(ord)):
		if robotito[0] > int(ord[i].split(' ')[0]) or robotito[1] > int(ord[i].split(' ')[1]) < 0:
			estado = 'NO'
		if estado != 'NO':
			while robotito[0] < int(ord[i].split(' ')[0]):
				robotito[0] += 1
				b += 'R'
			while robotito[1] < int(ord[i].split(' ')[1]):
				robotito[1] += 1
				b += 'U'
		if robotito[0] > int(ord[i].split(' ')[0]) or robotito[1] > int(ord[i].split(' ')[1]):
			b = ''
			estado = 'NO'
	if estado != 'NO':
		va_a_decir.append('YES')
		va_a_decir.append(b)
	if estado == 'NO':
		va_a_decir.append('NO')
	estado = 'idle'
	robotito = [0, 0]
	v += 1
for i in range(0, len(va_a_decir)):
	print(va_a_decir[i])


for i in range(int(input())):
	q = int(input())
	x = []
	z = ''
	w = 0
	for j in range(q):
		y = list(map(int, input().split()))
		x.append(y)
	x.sort()
	for _ in range(q - 1):
		e = x[_ + 1][0] - x[_][0]
		f = x[_ + 1][1] - x[_][1]
		if e < 0 or f < 0:
			w = w + 1
	if w > 0:
		print('NO')
	else:
		z = '' + 'R' * x[0][0] + 'U' * x[0][1]
		for k in range(1, q):
			(a, b) = (x[k][0] - x[k - 1][0], x[k][1] - x[k - 1][1])
			z = z + a * 'R' + b * 'U'
		print('YES')
		print(z)


for _ in range(int(input())):
	n = int(input())
	coord = []
	for i in range(n):
		(a, b) = map(int, input().split())
		coord.append([a, b])
	coord.sort()
	flag = True
	ycoord = [y[1] for y in coord]
	if list(sorted(ycoord)) == ycoord:
		flag = True
	else:
		flag = False
	if flag:
		st = ''
		(x, y) = (0, 0)
		for i in range(0, len(coord)):
			st += (coord[i][0] - x) * 'R' + (coord[i][1] - y) * 'U'
			(x, y) = (coord[i][0], coord[i][1])
		print('YES')
		print(st)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = [[] for i in range(1001)]
	for j in range(n):
		(x, y) = map(int, input().strip().split(' '))
		a[x].append(y)
	b = []
	for j in range(1001):
		a[j].sort()
		if len(a[j]) != 0:
			for k in a[j]:
				b.append((j, k))
	b.insert(0, (0, 0))
	s = ''
	flag = 0
	for j in range(1, n + 1):
		if b[j][0] - b[j - 1][0] < 0 or b[j][1] - b[j - 1][1] < 0:
			flag = 1
			break
		else:
			k = b[j][0] - b[j - 1][0]
			s += 'R' * k
			k = b[j][1] - b[j - 1][1]
			s += 'U' * k
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


from sys import stdin

def solve():
	for _ in range(int(stdin.readline())):
		d = {}
		res = ''
		l = []
		flag = 0
		n = int(stdin.readline())
		for i in range(n):
			(x, y) = map(int, stdin.readline().split())
			d.setdefault(x, [])
			d[x].append(y)
			l.append(x)
		for i in d:
			d[i].sort()
		l = list(set(l))
		l.sort()
		(prev1, prev2) = (0, 0)
		for i in l:
			if flag == 1:
				break
			res += 'R' * (i - prev1)
			prev1 = i
			for j in d[i]:
				if j - prev2 < 0:
					flag = 1
					break
				else:
					res += 'U' * (j - prev2)
					prev2 = j
		if flag == 1:
			print('NO')
		else:
			print('YES')
			print(res)
solve()


for _ in range(int(input())):
	n = int(input())
	l = []
	s = ''
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append((a, b))
	l.sort()
	l = sorted(l, key=lambda x: x[1])
	p = l[0]
	s += 'R' * p[0]
	s += 'U' * p[1]
	for i in range(n - 1):
		(p, q) = (l[i], l[i + 1])
		(c, d, e, f) = (p[0], p[1], q[0], q[1])
		s += 'R' * (e - c)
		s += 'U' * (f - d)
	h = l[-1]
	if h[0] + h[1] == len(s):
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	l = [[0, 0]]
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort()
	s = []
	f = 0
	for i in range(len(l) - 1):
		if l[i + 1][0] - l[i][0] < 0 or l[i + 1][1] - l[i][1] < 0:
			f = 1
			break
		else:
			a = l[i + 1][0] - l[i][0]
			b = l[i + 1][1] - l[i][1]
			s += a * 'R'
			s += b * 'U'
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(''.join(s))


import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input = sys.stdin.readline
from random import randint
mo = 10 ** 9 + 7

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
for _ in range(inin()):
	n = inin()
	l = []
	s = ''
	f = 0
	for i in range(n):
		(a, b) = cin()
		l += [[a, b]]
	l.sort()
	prevx = prevy = 0
	for i in l:
		if i[1] - prevy < 0:
			f = 1
			break
		s += 'R' * (i[0] - prevx) + 'U' * (i[1] - prevy)
		prevx = i[0]
		prevy = i[1]
	if f:
		print('NO')
	else:
		print('YES')
		print(s)


import sys
input = sys.stdin.readline
from math import *
t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = []
	for i in range(n):
		p = [int(x) for x in input().split()]
		a.append(p)
	a.sort()
	r = 0
	u = 0
	flag = 0
	s = ''
	for i in range(n):
		if a[i][1] < u or a[i][0] < r:
			flag = 1
			break
		else:
			for j in range(r, a[i][0]):
				s += 'R'
			r = a[i][0]
			for j in range(u, a[i][1]):
				s += 'U'
			u = a[i][1]
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	cords = []
	for i in range(n):
		(a, b) = map(int, input().split())
		cords.append([a, b])
	cords = sorted(cords, key=lambda t: t[0])
	cords = sorted(cords, key=lambda t: t[1])
	prevx = 0
	prevy = 0
	ans = ''
	flag = False
	for (a, b) in cords:
		if a < prevx:
			flag = True
			break
		xcord = a - prevx
		ycord = b - prevy
		ans += xcord * 'R' + ycord * 'U'
		prevx = a
		prevy = b
	if flag:
		print('NO')
	else:
		print('YES')
		print(ans)


tc = int(input())
for _ in range(tc):
	n = int(input())
	boxes = []
	brk = 0
	for p in range(n):
		(x, y) = list(map(int, input().split()))
		boxes.append((x, y))
	boxes.sort(key=lambda x: (x[0], x[1]))
	ans = ''
	(crnt_x, crnt_y) = (0, 0)
	for box in boxes:
		if box[0] >= crnt_x and box[1] >= crnt_y:
			right = box[0] - crnt_x
			add = 'R' * right
			ans += add
			top = box[1] - crnt_y
			add = 'U' * top
			ans += add
			crnt_x = box[0]
			crnt_y = box[1]
		else:
			print('NO')
			brk = 1
			break
	if brk == 0:
		print('YES')
		print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append((a, b))
	l.sort()
	s = ''
	f = 1
	for i in range(len(l)):
		if i == 0:
			p = l[i][0]
			q = l[i][1]
			s += 'R' * p
			s += 'U' * q
		elif l[i][1] >= l[i - 1][1]:
			p = l[i][0] - l[i - 1][0]
			q = l[i][1] - l[i - 1][1]
			s += 'R' * p
			s += 'U' * q
		else:
			f = 0
			break
	if f == 0:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	lst = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		lst.append((x, y))
	lst.sort()
	(cx, cy) = (0, 0)
	path = []
	ispos = True
	for ind in lst:
		if ind[0] < cx or ind[1] < cy:
			ispos = False
			break
		path.append(ind[0] - cx)
		path.append(ind[1] - cy)
		(cx, cy) = ind
	if not ispos:
		print('NO')
	else:
		print('YES')
		for i in range(len(path)):
			if i % 2 == 0:
				print('R' * path[i], end='')
			else:
				print('U' * path[i], end='')
		print()


def get():
	n = int(input())
	c = [(0, 0)]
	for i in range(n):
		c.append(tuple(map(int, input().split())))
	c.sort()
	way = ''
	for i in range(n):
		if c[i + 1][0] - c[i][0] < 0 or c[i + 1][1] - c[i][1] < 0:
			return 'NO'
		else:
			way += (c[i + 1][0] - c[i][0]) * 'R' + (c[i + 1][1] - c[i][1]) * 'U'
	return 'YES\n' + way
for _ in range(int(input())):
	print(get())


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a = [x, y]
		l.append(a)
	l.sort()
	q = sorted(l, key=lambda x: x[1])
	ans = ''
	(curx, cury, flag) = (0, 0, 1)
	for i in range(len(q)):
		if q[i][0] < curx:
			flag = 0
			break
		te = q[i][0] - curx
		ans += 'R' * te
		curx = q[i][0]
		if q[i][1] < cury:
			flag = 0
			break
		te = q[i][1] - cury
		ans += 'U' * te
		cury = q[i][1]
	if flag:
		print('YES')
		print(ans)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	nums = []
	for _ in range(n):
		arr = list(map(int, input().split()))
		nums.append(arr)
	s = sorted(nums, key=lambda k: [k[1], k[0]])
	ans = ''
	found = 1
	prevx = 0
	prevy = 0
	for i in s:
		diff_x = i[0] - prevx
		diff_y = i[1] - prevy
		prevx = i[0]
		prevy = i[1]
		if diff_y < 0 or diff_x < 0:
			found = 0
			break
		ans += diff_x * 'R'
		ans += diff_y * 'U'
	if found:
		print('YES')
		print(ans)
	else:
		print('NO')


import sys, itertools, math
T = int(sys.stdin.readline())
for _ in range(T):
	n = int(sys.stdin.readline())
	P = []
	for _ in range(n):
		(x, y) = [int(i) for i in sys.stdin.readline().strip().split(' ')]
		P.append((x, y))
	P = sorted(P)
	s = ''
	x = 0
	y = 0
	for (px, py) in P:
		if py < y:
			print('NO')
			break
		s += ''.join(['R'] * (px - x))
		s += ''.join(['U'] * (py - y))
		x = px
		y = py
	else:
		print('YES')
		print(s)


def sort_new(l):
	for i in range(len(l)):
		for j in range(len(l) - i - 1):
			if l[j][0] > l[j + 1][0]:
				(l[j], l[j + 1]) = (l[j + 1], l[j])
			elif l[j + 1][0] == l[j][0] and l[j + 1] < l[j]:
				(l[j + 1], l[j]) = (l[j], l[j + 1])
t = int(input())
for k in range(t):
	n = int(input())
	a = []
	flag = 0
	for u in range(n):
		temp = list(map(int, input().split()))
		a.append(temp)
	sort_new(a)
	count = 0
	curr = [0, 0]
	x = []
	for i in range(len(a)):
		if a[i][0] - curr[0] >= 0 and a[i][1] - curr[1] >= 0:
			count += a[i][0] - curr[0]
			x.append('R' * (a[i][0] - curr[0]))
			count += a[i][1] - curr[1]
			x.append('U' * (a[i][1] - curr[1]))
			curr[0] = a[i][0]
			curr[1] = a[i][1]
		else:
			flag = 1
			print('NO')
			break
	if not flag:
		print('YES')
		print(''.join(x))


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append([a, b])
	l.sort(key=lambda x: (x[0], x[1]))
	f = 0
	for i in range(1, len(l)):
		if l[i][1] < l[i - 1][1]:
			f = 1
			break
	if f:
		print('NO')
	else:
		print('YES')
		ans = 'R' * l[0][0] + 'U' * l[0][1]
		for i in range(1, len(l)):
			r = l[i][0] - l[i - 1][0]
			u = l[i][1] - l[i - 1][1]
			ans += 'R' * r + 'U' * u
		print(ans)


for _ in range(int(input())):
	l1 = []
	z = 0
	l1.append([0, 0])
	for _ in range(int(input())):
		x1 = list(map(int, input().split()))
		l1.append(x1)
	l2 = sorted(l1, key=lambda x: (x[0], x[1]))
	x = 0
	y = 0
	l = []
	for i in l2:
		a1 = i[0] - x
		b1 = i[1] - y
		x = i[0]
		y = i[1]
		if a1 >= 0 and b1 >= 0:
			l.append('R' * a1)
			l.append('U' * b1)
		else:
			z = -1
	if z == 0:
		print('YES')
		print(''.join(l))
	else:
		print('NO')


t = int(input())
while t > 0:
	n = int(input())
	a = []
	while n > 0:
		s = input().split(' ')
		b = []
		b.append(int(s[0]))
		b.append(int(s[1]))
		a.append(b)
		n = n - 1
	a.sort()
	f = ''
	rr = 1
	x = y = 0
	for i in range(len(a)):
		p = a[i][0]
		q = a[i][1]
		m = p - x
		n = q - y
		if m < 0 or n < 0:
			rr = 0
			break
		for i in range(m):
			f = f + 'R'
		for i in range(n):
			f = f + 'U'
		x = p
		y = q
	if rr == 0:
		print('NO')
	else:
		print('YES')
		print(f)
	t = t - 1


T = int(input())
for _ in range(T):
	N = int(input())
	XY = list(range(N + 1))
	XY[0] = [0, 0]
	S = ''
	F = 1
	for I in range(1, N + 1):
		XY[I] = list(map(int, input().split()))
	XY.sort()
	for I in range(1, N + 1):
		DX = XY[I][0] - XY[I - 1][0]
		DY = XY[I][1] - XY[I - 1][1]
		if DX >= 0 and DY >= 0:
			S += 'R' * DX + 'U' * DY
		else:
			F = 0
	if F == 1:
		print('YES')
		print(S)
	else:
		print('NO')


for t in range(int(input())):
	n = int(input())
	parcels = []
	for i in range(n):
		parcels.append([int(i) for i in input().split()])
	parcels.sort(key=lambda x: x)
	answer = ''
	f = True
	(x0, y0) = (0, 0)
	for (x, y) in parcels:
		if y - y0 < 0:
			print('NO')
			f = False
			break
		else:
			answer += 'R' * (x - x0)
			answer += 'U' * (y - y0)
		(x0, y0) = (x, y)
	if f:
		print('YES')
		print(answer)


for _ in range(int(input())):
	n = int(input())
	a = sorted([tuple(map(int, input().split())) for _ in range(n)])
	curX = curY = 0
	ret = []
	for (x, y) in a:
		(dx, dy) = (x - curX, y - curY)
		if min(dx, dy) < 0:
			print('NO')
			break
		ret.append('R' * dx + 'U' * dy)
		(curX, curY) = (x, y)
	else:
		print('YES\n%s' % ''.join(ret))


def solve(packages):
	packages.insert(0, (0, 0))
	packages.sort(key=lambda p: p[0] + p[1])
	dp = [None for i in range(len(packages))]
	for (p, (x, y)) in reversed(list(enumerate(packages))):
		children = []
		for (q, (x2, y2)) in reversed(list(enumerate(packages))):
			(dx, dy) = (x2 - x, y2 - y)
			if dx >= 0 and dy >= 0 and (q != p):
				children.append(q)
		dp[p] = 0 if not children else 1 + max([dp[q] for q in children])
	if dp[0] == len(packages) - 1:
		(p, (x, y), res) = (0, (0, 0), '')
		while True:
			(next_p, next_x, next_y) = (None, None, None)
			(max_val, max_dx, min_dy) = (float('-inf'), float('-inf'), float('inf'))
			for (q, (x2, y2)) in enumerate(packages):
				(dx, dy) = (x2 - x, y2 - y)
				if dx >= 0 and dy >= 0 and (q != p):
					if dp[q] >= max_val:
						if dx == max_dx and dy < min_dy:
							(next_p, next_x, next_y) = (q, x2, y2)
							(max_val, max_dx, min_dy) = (dp[q], dx, dy)
						elif dx > max_dx:
							(next_p, next_x, next_y) = (q, x2, y2)
							(max_val, max_dx, min_dy) = (dp[q], dx, dy)
			if next_p == None:
				break
			(p, x, y) = (next_p, next_x, next_y)
			res += 'R' * max_dx + 'U' * min_dy
		return res
for t in range(int(input())):
	(n, packages) = (int(input()), [])
	for i in range(n):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	res = solve(packages)
	print(f'YES\n{res}' if res != None else 'NO')


for _ in range(int(input())):
	n = int(input())
	xaxis = []
	yaxis = []
	boxes = []
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		boxes.append((x, y))
		xaxis.append(x)
		yaxis.append(y)
	xaxis.sort()
	yaxis.sort()
	path = ''
	res = True
	pos = (0, 0)
	another = []
	for i in range(n):
		if (xaxis[i], yaxis[i]) in boxes and (xaxis[i], yaxis[i]) not in another:
			path += 'R' * (xaxis[i] - pos[0]) + 'U' * (yaxis[i] - pos[1])
			pos = (xaxis[i], yaxis[i])
			another.append(pos)
		else:
			res = False
			break
	if res:
		print('YES')
		print(path)
	else:
		print('NO')


mod = 10 ** 9 + 7
import math
from collections import Counter
from itertools import combinations
import math

def ain():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	l = []
	for _ in range(n):
		(a, b) = ain()
		l.append([a, b])
	l.sort()
	minr = l[0][1]
	pos = True
	d = l[0][0] * 'R' + l[0][1] * 'U'
	for i in range(1, n):
		d += (l[i][0] - l[i - 1][0]) * 'R'
		if l[i][1] >= l[i - 1][1]:
			d += (l[i][1] - l[i - 1][1]) * 'U'
		else:
			print('NO')
			pos = False
			break
	if pos:
		print('YES')
		print(d)


from collections import namedtuple

def PATH(p1, p2):
	(x1, y1) = p1
	(x2, y2) = p2
	x_dis = x2 - x1
	y_dis = y2 - y1
	return x_dis * 'R' + y_dis * 'U'
for _ in range(int(input())):
	n = int(input())
	cooardinates = {}
	for i in range(n):
		(x, y) = list(map(int, input().split()))
		if cooardinates.get(x, 0) == 0:
			cooardinates[x] = [y, y]
		elif cooardinates[x][0] > y:
			cooardinates[x][0] = y
		elif cooardinates[x][1] < y:
			cooardinates[x][1] = y
	cooardinates = sorted(cooardinates.items())
	result = ''
	isPossible = True
	prev = (0, 0)
	for (x, y) in cooardinates:
		(_min, _max) = y
		(_xmin, _ymax) = prev
		if _min < _ymax:
			isPossible = False
			break
		result += PATH(prev, (x, _min)) + PATH((x, _min), (x, _max))
		prev = (x, _max)
	if isPossible:
		print('YES')
		print(result)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	pak = []
	for _ in range(n):
		(a, b) = map(int, input().split())
		pak.append((a, b))
	pak.sort(key=lambda x: (x[0], x[1]))
	(x, y) = (0, 0)
	ans = []
	for i in range(n):
		if pak[i][1] < y:
			print('NO')
			break
		ans += ['R'] * (pak[i][0] - x)
		ans += ['U'] * (pak[i][1] - y)
		x = pak[i][0]
		y = pak[i][1]
	else:
		print('YES')
		print(''.join(ans))


for _ in range(int(input())):
	n = int(input())
	l = []
	l.append([0, 0])
	for i in range(n):
		temp = list(map(int, input().split()))
		l.append(temp)
	l.sort(key=lambda x: [x[0], x[1]])
	fin = ''
	for i in range(len(l) - 1):
		flag = 0
		a = l[i + 1][0] - l[i][0]
		b = l[i + 1][1] - l[i][1]
		if a >= 0 and b >= 0:
			fin = fin + 'R' * a + 'U' * b
			flag = 1
		else:
			flag = 0
			break
	if flag:
		print('YES')
		print(fin)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	p = int(input())
	packages = []
	for _ in range(p):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	packages.sort()
	x_i = 0
	y_i = 0
	ans = ''
	flag = True
	for p in packages:
		x_p = p[0]
		y_p = p[1]
		d_x = x_p - x_i
		d_y = y_p - y_i
		if d_x < 0 or d_y < 0:
			print('NO')
			flag = False
			break
		else:
			ans += d_x * 'R'
			ans += d_y * 'U'
		x_i = x_p
		y_i = y_p
	if flag:
		print('YES')
		print(ans)


t = int(input())
for o in range(0, t):
	d = []
	n = int(input())
	for j in range(0, n):
		(a, b) = map(int, input().split(' '))
		d.append([a, b])
	d.sort(key=lambda x: x[1])
	d.sort(key=lambda x: x[0])
	x = 0
	y = 0
	p = ''
	gg = 'YES'
	for i in range(0, n):
		if x <= d[i][0] and y <= d[i][1]:
			p += 'R' * (d[i][0] - x)
			p += 'U' * (d[i][1] - y)
			x = d[i][0]
			y = d[i][1]
		else:
			gg = 'NO'
			break
	if gg == 'YES':
		print(gg)
		print(p)
	else:
		print(gg)


t = int(input())
for _ in range(t):
	n = int(input())
	a = []
	for i in range(n):
		(b, c) = map(int, input().split())
		a.append((b, c))
	a.sort()
	x = 0
	y = 0
	ans = 'YES'
	ur = ''
	for i in range(n):
		r = a[i][0] - x
		u = a[i][1] - y
		if r < 0 or u < 0:
			ans = 'NO'
			break
		ur += r * 'R' + u * 'U'
		x = a[i][0]
		y = a[i][1]
	print(ans)
	if ans == 'YES':
		print(ur)


for _ in range(int(input())):
	set_a = {}
	string = ''
	for i in range(int(input())):
		(x, y) = map(int, input().split())
		if x not in set_a:
			set_a[x] = [y]
		else:
			set_a[x].append(y)
	maxx = -1
	done = 0
	prev_i = 0
	prev_y = 0
	for i in sorted(set_a.keys()):
		if maxx > min(set_a[i]):
			print('NO')
			done = 1
			break
		for j in range(i - prev_i):
			string += 'R'
		for j in range(max(set_a[i]) - prev_y):
			string += 'U'
		maxx = max(maxx, max(set_a[i]))
		prev_i = i
		prev_y = max(set_a[i])
	if not done:
		print('YES')
		print(string)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
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())
		xy = [[0, 0]]
		for j in range(n):
			temp = list(map(int, input().split()))
			xy.append(temp)
		sxy = sorted(xy, key=lambda x: (x[0], x[1]))
		ans = ''
		flag = True
		for k in range(1, n + 1):
			if sxy[k][0] > sxy[k - 1][0] and sxy[k][1] < sxy[k - 1][1]:
				flag = False
				break
			m = sxy[k][0] - sxy[k - 1][0]
			n = sxy[k][1] - sxy[k - 1][1]
			if m > 0:
				ans += 'R' * m
			if n > 0:
				ans += 'U' * n
		if flag == False:
			print('NO')
		else:
			print('YES')
			print(ans)
main()


def count(str1, str2):
	i = 0
	while i < len(str1) and i < len(str2) and (str1[i] == str2[i]):
		i = i + 1
	return i * i
t = int(input())
for abc in range(t):
	n = int(input())
	c = [[0 for i in range(2)] for i in range(n)]
	for i in range(n):
		(c[i][0], c[i][1]) = [int(x) for x in input().split()]
	c.sort()
	flag = 0
	for i in range(1, len(c)):
		if c[i][1] >= c[i - 1][1]:
			continue
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		x = 0
		y = 0
		print('YES')
		for i in range(len(c)):
			(print('R' * (c[i][0] - x), end=''),)
			(print('U' * (c[i][1] - y), end=''),)
			x = c[i][0]
			y = c[i][1]
		print()


t = int(input())
for _ in range(t):
	q = int(input())
	p = [list(map(int, input().split())) for i in range(q)]
	po = sorted(p)
	(x, y) = (0, 0)
	s = ''
	ip = True
	for j in po:
		if x > j[0] and y <= j[1] or (x <= j[0] and y > j[1]):
			ip = False
			break
		elif x <= j[0] and y <= j[1]:
			d = j[0] - x
			s += 'R' * d
			x += d
			d = j[1] - y
			s += 'U' * d
			y += d
	if ip:
		print('YES', end='\n')
		print(s)
	else:
		print('NO')


import sys
import math
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	l = list()
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append([x, y])
	l.sort()
	s = list()
	x = 0
	y = 0
	flag = 0
	for i in range(n):
		curr1 = l[i][0] - x
		curr2 = l[i][1] - y
		if curr1 < 0 or curr2 < 0:
			flag = 1
			break
		for j in range(curr1):
			s.append('R')
		for j in range(curr2):
			s.append('U')
		x = l[i][0]
		y = l[i][1]
	if flag:
		print('NO')
	else:
		print('YES')
		for i in range(len(s)):
			print(s[i], end='')
		print()


t = int(input())
for _ in range(t):
	n = int(input())
	l = [(0, 0)]
	for _ in range(n):
		(x, y) = [int(i) for i in input().split(' ')]
		l.append((x, y))
	l.sort()
	flag = True
	for i in range(n):
		c_0 = l[i]
		c_1 = l[i + 1]
		if c_0[1] > c_1[1]:
			flag = False
			break
	if flag:
		res = []
		for i in range(n):
			c0 = l[i]
			c1 = l[i + 1]
			for _ in range(c1[0] - c0[0]):
				res.append('R')
			for _ in range(c1[1] - c0[1]):
				res.append('U')
		res = ''.join(res)
		print('YES')
		print(res)
	else:
		print('NO')


def solve():
	n = int(input())
	dots = [list(map(int, input().split())) for i in range(n)]
	dots.sort()
	for i in range(n - 1):
		if dots[i][1] > dots[i + 1][1]:
			print('NO')
			return
	x = 0
	y = 0
	ans = ''
	for i in dots:
		while x < i[0]:
			ans += 'R'
			x += 1
		while y < i[1]:
			ans += 'U'
			y += 1
	print('YES')
	print(ans)
t = int(input())
for jjj in range(t):
	solve()


t = int(input())
for i in range(t):
	n = int(input())
	d = dict()
	for j in range(n):
		(a, b) = map(int, input().strip().split())
		if a in d.keys():
			d[a].append(b)
		else:
			d[a] = []
			d[a].append(b)
	l = list(d.keys())
	l.sort()
	y = 0
	z = 0
	flag = 0
	s = ''
	for j in l:
		v = d[j]
		v.sort()
		s += 'R' * (j - y)
		w = v[0] - z
		if w >= 0:
			u = v[-1] - z
			s += 'U' * u
		else:
			flag = 1
			print('NO')
			break
		z = v[-1]
		y = j
	if flag == 0:
		print('YES')
		print(s)


import os
import sys
from io import BytesIO, IOBase
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')
for i in range(int(input())):
	n = int(input())
	pack = [(0, 0)]
	ans = ''
	for j in range(n):
		tup = tuple(map(int, input().split()))
		pack.append(tup)
	pack.sort()
	flag = 1
	for j in range(1, len(pack)):
		stpx = pack[j][0] - pack[j - 1][0]
		stpy = pack[j][1] - pack[j - 1][1]
		if stpx < 0 or stpy < 0:
			print('NO')
			flag = 0
			break
		else:
			ans += 'R' * stpx
			ans += 'U' * stpy
	if len(ans) != 0 and flag == 1:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	l = []
	flag = True
	for i in range(n):
		(a, b) = map(int, input().split())
		l.append((a, b))
	l.sort()
	s = ''
	s += 'R' * (l[0][0] - 0)
	s += 'U' * (l[0][1] - 0)
	for i in range(0, n - 1):
		if l[i + 1][0] < l[i][0] or l[i + 1][1] < l[i][1]:
			flag = False
			break
		else:
			s += 'R' * (l[i + 1][0] - l[i][0])
			s += 'U' * (l[i + 1][1] - l[i][1])
	if flag == True:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	for _ in range(n):
		pos = tuple(map(int, input().split()))
		arr.append(pos)
	arr.sort()
	path = ''
	possible = True
	cur_x = 0
	cur_y = 0
	for i in range(n):
		while cur_x != arr[i][0]:
			if arr[i][0] < cur_x:
				possible = False
				break
			cur_x += 1
			path += 'R'
		while cur_y != arr[i][1]:
			if arr[i][1] < cur_y:
				possible = False
				break
			cur_y += 1
			path += 'U'
	if possible:
		print('YES')
		print(path)
	else:
		print('NO')


for tc in range(int(input())):
	n = int(input())
	a = [[0, 0]]
	for i in range(n):
		a.append(list(map(int, input().split())))
	a.sort()
	flag = 1
	for i in range(len(a) - 1):
		if a[i][0] <= a[i + 1][0] and a[i][1] <= a[i + 1][1]:
			flag = 1
		else:
			flag = 0
			break
	if not flag:
		print('NO')
	else:
		print('YES')
		for i in range(len(a) - 1):
			print('R' * abs(a[i][0] - a[i + 1][0]) + 'U' * abs(a[i][1] - a[i + 1][1]), end='')
		print(end='\n')


t = int(input())
for i in range(t):
	l = []
	s = ''
	n = int(input())
	for j in range(n):
		l.append(tuple(map(int, input().split())))
	m = l.sort()
	X = 0
	Y = 0
	counter = 1
	for (x, y) in l:
		if X > x:
			counter = 0
			break
		else:
			s += 'R' * (x - X)
			X = x
		if Y > y:
			counter = 0
			break
		else:
			s += 'U' * (y - Y)
			Y = y
	if counter:
		print('YES')
		print(s)
	else:
		print('NO')


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append([x, y])
	a.sort()
	ans = 0
	for i in range(1, n):
		if a[i][1] < a[i - 1][1]:
			ans = -1
			break
	if ans == -1:
		print('NO')
		continue
	else:
		print('YES')
		s = ''
		x = 0
		y = 0
		for i in range(n):
			for j in range(a[i][0] - x):
				s = s + 'R'
				x = a[i][0]
			for j in range(a[i][1] - y):
				s = s + 'U'
				y = a[i][1]
		print(s)


def main():
	t = int(input())
	for __ in range(t):
		n = int(input())
		pack = []
		while n != 0:
			(a, b) = map(int, input().split())
			pack.append((a, b))
			n -= 1
		pack.sort(key=lambda x: x[1])
		pack.sort(key=lambda x: x[0])
		init = (0, 0)
		flag = True
		path = []
		for i in pack:
			if init[0] <= i[0] and init[1] <= i[1]:
				r = 'R' * (i[0] - init[0])
				u = 'U' * (i[1] - init[1])
				init = i
				path.append(r)
				path.append(u)
			else:
				flag = False
				break
		if flag:
			print('YES')
			print(''.join(path))
		else:
			print('NO')
main()


import copy
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	coords = []
	for j in range(n):
		(a, b) = [int(z) for z in input().split()]
		coords.append((a, b))
	sortt = copy.deepcopy(coords)
	sortt.sort()
	maxX = sortt[len(sortt) - 1][0]
	ys = []
	for i in range(maxX):
		ys.append([])
	packs = 0
	xx = 0
	yy = 0
	curr = 0
	string = ''
	imp = False
	while n > 0:
		if xx < sortt[curr][0]:
			xx += 1
			string += 'R'
		elif xx == sortt[curr][0]:
			if sortt[curr][1] < yy:
				ans.append('NO')
				break
			yy += 1
			string += 'U'
		else:
			ans.append('NO')
			imp = True
			break
		if xx == sortt[curr][0] and yy == sortt[curr][1]:
			n -= 1
			curr += 1
			if n == 0:
				ans.append('YES\n' + string)
				break
	if imp:
		ans.append('NO')
for x in ans:
	print(x)


for _ in range(int(input())):
	r = []
	n = int(input())
	for i in range(n):
		r.append(list(map(int, input().split())))
		r = sorted(r, key=lambda x: x[1])
		r = sorted(r)
	re = ''
	(a, b) = (0, 0)
	f = 0
	for i in range(n):
		(a1, b1) = r[i]
		if a1 >= a and b1 >= b:
			re += 'R' * (a1 - a) + 'U' * (b1 - b)
			a = a1
			b = b1
		else:
			print('NO')
			f = 1
			break
	if f == 0:
		print('YES')
		print(re)


t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for j in range(n):
		(a, b) = map(int, input().split())
		l.append((b, a))
	l = sorted(l)
	res = True
	for j in range(len(l) - 1):
		if l[j][1] > l[j + 1][1]:
			res = False
			break
	if res:
		print('YES')
		s = ''
		prev = (0, 0)
		for el in l:
			s += 'R' * (el[1] - prev[1])
			s += 'U' * (el[0] - prev[0])
			prev = el
		print(s)
	else:
		print('NO')


t = int(input())
while t:
	t -= 1
	n = int(input())
	packs = []
	while n:
		(a, b) = map(int, input().split())
		packs.append((a, b))
		n -= 1
	packs = sorted(packs)
	prev = (0, 0)
	route = ''
	np = 0
	for p in packs:
		if p[0] - prev[0] >= 0 and p[1] - prev[1] >= 0:
			route += 'R' * (p[0] - prev[0])
			route += 'U' * (p[1] - prev[1])
		else:
			np = 1
			break
		prev = p
	if np == 1:
		print('NO')
	else:
		print('YES')
		print(route)


for _ in range(int(input())):
	arr = []
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		arr.append((a, b))
	arr = sorted(arr)
	konstantinta = 0
	flag = True
	for i in arr:
		if i[1] < konstantinta:
			flag = False
		else:
			konstantinta = i[1]
	if not flag:
		print('NO')
	else:
		print('YES')
		ans = ''
		x = 0
		y = 0
		for i in arr:
			ans = ans + (i[0] - x) * 'R' + (i[1] - y) * 'U'
			x = i[0]
			y = i[1]
		print(ans)


t = int(input())
import operator
for i in range(t):
	l = []
	n = int(input())
	for i in range(n):
		(x, y) = map(int, input().split())
		l.append((x, y))
	l = sorted(l, key=operator.itemgetter(0, 1))
	ans = ''
	flag = 0
	for i in range(len(l)):
		if i == 0:
			ans = ans + (l[i][0] - 0) * 'R' + (l[i][1] - 0) * 'U'
		else:
			if l[i][0] < l[i - 1][0] or l[i][1] < l[i - 1][1]:
				flag = 1
				break
			ans = ans + (l[i][0] - l[i - 1][0]) * 'R' + (l[i][1] - l[i - 1][1]) * 'U'
	if flag == 1:
		print('NO')
		continue
	else:
		print('YES')
		print(ans)


def ii():
	a = int(input())
	return a

def ai():
	a = list(map(int, input().split()))
	return a

def mi():
	a = map(int, input().split())
	return a
for _ in range(ii()):
	n = ii()
	gifts = [[0, 0]]
	for i in range(n):
		co = ai()
		gifts.append(co)
	gifts.sort()
	i = 1
	chek = True
	last_y = gifts[0][1]
	last_x = gifts[0][0]
	while i < n + 1:
		cur_x = gifts[i][0]
		cur_y = gifts[i][1]
		if last_y > cur_y or last_x > cur_x:
			print('NO')
			chek = False
			break
		last_y = cur_y
		last_x = cur_x
		i += 1
	if chek:
		i = 0
		ans = ''
		while i < n:
			x = gifts[i + 1][0]
			y = gifts[i + 1][1]
			diff_x = x - gifts[i][0]
			diff_y = y - gifts[i][1]
			ans += 'R' * diff_x
			ans += 'U' * diff_y
			i += 1
		print('YES')
		print(ans)


t = int(input())
for i in range(0, t):
	stri = ''
	n = int(input())
	points = []
	for j in range(0, n):
		line = list(map(int, input().split()))
		points.append(line)
	points.sort()
	x = 0
	y = 0
	flag = 0
	for k in points:
		cx = k[0]
		cy = k[1]
		if cx < x or cy < y:
			flag = 1
			break
		else:
			while x < cx:
				x = x + 1
				stri = stri + 'R'
			while y < cy:
				y = y + 1
				stri = stri + 'U'
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(stri)


t = int(input())
while t > 0:
	isPossible = 'YES'
	n = int(input())
	pos = [0, 0]
	i = 0
	boxArray = []
	path = ''
	while n > 0:
		box = input().split(' ')
		box[0] = int(box[0])
		box[1] = int(box[1])
		boxArray.append(box)
		n -= 1
	boxArray.sort()
	while i < len(boxArray):
		if pos[0] > boxArray[i][0] or pos[1] > boxArray[i][1]:
			isPossible = 'NO'
			break
		if pos[0] < boxArray[i][0]:
			while pos[0] < boxArray[i][0]:
				pos[0] += 1
				path += 'R'
		if pos[1] < boxArray[i][1]:
			while pos[1] < boxArray[i][1]:
				pos[1] += 1
				path += 'U'
		i += 1
	print(isPossible)
	if isPossible == 'YES':
		print(path)
	t -= 1


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

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

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
for _ in range(ii()):
	n = ii()
	d = [[0, 0]]
	for _ in range(n):
		d.append(list(mi()))
	d.sort()
	res = []
	f = 1
	for i in range(1, n + 1):
		if d[i - 1][1] > d[i][1]:
			f = 0
			print('NO')
			break
		else:
			res.append('R' * (d[i][0] - d[i - 1][0]))
			res.append('U' * (d[i][1] - d[i - 1][1]))
	if f:
		print('YES')
		prr(res, '')


m = int(input())
for i in range(m):
	parcels = int(input())
	list_of_parcels = [(0, 0)]
	for j in range(parcels):
		list_of_parcels.append(tuple(map(int, input().split())))
	sorted_parcels = sorted(list_of_parcels, key=lambda el: (el[0], el[1]))
	current_position = (0, 0)
	flag = True
	path = []
	for k in range(len(sorted_parcels) - 1):
		if sorted_parcels[k][0] > sorted_parcels[k + 1][0]:
			flag = False
			break
		else:
			path.append('R' * (sorted_parcels[k + 1][0] - sorted_parcels[k][0]))
		if sorted_parcels[k][1] > sorted_parcels[k + 1][1]:
			flag = False
			break
		else:
			path.append('U' * (sorted_parcels[k + 1][1] - sorted_parcels[k][1]))
	if not flag:
		print('NO')
	else:
		print('YES')
		print(''.join(path))


t = int(input())
for tt in range(t):
	n = int(input())
	p = [tuple(map(int, input().split())) for i in range(n)]
	p.sort()
	ans = 'YES'
	for i in range(n - 1):
		if p[i + 1][1] < p[i][1]:
			ans = 'NO'
			break
	print(ans)
	if ans == 'YES':
		s = 'R' * p[0][0] + 'U' * p[0][1]
		for i in range(1, n):
			rs = p[i][0] - p[i - 1][0]
			us = p[i][1] - p[i - 1][1]
			s += 'R' * rs + 'U' * us
		print(s)


t = int(input())
for k in range(t):
	n = int(input())
	s = []
	for j in range(n):
		(a, b) = map(int, input().split())
		s.append([a, b])
	s.sort()
	i = 0
	j = 0
	st = ''
	bul = True
	for el in s:
		if el[0] < i or el[1] < j:
			print('NO')
			bul = False
			break
		else:
			while i < el[0]:
				i += 1
				st += 'R'
			while j < el[1]:
				j += 1
				st += 'U'
	if bul:
		print('YES')
		print(st)


t = int(input())
for _ in range(t):
	n = int(input())
	list1 = []
	for j in range(n):
		list1.append(list(map(int, input().split())))
	list1 = sorted(list1)
	str = ''
	befy = 0
	befx = 0
	sam = 0
	for ele in list1:
		if ele[1] >= befy:
			for k in range(abs(befx - ele[0])):
				str += 'R'
			for k in range(abs(befy - ele[1])):
				str += 'U'
		else:
			print('NO')
			sam = 1
			break
		befx = ele[0]
		befy = ele[1]
	if sam == 1:
		continue
	else:
		print('YES')
		print(str)


from collections import deque
t = int(input())
while t:
	n = int(input())
	c = [[-1] * 2 for x in range(n)]
	for x in range(n):
		c[x] = list(map(int, input().split()))
	c = sorted(c, key=lambda x: x[1])
	c = sorted(c, key=lambda x: x[0])
	l = deque()
	flag = 0
	prev_row = prev_column = 0
	for x in range(n):
		if c[x][0] >= prev_column:
			if c[x][1] < prev_row:
				flag = 1
				break
			for y in range(prev_column, c[x][0]):
				l.append('R')
			for y in range(prev_row, c[x][1]):
				l.append('U')
			prev_column = c[x][0]
			prev_row = c[x][1]
		elif c[x][0] < prev_column:
			flag = 1
			break
	if flag:
		print('NO')
	else:
		print('YES')
		for x in range(len(l)):
			print(l[x], end='')
		print()
	t -= 1


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 s[:len(s) - 1]

def invr():
	return map(int, input().split())
t = 1
t = inp()
for tt in range(t):
	n = inp()
	a = []
	for i in range(n):
		(x, y) = invr()
		a.append([x, y])
	a.sort()
	q = 0
	w = 0
	qw = ''
	for i in range(len(a)):
		if a[i][0] < q or a[i][1] < w:
			print('NO')
			break
		qw = qw + ''.join(['R'] * (a[i][0] - q) + ['U'] * (a[i][1] - w))
		q = a[i][0]
		w = a[i][1]
	else:
		print('YES')
		print(qw)


q = int(input())
for _ in range(q):
	n = int(input())
	l = []
	for _ in range(n):
		t = list(map(int, input().split()))
		l.append(t)
	l.sort()
	c = 0
	s = ''
	l.insert(0, [0, 0])
	for i in range(n):
		if l[i][1] > l[i + 1][1]:
			print('NO')
			c = -1
			break
		else:
			x = l[i + 1][0] - l[i][0]
			y = l[i + 1][1] - l[i][1]
			s += 'R' * x + 'U' * y
	if c == 0:
		print('YES')
		print(s)


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		(x, y) = map(int, input().split())
		a.append((x, y))
	a.sort()
	(x, y) = (0, 0)
	flag = True
	ans = ''
	seen = set()
	for i in a:
		countr = i[0] - x
		countu = i[1] - y
		if countr < 0 or countu < 0:
			flag = False
			break
		ans = ans.ljust(countr + len(ans), 'R')
		ans = ans.ljust(countu + len(ans), 'U')
		(x, y) = (i[0], i[1])
		seen.add(i)
	if len(a) != len(seen) or flag == False:
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	packages = []
	for __ in range(int(input())):
		packages.append(list(map(int, input().split())))
	packages.sort()
	cur_pos = [0, 0]
	possible = True
	res = ''
	for i in packages:
		if i[0] - cur_pos[0] < 0 or i[1] - cur_pos[1] < 0:
			possible = False
			break
		res += 'R' * (i[0] - cur_pos[0])
		res += 'U' * (i[1] - cur_pos[1])
		cur_pos = i
	if possible:
		print('YES')
		print(res)
	else:
		print('NO')


import sys
import math

def main():
	for _ in range(int(sys.stdin.readline())):
		l = []
		n = int(sys.stdin.readline())
		for i in range(n):
			(a, b) = [int(x) for x in sys.stdin.readline().split()]
			l.append([a, b])
		l.sort(key=lambda x: x[0])
		l.sort(key=lambda x: x[1])
		flag = 0
		for i in range(n - 1):
			if l[i][0] > l[i + 1][0]:
				flag = 1
		if flag == 1:
			print('NO')
		else:
			x = 0
			y = 0
			ans = ''
			while len(l) != 0:
				k = l.pop(0)
				while x != k[0]:
					ans = ans + 'R'
					x += 1
				while y != k[1]:
					ans = ans + 'U'
					y += 1
			print('YES')
			print(ans)
main()


import math
import os

def get_array():
	return list(map(int, input().split(' ')))
t = int(input())
for i in range(t):
	n = int(input())
	d = []
	for i in range(n):
		d.append(get_array())
	d = sorted(d, key=lambda x: x[0] * 1000 + x[1])
	t = ''
	cur = [0, 0]
	prev = [0, 0]
	f = False
	for p in d:
		if p[1] < cur[1]:
			print('NO')
			f = True
			break
		t += (p[0] - cur[0]) * 'R'
		t += (p[1] - cur[1]) * 'U'
		cur = p
	if not f:
		print('YES')
		print(t)


n = int(input())
for i in range(n):
	a = int(input())
	l = [[]] * a
	for j in range(a):
		l[j] = [int(num) for num in input().split()]
	l.sort()
	b = True
	for k in range(1, a):
		if l[k][1] < l[k - 1][1]:
			b = False
			print('NO')
			break
	if b:
		print('YES')
		t = [0, 0]
		for k in range(a):
			x = l[k][0] - t[0]
			y = l[k][1] - t[1]
			t = l[k]
			print(x * 'R' + y * 'U', end='')
		print('')


for i in range(int(input())):
	n = int(input())
	l = [(0, 0)]
	for j in range(n):
		(a, b) = map(int, input().split())
		l.append((a, b))
	l.sort()
	s = ''
	a = 0
	for p in range(n):
		if l[p + 1][0] - l[p][0] >= 0 and l[p + 1][1] - l[p][1] >= 0:
			s += 'R' * (l[p + 1][0] - l[p][0])
			s += 'U' * (l[p + 1][1] - l[p][1])
		else:
			a += 1
			break
	if a == 0:
		print('YES')
		print(s)
	else:
		print('NO')


t = int(input())
for tt in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		(a, b) = map(int, input().split())
		arr.append([a, b])
	arr = sorted(arr)
	x = 0
	y = 0
	ans = ''
	flag = False
	for i in range(len(arr)):
		while x < arr[i][0]:
			x += 1
			ans += 'R'
		while y < arr[i][1]:
			y += 1
			ans += 'U'
		if x != arr[i][0] or y != arr[i][1]:
			flag = True
			break
		x = arr[i][0]
		y = arr[i][1]
	if flag:
		print('NO')
	else:
		print('YES')
		print(ans)


for _ in range(int(input())):
	n = int(input())
	points = []
	for i in range(n):
		(a, b) = [int(i) for i in input().split(' ')]
		points.append((a, b))
	points.sort()
	(a, b) = (0, 0)
	string = ''
	flag = False
	for (x, y) in points:
		if x - a < 0 or y - b < 0:
			flag = True
			break
		string = string + 'R' * (x - a) + 'U' * (y - b)
		(a, b) = (x, y)
	if flag == False:
		print('YES')
		print(string)
	else:
		print('NO')


tests = int(input())
for te in range(tests):
	n = int(input())
	lista = []
	for i in range(n):
		arr = list(map(int, input().split()))
		lista.append(arr)
	lista.append([0, 0])
	lista.sort()
	str = ''
	prev_x = 0
	prev_y = 0
	flag = 0
	for i in range(1, n + 1):
		(x, y) = lista[i]
		if y < prev_y:
			flag = 1
			break
		else:
			str = str + 'R' * (x - prev_x) + 'U' * (y - prev_y)
		prev_x = x
		prev_y = y
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(str)


for _ in range(int(input())):
	n = int(input())
	s = sorted([tuple(map(int, input().split())) for i in range(n)], key=lambda x: x[0] + x[1])
	ans = 'R' * s[0][0] + 'U' * s[0][1]
	for i in range(1, n):
		x = s[i][0] - s[i - 1][0]
		y = s[i][1] - s[i - 1][1]
		if x >= 0 and y >= 0:
			ans += x * 'R' + y * 'U'
		else:
			print('NO')
			break
	else:
		print('YES\n' + ans)


import math
import sys

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

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

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	n = inp()
	a = []
	for i in range(n):
		a.append(inlist())
	a = sorted(a, key=lambda d: d[0] + d[1])
	res = ''
	cx = cy = 0
	f = 1
	for i in range(n):
		r = a[i][0] - cx
		u = a[i][1] - cy
		if r < 0 or u < 0:
			f = 0
			break
		res += r * 'R' + u * 'U'
		cx = a[i][0]
		cy = a[i][1]
	if f:
		print('YES')
		print(res)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(0, n):
		(x, y) = input().split()
		x = int(x)
		y = int(y)
		l.append([x, y])
	l.sort()
	s = ''
	u = 0
	r = 0
	f = 0
	for i in range(0, n):
		if l[i][0] < r or l[i][1] < u:
			f = 1
			break
		else:
			s += (l[i][0] - r) * 'R'
			s += (l[i][1] - u) * 'U'
			u = l[i][1]
			r = l[i][0]
	if f == 1:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
while t != 0:
	n = int(input())
	list1 = list()
	for i in range(n):
		(a, b) = map(int, input().split())
		list1.append([a, b])
	list1.sort(key=lambda x: x[0])
	i = 0
	strin = ''
	maximum = 0
	f1 = 0
	initial_i = 0
	initial_j = 0
	while i < len(list1):
		p = list1[i][0]
		temp = list()
		while i < len(list1) and p == list1[i][0]:
			temp.append(list1[i])
			i += 1
		temp.sort(key=lambda x: x[1])
		if temp[0][1] < maximum:
			print('NO')
			f1 = 1
			break
		else:
			maximum = temp[-1][1]
			for j in range(len(temp)):
				pp = temp[j][0] - initial_i
				qq = temp[j][1] - initial_j
				initial_i = temp[j][0]
				initial_j = temp[j][1]
				for k in range(pp):
					strin += 'R'
				for k in range(qq):
					strin += 'U'
	if f1 == 0:
		print('YES')
		print(strin)
	t -= 1


class Node:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __lt__(self, other):
		if self.x == other.x:
			return self.y < other.y
		else:
			return self.x < other.x

def getAns(x1, y1, x2, y2, ans):
	for i in range(x2 - x1):
		ans[0] += 'R'
	for i in range(y2 - y1):
		ans[0] += 'U'
T = int(input())
for _ in range(T):
	n = int(input())
	a = [Node(0, 0)]
	ans = ['']
	for i in range(n):
		(tx, ty) = map(int, input().split())
		a.append(Node(tx, ty))
	a.sort()
	nowx = a[0].x
	nowy = a[0].y
	can = True
	for i in range(1, len(a)):
		if a[i].y < nowy:
			can = False
			break
		else:
			getAns(nowx, nowy, a[i].x, a[i].y, ans)
			nowx = a[i].x
			nowy = a[i].y
	if can == False:
		print('NO')
	else:
		print('YES')
		print(ans[0])


t = int(input())
for ti in range(t):
	n = int(input())
	l = list()
	d = dict()
	for i in range(n):
		(a, b) = [int(x) for x in input().split()]
		l.append([a, b])
		if a + b in d:
			d[a + b] += 1
		else:
			d[a + b] = 1
	l.sort()
	if d[max(d, key=d.get)] > 1:
		print('NO')
	else:
		a = 'YES'
		(prvr, prvu) = (0, 0)
		s = ''
		for i in l:
			s += 'R' * (i[0] - prvr) + 'U' * (i[1] - prvu)
			if i[0] - prvr < 0 or i[1] - prvu < 0:
				a = 'NO'
				break
			(prvr, prvu) = (i[0], i[1])
		if a == 'NO':
			print(a)
		else:
			print(a)
			print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	d = {}
	flag = 0
	ans = ''
	curx = 0
	cury = 0
	for _ in range(n):
		(x, y) = map(int, input().split())
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	for x in sorted(d):
		if flag:
			break
		if x > curx:
			ans += 'R' * (x - curx)
			curx = x
		for y in sorted(d[x]):
			if y < cury:
				flag = 1
				break
			else:
				ans += 'U' * (y - cury)
				cury = y
	if flag:
		print('NO')
	else:
		print('YES')
		print(ans)


def main():

	def solve():
		n = int(input())
		pkg = []
		for _ in range(n):
			pkg.append(list(map(int, input().split())))
		pkg.sort()
		path = []
		(cx, cy) = (0, 0)
		for (x, y) in pkg:
			if y < cy:
				print('NO')
				return
			path += ['R'] * (x - cx) + ['U'] * (y - cy)
			(cx, cy) = (x, y)
		print('YES')
		print(''.join(path))
	q = int(input())
	for _ in range(q):
		solve()
main()


t = int(input())
for k in range(t):
	have = dict()
	x = 0
	y = 0
	ans = []
	n = int(input())
	mx = 0
	was = True
	for i in range(n):
		(a, b) = map(int, input().split())
		if a not in have:
			have[a] = []
		have[a].append(b)
		mx = max(a, mx)
	cnt = 0
	for i in range(mx + 1):
		if i != 0:
			ans.append('R')
		if i not in have:
			continue
		bf = sorted(have[i])
		if bf[0] < y:
			was = False
		while y < bf[-1]:
			y += 1
			ans.append('U')
	if was:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


t = int(input())
output = []
for _ in range(t):
	n = int(input())
	list_val = [[0, 0]]
	for _ in range(n):
		x_y = list(map(int, input().split()))
		list_val.append(x_y)
	list_val.sort()
	ini_x = list_val[0][0]
	ini_y = list_val[0][1]
	fin_list = []
	for val in list_val:
		if val[0] < ini_x or val[1] < ini_y:
			flag = 0
			break
		else:
			flag = 1
			if val[1] == ini_y:
				diif_val = val[0] - ini_x
				for _ in range(diif_val):
					fin_list.append('R')
				ini_x = val[0]
			elif val[0] == ini_x:
				diif_val = val[1] - ini_y
				for _ in range(diif_val):
					fin_list.append('U')
				ini_y = val[1]
			else:
				diif_val_x = val[0] - ini_x
				diif_val_y = val[1] - ini_y
				for _ in range(diif_val_x):
					fin_list.append('R')
				for _ in range(diif_val_y):
					fin_list.append('U')
				ini_x = val[0]
				ini_y = val[1]
	if flag == 1:
		output.append(['YES', fin_list])
	else:
		output.append('NO')
for x in output:
	if x == 'NO':
		print(x)
	else:
		print(x[0])
		str_val = ''
		print(str_val.join(x[1]))


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		s = list(map(int, input().split()))
		l.append(s)
	l.sort()
	flag = 0
	r = 0
	u = 0
	ans = ''
	for i in range(n - 1):
		if l[i + 1][0] - l[i][0] < 0 or l[i + 1][1] - l[i][1] < 0:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		for i in range(n):
			x = l[i][0] - r
			y = l[i][1] - u
			r = r + x
			u = u + y
			ans += 'R' * x + 'U' * y
		print(ans)


def collectPackages(P):
	P = sorted(P, key=lambda x: (x[0], x[1]))
	(x, y) = (0, 0)
	path = ''
	for (x1, y1) in P:
		if x1 - x < 0 or y1 - y < 0:
			print('NO')
			return
		path += 'R' * (x1 - x)
		path += 'U' * (y1 - y)
		(x, y) = (x1, y1)
	print('YES')
	print(path)
N = int(input())
cases = []
for _ in range(N):
	n = int(input())
	case = []
	for i in range(n):
		(x, y) = map(int, input().split())
		case.append((x, y))
	cases.append(case)
for case in cases:
	collectPackages(case)


T = int(input())
for t in range(T):
	n = int(input())
	points = []
	for i in range(n):
		points.append([int(x) for x in input().split()])
	points.sort()
	ans = ''
	curr_x = 0
	prev_y_max = 0
	curr_y_max = 0
	flag = False
	for pt in points:
		x = pt[0]
		y = pt[1]
		if x != curr_x:
			h = curr_y_max - prev_y_max
			ans = ans + 'U' * h + 'R' * (x - curr_x)
			curr_x = x
			prev_y_max = curr_y_max
			curr_y_max = y
		if y < prev_y_max:
			flag = True
			break
		curr_y_max = max(y, curr_y_max)
	h = curr_y_max - prev_y_max
	ans = ans + 'U' * h
	if flag:
		print('NO')
		continue
	else:
		print('YES')
		print(ans)


import sys
from math import gcd
from heapq import heappop
from heapq import heappush
from heapq import heapify
from bisect import insort
from bisect import bisect_right
from bisect import bisect_left
from sys import stdin, stdout
from collections import defaultdict, deque
from math import log2, ceil, floor
inp = lambda : int(input())
sip = lambda : input()
mulip = lambda : map(int, input().split())
lst = lambda : list(map(int, input().split()))
slst = lambda : list(sip())
arr2d = lambda x: [[int(j) for j in input().split()] for i in range(x)]
odds = lambda l: len(list(filter(lambda x: x % 2 != 0, l)))
evens = lambda l: len(list(filter(lambda x: x % 2 == 0, l)))
mod = pow(10, 9) + 7
Judge = 0
if Judge:
	sys.stdin = open('input.in', 'r')
for _ in range(inp()):
	n = inp()
	cd = [[0, 0]]
	for _ in range(n):
		(x, y) = mulip()
		cd.append([x, y])
	cd = sorted(cd)
	f = 0
	for i in range(n + 1):
		for j in range(i + 1, n + 1):
			if cd[i][1] > cd[j][1]:
				f = 1
				break
		if f == 1:
			break
	if f == 0:
		print('YES')
		ans = ''
		for i in range(1, n + 1):
			ans += 'R' * (cd[i][0] - cd[i - 1][0]) + 'U' * (cd[i][1] - cd[i - 1][1])
		print(ans)
	else:
		print('NO')


def modinv(n, p):
	return pow(n, p - 2, p)

def main():
	for case in range(int(input())):
		n = int(input())
		pts = []
		for i in range(n):
			(x, y) = [int(x) for x in input().split()]
			pts.append([y, x])
		pts.sort()
		ans = []
		(last_x, last_y) = [0, 0]
		not_possible = False
		for p in pts:
			(y, x) = p
			if x < last_x or y < last_y:
				not_possible = True
				break
			ans.append('R' * (x - last_x))
			ans.append('U' * (y - last_y))
			last_x = x
			last_y = y
		if not_possible:
			print('NO')
		else:
			print('YES')
			print(''.join(ans))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

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

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			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')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	coord = []
	for i in range(n):
		c = tuple(map(int, input().split()))
		coord.append(c)
	coord = sorted(coord)
	path = ''
	x = 0
	y = 0
	f = 1
	for c in coord:
		if c[1] < y:
			f = 0
			break
		xpath = 'R' * (c[0] - x)
		x = c[0]
		ypath = 'U' * (c[1] - y)
		y = c[1]
		path += xpath + ypath
	if f:
		print('YES')
		print(path)
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	packages = []
	for package in range(n):
		packages.append(tuple(map(int, input().split())))
	packages.sort()
	x = 0
	y = 0
	mvstring = ''
	flag = True
	for package in packages:
		if package[0] < x or package[1] < y:
			flag = False
			break
		else:
			mvstring += 'R' * (package[0] - x) + 'U' * (package[1] - y)
			x = package[0]
			y = package[1]
	if flag:
		print('YES')
		print(mvstring)
	else:
		print('NO')


t = int(input())
for x in range(t):
	n = int(input())
	l = []
	for i in range(n):
		temp = list(map(int, input().split()))
		l.append(temp)
	l.sort()
	count = 1
	current = [0, 0]
	s = 'R' * (l[0][0] - current[0]) + 'U' * (l[0][1] - current[1])
	current = l[0]
	for i in range(1, n):
		if l[i][1] >= l[i - 1][1]:
			count += 1
			s += 'R' * (l[i][0] - current[0]) + 'U' * (l[i][1] - current[1])
			current = l[i]
		else:
			break
	if count == n:
		print('YES')
		print(s)
	else:
		print('NO')


T = int(input())
for i in range(T):
	l = []
	n = int(input())
	for j in range(n):
		(a, b) = map(int, input().split())
		l.append((a, b))
	l.sort()
	ans = ''
	lastX = 0
	lastY = 0
	curr = 0
	while curr < n:
		if l[curr][1] < lastY:
			ans = 'NO'
			break
		for k in range(l[curr][0] - lastX):
			ans = ans + 'R'
		while curr + 1 < n and l[curr + 1][0] == l[curr][0]:
			for k in range(l[curr][1] - lastY):
				ans = ans + 'U'
			lastY = l[curr][1]
			curr += 1
		for k in range(l[curr][1] - lastY):
			ans = ans + 'U'
		lastY = l[curr][1]
		lastX = l[curr][0]
		curr += 1
	if ans == 'NO':
		print(ans)
	else:
		print('YES')
		print(ans)


def can_traspess(array):
	array.sort()
	result = ''
	possible = True
	current_point = (0, 0)
	for i in range(len(array) - 1):
		if not possible:
			return False
		target = array[i + 1]
		while current_point != target:
			if current_point[0] < array[i + 1][0] and current_point[1] <= array[i + 1][1]:
				result += 'R'
				current_point = (current_point[0] + 1, current_point[1])
			elif current_point[1] < array[i + 1][1] and current_point[0] <= array[i + 1][0]:
				result += 'U'
				current_point = (current_point[0], current_point[1] + 1)
			else:
				possible = False
				break
		if not possible:
			return False
	return result
n = int(input())
for i in range(n):
	packages = int(input())
	array = [(0, 0)]
	for _ in range(packages):
		(a, b) = map(int, input().split())
		array.append((a, b))
	result = can_traspess(array)
	if result == False:
		print('NO')
	else:
		print('YES')
		print(result)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		a = [LI() for _ in range(n)]
		a = sorted(a)
		ok = True
		r = []
		cx = cy = 0
		for (x, y) in a:
			if y < cy:
				ok = False
				break
			if x > cx:
				r.append('R' * (x - cx))
			if y > cy:
				r.append('U' * (y - cy))
			(cx, cy) = (x, y)
		rr.append(IF(ok, 'YES', 'NO'))
		if ok:
			rr.append(JA(r, ''))
	return JA(rr, '\n')
print(main())


t = int(input())
for i in range(t):
	n = int(input())
	lst = [0] * n
	j = 0
	for w in range(n):
		(x, y) = map(int, input().split())
		lst[j] = [x, y]
		j += 1
	lst.sort(key=lambda x: (x[0], x[1]))
	(i1, j1) = (0, 0)
	out = ''
	for j in range(n):
		if lst[j][0] < i1 or lst[j][1] < j1:
			print('NO')
			break
		out += 'R' * (lst[j][0] - i1) + 'U' * (lst[j][1] - j1)
		i1 = lst[j][0]
		j1 = lst[j][1]
	else:
		print('YES')
		print(out)


t = int(input())
for _ in range(t):
	arr = [(0, 0)]
	n = int(input())
	for points in range(n):
		arr.append(tuple(map(int, input().split())))
	brr = sorted(arr)
	path = ''
	count = 0
	for i in range(n):
		y_diff = brr[i + 1][1] - brr[i][1]
		x_diff = brr[i + 1][0] - brr[i][0]
		if x_diff > 0 and y_diff >= 0:
			path += 'R' * x_diff
			count = 1
		if y_diff > 0 and x_diff >= 0:
			path += 'U' * y_diff
			count = 1
		if x_diff < 0 or y_diff < 0:
			count = 0
			print('NO')
			break
	if count == 1:
		print('YES')
		print(path)


t = int(input())
for i in range(t):
	x = int(input())
	s = []
	q = ''
	T = True
	for j in range(x):
		(a, b) = [int(Z) for Z in input().split(' ')]
		s.append((a, b))
	s = sorted(s)
	A = 0
	B = 0
	for j in range(len(s)):
		if s[j][0] - A < 0 or s[j][1] - B < 0:
			print('NO')
			T = False
			break
		else:
			q += 'R' * (s[j][0] - A)
			q += 'U' * (s[j][1] - B)
		A = s[j][0]
		B = s[j][1]
	if T:
		print('YES')
		print(q)


t = int(input())
for i in range(t):
	n = int(input())
	pack = []
	for j in range(n):
		(x, y) = map(int, input().split())
		pack.append([x, y])
	pack.sort()
	flag = True
	for j in range(n - 1):
		if pack[j][0] > pack[j + 1][0] or pack[j][1] > pack[j + 1][1]:
			flag = False
	if not flag:
		print('NO')
	else:
		print('YES')
		moves = []
		here_x = 0
		here_y = 0
		for j in range(n):
			locate_x = pack[j][0]
			locate_y = pack[j][1]
			for k in range(locate_x - here_x):
				moves.append('R')
			for k in range(locate_y - here_y):
				moves.append('U')
			here_x = locate_x
			here_y = locate_y
		print(''.join(moves))


for _ in range(int(input())):
	n = int(input())
	ans = ''
	lst = [list(map(int, input().split())) for _ in range(n)]
	lst.sort()
	res = [0, 0]
	y = [i[1] for i in lst]
	if y != sorted(y):
		print('NO')
	else:
		i = 0
		for i in range(n):
			dx = lst[i][0] - res[0]
			dy = lst[i][1] - res[1]
			ans += 'R' * dx
			ans += 'U' * dy
			(res[0], res[1]) = (lst[i][0], lst[i][1])
		print('YES')
		print(ans)


def solve_2(packages):
	packages.insert(0, (0, 0))
	packages.sort(key=lambda p: p[0] + p[1])
	dp = [None for i in range(len(packages))]
	for (p, (x, y)) in reversed(list(enumerate(packages))):
		children = []
		for (q, (x2, y2)) in reversed(list(enumerate(packages))):
			(dx, dy) = (x2 - x, y2 - y)
			if dx >= 0 and dy >= 0 and (q != p):
				children.append(q)
		dp[p] = 0 if not children else 1 + max([dp[q] for q in children])
	if dp[0] == len(packages) - 1:
		(p, (x, y), res) = (0, (0, 0), '')
		while True:
			(next_p, next_x, next_y) = (None, None, None)
			(max_val, max_dx, min_dy) = (float('-inf'), float('-inf'), float('inf'))
			for (q, (x2, y2)) in enumerate(packages):
				(dx, dy) = (x2 - x, y2 - y)
				if dx >= 0 and dy >= 0 and (q != p):
					if dp[q] >= max_val:
						if dx == max_dx and dy < min_dy:
							(next_p, next_x, next_y) = (q, x2, y2)
							(max_val, max_dx, min_dy) = (dp[q], dx, dy)
						elif dx > max_dx:
							(next_p, next_x, next_y) = (q, x2, y2)
							(max_val, max_dx, min_dy) = (dp[q], dx, dy)
			if next_p == None:
				break
			(p, x, y) = (next_p, next_x, next_y)
			res += 'R' * max_dx + 'U' * min_dy
		return res
import itertools

def solve(packages):
	packages.insert(0, (0, 0))
	(edges, in_degree) = (set(), {})
	for ((x1, y1), (x2, y2)) in itertools.product(packages, repeat=2):
		if x2 >= x1 and y2 >= y1 and ((x1, y1) != (x2, y2)):
			edges.add(((x1, y1), (x2, y2)))
			in_degree[x2, y2] = in_degree.get((x2, y2), 0) + 1
	(bag, order) = ([(0, 0)], [])
	while bag:
		if len(bag) > 1:
			return False
		(x1, y1) = bag.pop()
		order.append((x1, y1))
		for (x2, y2) in packages:
			if ((x1, y1), (x2, y2)) in edges:
				edges.remove(((x1, y1), (x2, y2)))
				in_degree[x2, y2] -= 1
				if in_degree[x2, y2] == 0:
					bag.append((x2, y2))
	res = ''
	for ((x1, y1), (x2, y2)) in zip(order, order[1:]):
		res += 'R' * (x2 - x1) + 'U' * (y2 - y1)
	return res
for t in range(int(input())):
	(n, packages) = (int(input()), [])
	for i in range(n):
		(x, y) = map(int, input().split())
		packages.append((x, y))
	res = solve(packages)
	print(f'YES\n{res}' if res != False else 'NO')


def solve(points, n):
	points.sort(key=lambda x: (x[0], x[1]))
	path = ''
	for (i, (x, y)) in enumerate(points[1:], 1):
		dx = x - points[i - 1][0]
		dy = y - points[i - 1][1]
		if dx >= 0 and dy >= 0:
			path = path + 'R' * dx + 'U' * dy
		else:
			return 'NO'
	return f'YES\n{path}'
t = int(input())
for _ in range(t):
	n = int(input())
	points = []
	for i in range(n):
		(x, y) = map(int, input().split())
		points.append([x, y])
	points.insert(0, [0, 0])
	print(solve(points, n))
	del points[:]


t = int(input())
for _ in range(t):
	n = int(input())
	a = sorted([[int(x) for x in input().split()] for _ in range(n)])
	ans = []
	last_x = 0
	last_y = 0
	for (x, y) in a:
		ans.extend(['R'] * (x - last_x))
		last_x = x
		if y < last_y:
			ans = []
			break
		ans.extend(['U'] * (y - last_y))
		last_y = y
	if ans:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


t = int(input())
for i in range(t):
	x = []
	n = int(input())
	for i in range(n):
		(a, b) = map(int, input().split())
		x.append([a, b])
	x.sort(key=lambda x: x[0])
	arr = []
	for i in range(1010):
		arr.append([])
	for i in x:
		arr[i[1]].append(i[0])
	for i in range(1010):
		arr[i].sort()
	ans = ''
	flag = 1
	last_y = 0
	last_x = 0
	y = 0
	for i in arr:
		if len(i) != 0:
			for j in i:
				k = j - last_x
				if k < 0:
					flag = 0
					break
				last_x = j
				ans += 'R' * k
				k = y - last_y
				if k < 0:
					flag = 0
					break
				ans += 'U' * k
				last_y = y
			if flag == 0:
				break
		y += 1
	if flag == 0:
		print('NO')
	else:
		print('YES')
		print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	pos = []
	for __ in range(n):
		(x, y) = map(int, input().split())
		pos.append([x, y])
	pos = sorted(pos)
	ans = []
	cx = cy = 0
	can = True
	for (x, y) in pos:
		if x > cx:
			while x > cx:
				cx += 1
				ans.append('R')
		elif x < cx:
			can = False
			break
		if y > cy:
			while y > cy:
				cy += 1
				ans.append('U')
		elif y < cy:
			can = False
			break
	if can:
		print('YES')
		print(''.join(ans))
	else:
		print('NO')


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
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 value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]
for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(value())
	a.sort()
	(x, y) = (0, 0)
	f = 1
	ans = ''
	for i in a:
		if i[0] < x or i[1] < y:
			f = 0
			break
		ans += 'R' * (i[0] - x)
		ans += 'U' * (i[1] - y)
		x = i[0]
		y = i[1]
	if f:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l = []
	for i in range(n):
		ll = list(map(int, input().split()))
		l.append(ll)
	l.sort()
	flag = 0
	s = str()
	d = {}
	we = w = 0
	lans = []
	for i in range(n):
		if l[i][0] not in d:
			if we != 0 or w != 0:
				ll = [w, we]
				lans.append(ll)
			we = w = 0
			d[l[i][0]] = 1
			w = l[i][0]
			we = max(we, l[i][1])
			if len(lans) > 0 and l[i][1] < lans[-1][1]:
				flag = 1
				break
		else:
			we = max(we, l[i][1])
			if len(lans) > 0 and l[i][1] < lans[-1][1]:
				flag = 1
				break
	if we != 0 or w != 0:
		ll = [w, we]
		lans.append(ll)
	s = lans[0][0] * 'R' + lans[0][1] * 'U'
	for i in range(1, len(lans)):
		if flag == 1:
			break
		q = lans[i][0] - lans[i - 1][0]
		qq = lans[i][1] - lans[i - 1][1]
		if q > -1 and qq > -1:
			s += q * 'R'
			s += qq * 'U'
		else:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')
		print(s)


def solve(n, arr):
	arr.sort()
	for i in range(1, n):
		if arr[i][1] < arr[i - 1][1]:
			return 'NO'
	(x, y) = (0, 0)
	direc = []
	for i in range(n):
		if x < arr[i][0]:
			for j in range(arr[i][0] - x):
				direc.append('R')
				x = arr[i][0]
		if y < arr[i][1]:
			for k in range(arr[i][1] - y):
				direc.append('U')
				y = arr[i][1]
	print('YES')
	return ''.join(direc)
for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		a = list(map(int, input().split()))
		arr.append(a)
	print(solve(n, arr))


t = int(input())
ans = []
for j in range(t):
	n = int(input())
	arr = []
	for i in range(n):
		s = input().split()
		arr.append((int(s[0]), int(s[1])))
	a = 'YES'
	for x in range(len(arr)):
		for y in range(len(arr)):
			if arr[x][0] > arr[y][0] and arr[x][1] < arr[y][1]:
				a = 'NO'
		if a == 'NO':
			break
	if a == 'YES':
		arr.sort()
		x = 0
		y = 0
		a += '\n'
		while True:
			if len(arr) < 1:
				break
			if x < arr[0][0]:
				a += 'R'
				x += 1
			elif y < arr[0][1]:
				a += 'U'
				y += 1
			else:
				arr = arr[1:]
	ans.append(a)
for aa in ans:
	print(aa)


from collections import deque

def solve():
	n = int(input())
	boxes = []
	for _ in range(n):
		(x, y) = [int(_) for _ in input().split(' ')]
		boxes.append((x, y))
	boxes.sort(key=lambda x: x[1])
	boxes.sort(key=lambda x: x[0])
	ans = []
	(x, y) = boxes[0]
	ans.append('R' * x)
	ans.append('U' * y)
	for i in range(1, len(boxes)):
		(x, y) = boxes[i]
		(prevX, prevY) = boxes[i - 1]
		if y < prevY:
			return None
		ans.append('R' * (x - prevX))
		ans.append('U' * (y - prevY))
	return ''.join(ans)
t = int(input())
for _ in range(t):
	ans = solve()
	if ans:
		print('YES')
		print(ans)
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	points = []
	for i in range(n):
		(x, y) = map(int, input().split())
		points.append((x, y))
	points.sort(key=lambda i: (i[0], i[1]))
	s = ''
	(x, y) = (0, 0)
	flag1 = 0
	for i in points:
		flag = 0
		while x != i[0]:
			if i[0] > x:
				x += 1
				s += 'R'
			elif i[0] < x:
				flag = 1
				break
		while y != i[1]:
			if i[1] > y:
				y += 1
				s += 'U'
			elif i[1] < y:
				flag = 1
				break
		s += (i[0] - x) * 'R' + (i[1] - y) * 'U'
		x = i[0]
		y = i[1]
		if flag:
			flag1 = 1
			break
	if flag1:
		print('NO')
	else:
		print('YES')
		print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	coor = []
	for i in range(n):
		coor.append(list(map(int, input().split())))
	coor.sort()
	opt = ''
	x = 0
	y = 0
	flag = 0
	for i in range(n):
		if x <= coor[i][0] and y <= coor[i][1]:
			opt = opt + 'R' * (coor[i][0] - x) + 'U' * (coor[i][1] - y)
			x = coor[i][0]
			y = coor[i][1]
		else:
			flag = 1
			print('NO')
			break
	if flag != 1:
		print('YES')
		print(opt)


t = int(input())
for qq in range(t):
	s = ''
	r = 0
	n = int(input())
	tx = 0
	ty = 0
	f = 0
	lss = []
	for pp in range(n):
		w = input().split(' ')
		x = int(w[0])
		y = int(w[1])
		ls = [x, y, x ** 2 + y ** 2]
		lss.append(ls)
	lss.sort(key=lambda x: x[2])
	for i in range(n):
		if lss[i][0] - tx >= 0 and lss[i][1] - ty >= 0:
			s += (lss[i][0] - tx) * 'R' + (lss[i][1] - ty) * 'U'
			tx = lss[i][0]
			ty = lss[i][1]
		else:
			print('NO')
			f = 1
			break
	if f == 0:
		print('YES')
		print(s)


from collections import defaultdict
n = int(input())
for i in range(n):
	d = defaultdict(list)
	m = int(input())
	l = []
	for j in range(m):
		(x, y) = list(map(int, input().split()))
		l.append([x, y])
	l.sort(key=lambda x: x[0])
	s = set([])
	for j in range(m):
		d[l[j][0]].append(l[j][1])
		s.add(l[j][0])
	s = sorted(list(s))
	ans = ''
	w = 1
	f = 0
	mx = 0
	low = 0
	left = 0
	if s[0] == 0:
		f = 1
	for j in s:
		if j == 0:
			ans += 'U'
		else:
			ans += 'R' * (j - left)
			left = j
		x = sorted(d[j])
		if x[0] < mx:
			print('NO')
			w = 0
			break
		mx = max(x[-1], mx)
		ans += 'U' * (max(x) - low)
		low = max(x)
	if f:
		ans = ans[1:]
	if w:
		print('YES')
		print(ans)


for t in range(int(input())):
	n = int(input())
	a = []
	ans = ''
	for i in range(n):
		a.append(list(map(int, input().split())))
	a = sorted(a)
	cur = [0, 0]
	boo = False
	for j in range(n - 1):
		if a[j][0] < a[j + 1][0] and a[j][1] > a[j + 1][1]:
			boo = True
			break
	for k in range(n):
		ans += abs(cur[0] - a[k][0]) * 'R'
		ans += abs(cur[1] - a[k][1]) * 'U'
		cur = a[k]
	if boo == False:
		print('YES')
		print(ans)
	else:
		print('NO')