Petya has a rectangular Board of size $n \times m$. Initially, $k$ chips are placed on the board, $i$-th chip is located in the cell at the intersection of $sx_i$-th row and $sy_i$-th column.

In one action, Petya can move all the chips to the left, right, down or up by $1$ cell.

If the chip was in the $(x, y)$ cell, then after the operation:   left, its coordinates will be $(x, y - 1)$;  right, its coordinates will be $(x, y + 1)$;  down, its coordinates will be $(x + 1, y)$;  up, its coordinates will be $(x - 1, y)$. 

If the chip is located by the wall of the board, and the action chosen by Petya moves it towards the wall, then the chip remains in its current position.

Note that several chips can be located in the same cell.

For each chip, Petya chose the position which it should visit. Note that it's not necessary for a chip to end up in this position.

Since Petya does not have a lot of free time, he is ready to do no more than $2nm$ actions.

You have to find out what actions Petya should do so that each chip visits the position that Petya selected for it at least once. Or determine that it is not possible to do this in $2nm$ actions.


-----Input-----

The first line contains three integers $n, m, k$ ($1 \le n, m, k \le 200$) — the number of rows and columns of the board and the number of chips, respectively.

The next $k$ lines contains two integers each $sx_i, sy_i$ ($ 1 \le sx_i \le n, 1 \le sy_i \le m$) — the starting position of the $i$-th chip.

The next $k$ lines contains two integers each $fx_i, fy_i$ ($ 1 \le fx_i \le n, 1 \le fy_i \le m$) — the position that the $i$-chip should visit at least once.


-----Output-----

In the first line print the number of operations so that each chip visits the position that Petya selected for it at least once.

In the second line output the sequence of operations. To indicate operations left, right, down, and up, use the characters $L, R, D, U$ respectively.

If the required sequence does not exist, print -1 in the single line.


-----Examples-----
Input
3 3 2
1 2
2 1
3 3
3 2

Output
3
DRD
Input
5 4 3
3 4
3 1
3 3
5 3
1 3
1 4

Output
9
DDLUUUURR

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Implementation

Constructive algorithms


Solutions:
(n, m, k) = map(int, input().split())
print(n + m + n * m - 3)
for i in range(n - 1):
	print('U', end='')
for i in range(m - 1):
	print('L', end='')
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			print('R', end='')
	else:
		for j in range(m - 1):
			print('L', end='')
	if i < n - 1:
		print('D', end='')


import sys
import math
input = sys.stdin.readline
t = 1
for _ in range(t):
	(n, m, k) = map(int, input().split())
	for i in range(k):
		(sx, sy) = map(int, input().split())
	for i in range(k):
		(fx, fy) = map(int, input().split())
	s = ''
	for i in range(m - 1):
		s += 'L'
	for i in range(n - 1):
		s += 'U'
	cnt = 0
	ch = 0
	while cnt < n * m:
		if ch % 2 == 0:
			for i in range(1, m):
				s += 'R'
				sy += 1
				cnt += 1
		else:
			for i in range(1, m):
				sy -= 1
				s += 'L'
				cnt += 1
		s += 'D'
		sx += 1
		cnt += 1
		ch += 1
	print(len(s))
	print(s)


(n, m, k) = map(int, input().split())
if n == 1:
	print(m + m)
	print('L' * m + 'R' * m)
	exit()
if m == 1:
	print(n + n)
	print('U' * n + 'D' * n)
	exit()
if m == n == 2:
	print('5\nULRDL')
	exit()
print(n + m + n * m + n - 1)
ans = 'L' * m + 'U' * n
for i in range((n - n % 2) // 2):
	ans += 'R' * m + 'D' + 'L' * m + 'D'
if n % 2 == 1:
	ans += 'R' * m + 'D'
ans = ans[:-1]
print(ans)


(n, m, k) = map(int, input().strip().split())
output = 'U' * (n - 1)
output = output + 'L' * (m - 1)
letter = 'R'
for a in range(n):
	output = output + letter * (m - 1)
	output = output + 'D'
	letter = 'R' if letter == 'L' else 'L'
print(n + m - 2 + n * m)
print(output)


(n, m, k) = map(int, input().split())
ans = ''
for i in range(n - 1):
	ans += 'U'
for i in range(m - 1):
	ans += 'L'
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			ans += 'R'
	else:
		for j in range(m - 1):
			ans += 'L'
	ans += 'D'
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split())
mx = 0
my = 0
for _ in range(k):
	(x, y) = map(int, input().split())
	(x1, y1) = map(int, input().split())
	mx = max(mx, x)
	my = max(my, y)
ans = 'L' * (my - 1)
ans += 'U' * (mx - 1)
r = 'R' * (m - 1) + 'D' + 'L' * (m - 1)
if n == 1:
	ans += 'R' * (m - 1)
	print(len(ans))
	print(ans)
else:
	c = n // 2
	for i in range(c):
		ans += r
		if i == c - 1:
			pass
		else:
			ans += 'D'
	if n % 2 == 1:
		ans += 'D'
		ans += 'R' * (m - 1)
	print(len(ans))
	print(ans)


from collections import defaultdict
import math
from functools import reduce
from heapq import heapify, heappush, heappop
mod = 10 ** 9 + 7
for _ in range(1):
	(n, m, k) = map(int, input().split())
	for i in range(2 * k):
		map(int, input().split())
	print(n + m - 2 + n * m)
	print('L' * (m - 1), end='')
	print('U' * (n - 1), end='')
	for i in range(n):
		if i % 2 == 0:
			print('R' * (m - 1), end='')
			print('D', end='')
		else:
			print('L' * (m - 1), end='')
			print('D', end='')
	print()


(n, m, k) = map(int, input().split())
left = 'D' + 'L' * (m - 1)
right = 'D' + 'R' * (m - 1)
ans = ''.join(['U' * (n - 1), 'L' * (m - 1), 'R' * (m - 1)] + [left if x % 2 == 0 else right for x in range(n - 1)])
print(len(ans))
print(ans)


(r, c, k) = map(int, input().split())
for i in range(2 * k):
	(r1, c1) = map(int, input().split())
print(r - 1 + (c - 1) + (r - 1) + r * (c - 1))
print('U' * (r - 1) + 'L' * (c - 1), end='')
for i in range(r):
	if i != 0:
		print('D', end='')
	if i % 2 == 0:
		print('R' * (c - 1), end='')
	else:
		print('L' * (c - 1), end='')


(n, m, _) = map(int, input().split())
print(n * m + n + m - 3)
st = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(n):
	if i != 0:
		st += 'D'
	if i % 2 == 0:
		st += 'R' * (m - 1)
	else:
		st += 'L' * (m - 1)
print(st)


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
from math import sqrt
d = dd(list)
(n, m, k) = map(int, input().split())
ls = []
ld = []
for i in range(k):
	ls.append(list(map(int, input().split())))
for i in range(k):
	ld.append(list(map(int, input().split())))
res = 'L' * (m - 1) + 'U' * (n - 1)
res += 'D' * (n - 1)
for i in range(m - 1):
	res += 'R'
	if i % 2 == 0:
		res += 'U' * (n - 1)
	else:
		res += 'D' * (n - 1)
print(len(res))
print(res)


(n, m, k) = input().split()
n = int(n)
m = int(m)
k = int(k)
a = [[0 for i in range(m)] for j in range(n)]
d = []
for i in range(k):
	(x, y) = input().split()
	x = int(x) - 1
	y = int(y) - 1
	d.append([x, y])
	a[x][y] = 1
b = []
for i in range(k):
	(x, y) = input().split()
	x = int(x) - 1
	y = int(y) - 1
	b.append([x, y])
sol = ''
sol += m * 'L'
sol += n * 'U'
pr = True
ok = 1
if n > 1 and m > 1:
	for i in range(n):
		if not pr:
			sol += 'D'
		if ok:
			sol += (m - 1) * 'R'
		else:
			sol += (m - 1) * 'L'
		pr = False
		ok = 1 - ok
	print(len(sol))
	print(*sol, sep='')
elif n > 1:
	print(2 * n)
	print(n * 'U', end='')
	print(n * 'D')
elif m > 1:
	print(2 * m)
	print(m * 'L', end='')
	print(m * 'R')
else:
	print(0)


ch = input()
L = [int(i) for i in ch.split()]
n = L[0]
m = L[1]
k = L[2]
for i in range(2 * k):
	ch = input()
s = ''
for i in range(n - 1):
	s += 'U'
for i in range(m - 1):
	s += 'L'
x = 'R'
for i in range(n):
	for j in range(m - 1):
		s += x
	if i == n - 1:
		break
	s += 'D'
	if x == 'R':
		x = 'L'
	else:
		x = 'R'
print(len(s))
print(s)


def main():
	(n, m, k) = map(int, input().split())
	marker_coordinates = (n, m)
	result = str()
	result += 'D' * (n - 1)
	result += 'R' * (m - 1)
	for _ in range(k * 2):
		input()
	for i in range(1, n + 1):
		if i % 2 == 0:
			result += 'R' * (m - 1)
			result += 'U'
		else:
			result += 'L' * (m - 1)
			result += 'U'
	print(len(result))
	print(result)
main()


(n, m, k) = map(int, input().split())
mass = list()
answer = ''
for i in range(k):
	(x, y) = map(int, input().split())
	mass.append([x, y])
for i in range(k):
	(x, y) = map(int, input().split())
answer = answer + ''.join(['R'] * m)
answer = answer + ''.join(['D'] * n)
for i in range(n):
	if i % 2 == 0:
		answer = answer + ''.join(['L'] * (m - 1))
	else:
		answer = answer + ''.join(['R'] * (m - 1))
	if i != n - 1:
		answer = answer + 'U'
print(len(answer))
print(answer)


import math, collections, sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
for i in range(2 * k):
	(x, y) = map(int, input().split())
ans = ''
for i in range(m - 1):
	ans += 'L'
for i in range(n - 1):
	ans += 'U'
for i in range(n):
	if i % 2:
		ans += 'L' * (m - 1)
	else:
		ans += 'R' * (m - 1)
	if i != n - 1:
		ans += 'D'
print(len(ans))
print(ans)


(n, m, k) = list(map(int, input().split()))
for _ in range(k):
	(sx, sy) = input().split()
for _ in range(k):
	(fx, fy) = input().split()
print(n * m + n + m - 2)
print('U' * (n - 1), 'L' * (m - 1), sep='', end='')
for r in range(1, n + 1):
	if r % 2 == 1:
		print('R' * (m - 1), 'D', sep='', end='')
	else:
		print('L' * (m - 1), 'D', sep='', end='')
print()


import sys
input = sys.stdin.readline
(n, m, k) = [int(x) for x in input().strip().split()]
ans = []
for i in range(n - 1):
	ans.append('U')
for i in range(m - 1):
	ans.append('L')
for i in range(n):
	for j in range(m - 1):
		ans.append('L') if i % 2 else ans.append('R')
	ans.append('D')
print(len(ans))
print(''.join(ans))


(n, m, k) = map(int, input().split())
for i in range(k * 2):
	input()
s = ''
s += 'D' * (n - 1)
s += 'R' * (m - 1)
odd = 1
while m:
	if odd:
		s += 'U' * (n - 1)
	else:
		s += 'D' * (n - 1)
	odd ^= 1
	m -= 1
	s += 'L'
print(len(s))
print(s)


import sys
(n, m, k) = map(int, sys.stdin.readline().split())
for i in range(2 * k):
	(u, v) = map(int, sys.stdin.readline().split())
l = [0 for _ in range(n - 1 + m - 1 + n * (m - 1) + (n - 1))]
for i in range(n - 1):
	l[i] = 'D'
for i in range(n - 1, n + m - 2):
	l[i] = 'R'
count = 0
(i, z) = (m - 1, True)
j = n + m - 2
while count <= n - 1:
	while i > 0 and z:
		l[j] = 'L'
		i -= 1
		j += 1
	while i < m - 1 and (not z):
		l[j] = 'R'
		i += 1
		j += 1
	if i == 0:
		z = False
	else:
		z = True
	count += 1
	if j < len(l):
		l[j] = 'U'
	j += 1
print(len(l))
print(''.join((x for x in l)))


(n, m, k) = map(int, input().split())
for i in range(k):
	(s, adssd) = map(int, input().split())
for i in range(k):
	(sad, asd) = map(int, input().split())
st = 'L' * (m - 1) + 'U' * (n - 1)
for i in range(n):
	if i % 2 == 0:
		st += 'R' * (m - 1) + 'D'
	else:
		st += 'L' * (m - 1) + 'D'
print(len(st))
print(st)


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
for _ in range(2 * k):
	input()
pre = ['R'] * (m - 1)
post = ['D'] * (n - 1)
seq = pre + post
for i in range(n):
	if i % 2 == 0:
		seq.append('L' * (m - 1))
	else:
		seq.append('R' * (m - 1))
	if i < n - 1:
		seq.append('U')
seq = ''.join(seq)
print(len(seq))
print(seq)


def main():
	(n, m, k) = map(int, input().split())
	start = []
	for i in range(k):
		(x, y) = map(int, input().split())
		start.append((x, y))
	end = []
	for i in range(k):
		(x, y) = map(int, input().split())
		end.append((x, y))
	ans = []
	for i in range(m - 1):
		ans.append('L')
	for i in range(n - 1):
		ans.append('U')
	down = True
	for i in range(2 * m - 1):
		if i % 2 == 0:
			for j in range(n - 1):
				if down:
					ans.append('D')
				else:
					ans.append('U')
			down = not down
		else:
			ans.append('R')
	if len(ans) > 2 * m * n:
		print(-1)
		return
	print(len(ans))
	for i in ans:
		print(i, end='')
main()


(n, m, k) = map(int, input().split())
(sp, fp) = ([], [])
for i in range(2 * k):
	(a, b) = map(int, input().split())
	if i < k:
		sp.append((a, b))
	else:
		fp.append((a, b))
res = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(n):
	if i % 2:
		res += 'L' * (m - 1)
	else:
		res += 'R' * (m - 1)
	res += 'D'
print(len(res))
print(res)


import sys

def input():
	return sys.stdin.readline().strip()
(n, m, k) = map(int, input().split(' '))
for i in range(2 * n):
	input()
S = 'U' * (n - 1) + 'L' * (m - 1)
T = [(m - 1) * 'R', (m - 1) * 'L']
i = 0
while i < n:
	S += T[i % 2]
	i += 1
	if i == n:
		break
	S += 'D'
	S += T[i % 2]
	i += 1
	if i == n:
		break
	S += 'D'
print(len(S))
print(S)


liStr = input().split()
n = int(liStr[0])
m = int(liStr[1])
k = int(liStr[2])
for _ in range(0, 2 * k):
	liStr = input()
ctr = 0
ans = ''
for _ in range(0, n - 1):
	ctr += 1
	ans = ans + 'U'
for _ in range(0, m - 1):
	ctr += 1
	ans = ans + 'L'
for i in range(1, n + 1):
	ch = 'R'
	if i % 2 == 0:
		ch = 'L'
	for j in range(0, m - 1):
		ctr += 1
		ans = ans + ch
	if i != n:
		ctr += 1
		ans = ans + 'D'
print(ctr)
print(ans)


(n, m, k) = map(int, input().split())
mtr = [[None] * m for i in range(n)]
dest = []
src = []
for p in range(k):
	(i, j) = map(int, input().split())
	src.append((i, j))
for p in range(k):
	(i, j) = map(int, input().split())
	dest.append((i, j))
s = 'L' * (m - 1) + 'U' * (n - 1) + ('R' * (m - 1) + 'D' + 'L' * (m - 1) + 'D') * (n // 2) + 'R' * (m - 1) * (n % 2)
print(len(s))
print(s)


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
(n, m, k) = mpint()
if n + m <= n * m:
	ans = 'U' * n + 'L' * m
	for i in range(m):
		if i & 1:
			ans += 'R' + 'U' * (n - 1) + 'R'
		else:
			ans += 'D' * (n - 1)
	ans = ans[:2 * n * m]
	print(len(ans))
	print(ans)
elif n == 1:
	print(2 * n * m)
	print('L' * (n * m) + 'R' * (n * m))
else:
	print(2 * n * m)
	print('U' * (n * m) + 'D' * (n * m))


(n, m, k) = map(int, input().split())
(max_x, max_y) = (0, 0)
st = ''
for _ in range(k):
	(x, y) = map(int, input().split())
	max_x = max(max_x, x)
	max_y = max(max_y, y)
st += (max_x - 1) * 'U' + (max_y - 1) * 'L'
coord = dict()
for _ in range(k):
	(x, y) = map(int, input().split())
	if x not in coord:
		coord[x] = [y]
	else:
		coord[x].append(y)
count = 0
prev = 1
for i in sorted(coord.keys()):
	st += (i - prev) * 'D'
	prev = i
	if count % 2 == 0:
		st += (m - 1) * 'R'
	else:
		st += (m - 1) * 'L'
	count += 1
print(len(st))
print(st)


(n, m, k) = [int(x) for x in input().split()]
for _ in range(k):
	(a, b) = [int(x) for x in input().split()]
for _ in range(k):
	(a, b) = [int(x) for x in input().split()]
ans = 'R' * (m - 1) + 'U' * (n - 1)
for i in range(m):
	if i % 2 == 0:
		ans += 'D' * (n - 1)
		ans += 'L'
	else:
		ans += 'U' * (n - 1)
		ans += 'L'
print(len(ans[:-1]))
print(ans[:-1])


(n, m, k) = map(int, input().split())
res = []
res += ['U'] * (n - 1)
res += ['L'] * (m - 1)
for i in range(m):
	if i % 2 == 0:
		res += ['D'] * (n - 1)
	else:
		res += ['U'] * (n - 1)
	if i < m - 1:
		res += ['R']
s = ''
for c in res:
	s += c
print(len(s))
print(s)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
(n, m, k) = list(map(int, input().split()))
for i in range(k):
	pos1 = list(map(int, input().split()))
for i in range(k):
	pos2 = list(map(int, input().split()))
ans = ['L'] * (m - 1) + ['U'] * (n - 1)
for i in range(m):
	if i % 2 == 0:
		ans += ['D'] * (n - 1)
	else:
		ans += ['U'] * (n - 1)
	if i != m - 1:
		ans += ['R']
print(len(ans))
print(''.join(ans))


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	input()
print(m - 1 + n - 1 + m - 1 + (m - 1) * (n - 1) + (n - 1))
idx = 0
dir = 'DU'
print('L' * (m - 1) + 'U' * (n - 1), end='')
for i in range(m - 1):
	print(dir[idx] * (n - 1) + 'R', end='')
	idx ^= 1
print(dir[idx] * (n - 1))


import sys
(n, m, k) = map(int, input().split())
maxx = 0
maxy = 0
if n == m == 1:
	print(0)
	sys.exit()
for i in range(k):
	(sx, sy) = map(int, input().split())
	maxx = max(maxx, sx)
	maxy = max(maxy, sy)
for i in range(k):
	(ok, boomer) = map(int, input().split())
s = ''
res = 0
s += (maxx - 1) * 'U'
s += (maxy - 1) * 'L'
res += maxx - 1
res += maxy - 1
cur = 'R'
prev = 'L'
for i in range(n):
	s += (m - 1) * cur
	res += m - 1
	if i == n - 1:
		break
	s += 'D'
	res += 1
	(cur, prev) = (prev, cur)
print(res)
print(s)


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
for _ in range(2 * k):
	(x, y) = input().split()
print(2 * (n - 1) + (n + 1) * (m - 1))
for _ in range(n - 1):
	print('U', end='')
for _ in range(m - 1):
	print('L', end='')
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			print('R', end='')
	else:
		for j in range(m - 1):
			print('L', end='')
	if i != n - 1:
		print('D', end='')


(n, m, cs) = [int(x) for x in input().split(' ')]
for i in range(2 * cs):
	(x, y) = [int(x) for x in input().split(' ')]
s1 = 'L' * (m - 1) + 'D' * (n - 1)
for i in range(m):
	if i % 2 == 0:
		s1 += 'U' * (n - 1)
	else:
		s1 += 'D' * (n - 1)
	if i != m - 1:
		s1 += 'R'
print(len(s1))
print(s1)


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():
	(n, m, k) = map(int, input().split())
	for _ in range(k * 2):
		input()
	rrow = 'R' * (m - 1)
	lrow = 'L' * (m - 1)
	setup = 'U' * (n - 1) + 'L' * (m - 1)
	res = setup + 'D'.join(([rrow] + [lrow]) * (n // 2))
	if n % 2 == 1:
		res += 'D' + rrow
	print(len(res))
	print(res)
main()


(n, m, k) = map(int, input().split())
cur = []
req = []
s = ''
for i in range(k):
	cur.append(list(map(int, input().split())))
for i in range(k):
	req.append(list(map(int, input().split())))
for i in range(n - 1):
	s += 'U'
for i in range(m - 1):
	s += 'L'
flag = False
for i in range(m):
	for j in range(n - 1):
		if flag == False:
			s += 'D'
		else:
			s += 'U'
	s += 'R'
	if flag:
		flag = False
	else:
		flag = True
s = s[:-1]
print(len(s))
print(s)


import sys
input = sys.stdin.readline
(N, M, K) = map(int, input().split())
Ss = [list(map(int, input().split())) for _ in range(K)]
Gs = [list(map(int, input().split())) for _ in range(K)]
if N > 1 and M > 1:
	ans = 'D' * (N - 1) + 'R' * (M - 1)
	for i in range(M):
		if i % 2 == 0:
			ans += 'U' * (N - 1) + 'L'
		else:
			ans += 'D' * (N - 1) + 'L'
elif M > 1:
	ans = 'L' * (M - 1) + 'R' * (M - 1)
elif N > 1:
	ans = 'U' * (N - 1) + 'D' * (N - 1)
else:
	ans = ''
print(len(ans))
print(ans)


l = input().split()
n = int(l[0])
m = int(l[1])
k = int(l[2])
print(2 * m * n - 2)
count = 0
for i in range(n):
	for j in range(m - 1):
		if i % 2 == 0:
			print('L', end='')
			count += 1
		else:
			print('R', end='')
			count += 1
	if i != n - 1:
		print('D', end='')
if (n - 1) % 2 == 0:
	for i in range(n):
		for j in range(m - 1):
			if i % 2 == 0:
				print('R', end='')
				count += 1
			else:
				print('L', end='')
				count += 1
		if i != n - 1:
			print('U', end='')
else:
	for i in range(n):
		for j in range(m - 1):
			if i % 2 == 0:
				print('L', end='')
				count += 1
			else:
				print('R', end='')
				count += 1
		if i != n - 1:
			print('U', end='')


import sys
input = sys.stdin.readline

def main():
	(N, M, K) = [int(x) for x in input().split()]
	SJI = [[int(x) for x in input().split()] for _ in range(K)]
	FJI = [[int(x) for x in input().split()] for _ in range(K)]
	print(N - 1 + M - 1 + N * M)
	print('L' * (M - 1), end='')
	print('U' * (N - 1), end='')
	for i in range(N):
		if i % 2 == 0:
			print('R' * (M - 1), end='')
		else:
			print('L' * (M - 1), end='')
		print('D', end='')
	print('')
main()


import os
import sys
from io import BytesIO, IOBase

def main():
	(n, m, k) = map(int, input().split())
	for _ in range(2 * k):
		input()
	ans = 'U' * (n - 1) + 'L' * (m - 1)
	ans = list(ans)
	for i in range(m):
		if i & 1:
			ans.append('U' * (n - 1))
		else:
			ans.append('D' * (n - 1))
		if i != m - 1:
			ans.append('R')
	ans = ''.join(ans)
	print(len(ans))
	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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from collections import Counter
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
t = 1
for _ in range(t):
	(x, y, k) = gil()
	for _ in range(k):
		gil()
		gil()
	print(x + y + x * y - 3)
	print('U' * (x - 1), end='')
	print('L' * (y - 1), end='')
	for i in range(x):
		print(('L' if i & 1 else 'R') * (y - 1), end='')
		if i != x - 1:
			print('D', end='')
	print()


(n, m, k) = map(int, input().split())
st = [list(map(int, input().split())) for _ in range(2 * k)]
print(n * m + n + m - 3)
ans = ''
ans += 'U' * (n - 1)
ans += 'L' * (m - 1)
ans += 'D' * (n - 1)
cur = 1
while cur < m:
	ans += 'R'
	if cur % 2 == 1:
		ans += 'U' * (n - 1)
	else:
		ans += 'D' * (n - 1)
	cur += 1
print(ans)


import sys
input = lambda : sys.stdin.readline().strip()
ipnut = input

def main(t=1):
	for i in range(t):
		(n, m, k) = map(int, input().split())
		print(n + m - 2 + m * n - 1)
		print('U' * (n - 1) + 'L' * (m - 1), end='')
		for i in range(n):
			if i == 0:
				print('R' * (m - 1), end='')
			elif i % 2:
				print('D' + 'L' * (m - 1), end='')
			else:
				print('D' + 'R' * (m - 1), end='')
main()


from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

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

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	res = list(sys.stdin.readline())
	if res[-1] == '\n':
		return res[:-1]
	return res

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
	(n, m, k) = LI()
	p = LIR(k)
	g = LIR(k)
	ans = 'U' * (n - 1) + 'L' * (m - 1)
	for i in range(m):
		if not i & 1:
			ans += 'D' * (n - 1)
		else:
			ans += 'U' * (n - 1)
		if i < m - 1:
			ans += 'R'
	print(len(ans))
	if ans:
		print(ans)
	return
solve()


(n, m, k) = map(int, input().split())
for _ in range(2 * k):
	(x, y) = map(int, input().split())
action = 'L' * (m - 1) + 'U' * (n - 1)
r = 'R' * (m - 1) + 'D'
l = 'L' * (m - 1) + 'D'
action += (r + l) * (n // 2)
if n & 1:
	action += r
action = action[:-1]
print(len(action))
print(action)


(n, m, fuck) = input().split()
n = int(n)
m = int(m)
for i in range(2 * int(fuck)):
	shit = input()
answer = ''
for i in range(n - 1):
	answer += 'U'
for i in range(m - 1):
	answer += 'L'
for i in range(n):
	if i % 2 == 0:
		answer += 'R' * (m - 1)
		answer += 'D'
	else:
		answer += 'L' * (m - 1)
		answer += 'D'
print(len(answer))
print(answer)


(n, m, k) = map(int, input().split())
a = []
b = []
for i in range(k):
	a.append(map(int, input().split()))
for i in range(k):
	b.append(map(int, input().split()))
s = ''
right = 'R' * (m - 1)
left = 'L' * (m - 1)
down = 'D'
up = 'U'
s = ''
for i in range(n // 2):
	s += right
	s += down
	s += left
	s += down
if n % 2:
	s += right
	s += down
for i in range(n // 2):
	s += left
	s += up
	s += right
	s += up
if n % 2:
	s += left
	s += up
print(len(s))
print(s)


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
for tt in range(t):
	(n, m, k) = invr()
	q = []
	w = []
	a = []
	b = []
	for i in range(k * 2):
		s = inlt()
		if i < k:
			a.append(s)
		else:
			b.append(s)
	for i in range(n):
		if i % 2 == 0:
			q = q + ['L'] * (m - 1)
		else:
			q = q + ['R'] * (m - 1)
		if i != n - 1:
			q = q + ['U']
	for i in range(len(q)):
		if q[i] == 'L':
			w.append('R')
		elif q[i] == 'R':
			w.append('L')
		else:
			w.append('D')
	print(len(q) * 2)
	print(''.join(q + w))


import sys
(n, m, k) = map(int, sys.stdin.readline().split())
for i in range(2 * k):
	l = list(map(int, sys.stdin.readline().split()))
ans = ''
ans += (m - 1) * 'L'
ans += (n - 1) * 'D'
ans += (n - 1) * 'U'
for i in range(m - 1):
	if i % 2 == 0:
		ans += 'R'
		ans += (n - 1) * 'D'
	else:
		ans += 'R'
		ans += (n - 1) * 'U'
print(len(ans))
print(ans)


(n, m, k) = list(map(int, input().split()))
(p, q) = ('U' * (n - 1), 'D' * (n - 1))
s = ''
t = 0
for i in range(m):
	if t % 2 == 0:
		s += 'R'
		s += q
		t += 1
		continue
	else:
		s += 'R'
		s += p
		t += 1
for i in range(m):
	if t % 2 == 0:
		s += 'L'
		s += q
		t += 1
		continue
	else:
		s += 'L'
		s += p
		t += 1
print(len(s))
print(s)


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	(x, y) = map(int, input().split())
	ans = ''
	ans += 'U' * (n - 1)
	ans += 'L' * (m - 1)
	ans += 'D' * (n - 1)
	cur = 1
	while cur < m:
		ans += 'R'
		if cur % 2 == 1:
			ans += 'U' * (n - 1)
		else:
			ans += 'D' * (n - 1)
		cur += 1
print(n * m + n + m - 3)
print(ans)


(n, m, k) = map(int, input().split())
si = []
fi = []
for i in range(k):
	si.append(list(map(int, input().split())))
for i in range(k):
	fi.append(list(map(int, input().split())))
s = ''
s += 'U' * (n - 1) + 'L' * (m - 1)
t = 0
for i in range(n):
	if t == 0:
		s += 'R' * (m - 1)
		t = 1
	else:
		s += 'L' * (m - 1)
		t = 0
	s += 'D'
print(n * m + n + m - 3)
print(s[:-1])


(n, m, k) = (int(i) for i in input().split())
for i in range(2 * k):
	(sx, sy) = tuple(map(int, input().split()))
ans = 'R' * (m - 1) + 'U' * (n - 1)
alt = ['L', 'R']
for i in range(n):
	ans += alt[i % 2] * (m - 1)
	if i != n - 1:
		ans += 'D'
print(len(ans), ans, sep='\n')


from math import *
from bisect import bisect_left, bisect_right
from sys import stdin, stdout, setrecursionlimit
from collections import Counter
input = lambda : stdin.readline().strip()
print = stdout.write
(n, m, k) = map(int, input().split())
for i in range(k):
	map(int, input().split())
for i in range(k):
	map(int, input().split())
m -= 1
s = ''
for i in range(n):
	if not i % 2:
		for j in range(m):
			s += 'R'
	else:
		for j in range(m):
			s += 'L'
	s += 'D'
for i in range(n):
	if not i % 2:
		for j in range(m):
			s += 'L'
	else:
		for j in range(m):
			s += 'R'
	s += 'U'
print(str(len(s)) + '\n')
print(s + '\n')


(n, m, k) = map(int, input().split())
n -= 1
m -= 1
ans = 'U' * n + 'L' * m + ('R' * m + 'D' + 'L' * m + 'D') * ((n + 1) // 2) + 'R' * m * ((n + 1) % 2)
if ans and ans[-1] == 'D':
	ans = ans[:-1]
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split())
for i in range(k):
	(x, y) = map(int, input().split())
for i in range(k):
	(x, y) = map(int, input().split())
a = str()
a += 'U' * (n - 1)
a += 'L' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		a += 'R' * (m - 1)
	else:
		a += 'L' * (m - 1)
	if i != n - 1:
		a += 'D'
print(n * m + n + m - 3)
print(a)


(n, m, k) = map(int, input().split())
m -= 1
n -= 1
a = 'U' * n + 'L' * m + ''.join(('RL'[i % 2] * m + 'D' for i in range(n + 1)))
print(len(a))
print(a)


import sys, os, io
import math, bisect, operator
(inf, mod) = (float('inf'), 10 ** 9 + 7)
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, defaultdict
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
Neo = lambda : list(map(int, input().split()))
(n, m, k) = Neo()
for _ in range(2 * k):
	(x, y) = Neo()
Ans = (m - 1) * 'L' + (n - 1) * 'U'
i = 0
while i < n:
	if i % 2 == 0:
		Ans += 'R' * (m - 1)
		Ans += 'D'
	else:
		Ans += 'L' * (m - 1)
		Ans += 'D'
	i += 1
print(len(Ans) - 1)
print(Ans[:-1])


(n, m, k) = map(int, input().split())
kl = []
klist = []
for index in range(k):
	kl.append(list(map(int, input().split())))
for index in range(k):
	klist.append(list(map(int, input().split())))
ans = 'U' * n + 'L' * m
c = 0
for j in range(m):
	if c == 0:
		ans += 'D' * (n - 1)
	else:
		ans += 'U' * (n - 1)
	c = (c + 1) % 2
	ans += 'R'
print(len(ans) - 1)
print(ans[:-1])


(n, m, k) = map(int, input().split(' '))
sx = []
sy = []
fx = []
fy = []
for i in range(k):
	(x, y) = map(int, input().split(' '))
	sx.append(x)
	sy.append(y)
for i in range(k):
	(x, y) = map(int, input().split(' '))
	fx.append(x)
	fy.append(y)
path = []
symbols = 'ULRD'
for i in range(n):
	for j in range(m - 1):
		path.append(2 if i % 2 == 0 else 1)
	path.append(3)
reverse = [3 - i for i in path]
reverse.reverse()
path = path + reverse
print(len(path))
print(''.join(map(lambda x: symbols[x], path)))


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
pos = []
fipos = []
for i in range(k):
	(r, c) = map(int, input().split())
	pos.append([r, c])
for i in range(k):
	(r, c) = map(int, input().split())
	fipos.append([r, c])
s = 'U' * (n - 1) + 'L' * (m - 1)
tt = 0
for i in range(m):
	for j in range(n - 1):
		if tt % 2 == 0:
			s += 'D'
		else:
			s += 'U'
	if i != m - 1:
		s += 'R'
	tt += 1
print(len(s))
print(s)


(n, m, _) = list(map(int, input().split()))
print(2 * (n - 1) + (n + 1) * (m - 1))
print('U' * (n - 1) + 'L' * (m - 1), end='')
for i in range(n):
	if i != 0:
		print('D', end='')
	if i % 2 == 0:
		print('R' * (m - 1), end='')
	else:
		print('L' * (m - 1), end='')


(n, m, k) = list(map(int, input().split()))
sxy = []
fxy = []
for i in range(k):
	(sxi, syi) = list(map(int, input().split()))
	sxy.append([sxi, syi])
for i in range(k):
	(fxi, fyi) = list(map(int, input().split()))
	fxy.append([fxi, fyi])
print(n * m + n + m - 3)
s1 = 'D' * (n - 1) + 'R' * (m - 1)
s2 = 'U' * (n - 1)
f = 0
for i in range(m - 1):
	s2 += 'L'
	if f == 0:
		s2 += 'D' * (n - 1)
		f = 1
	else:
		s2 += 'U' * (n - 1)
		f = 0
print(s1 + s2)


(n, m, k) = map(int, input().split())
res = ['D' * (n - 1), 'R' * (m - 1)]
if n < m:
	g_left = 'L' * (m - 1)
	g_right = 'R' * (m - 1)
	up = 'U'
	s = [g_left, up, g_right, up]
	counter = 0
	for k in range(2 * n - 1):
		res.append(s[counter])
		counter += 1
		if counter == 4:
			counter = 0
else:
	v_up = 'U' * (n - 1)
	v_down = 'D' * (n - 1)
	left = 'L'
	s = [v_up, left, v_down, left]
	counter = 0
	for k in range(2 * m - 1):
		res.append(s[counter])
		counter += 1
		if counter == 4:
			counter = 0
r = ''.join(res)
print(len(r))
print(r)


from collections import Counter
import string
import bisect
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
testcases = 1
for _ in range(testcases):
	(n, m, k) = vary(2)
	for _ in range(2 * k):
		(x, y) = vary(2)
	ans = ''
	flag = 0
	for i in range(n):
		val = 'R' if flag == 0 else 'L'
		ans += val * (m - 1)
		if i == n - 1:
			continue
		ans += 'D'
		flag ^= 1
	flag = 0
	for i in range(n):
		val = 'L' if flag == 0 else 'R'
		ans += val * (m - 1)
		if i == n - 1:
			continue
		ans += 'U'
		flag ^= 1
	print(len(ans))
	print(ans)


import sys, math
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
import collections as col
import math

def solve():
	(N, M, K) = getInts()
	for k in range(2 * K):
		x = getInts()
	print(2 * N * M - 2)
	ans = ''
	for j in range(N):
		if j % 2 == 0:
			ans += 'R' * (M - 1)
		else:
			ans += 'L' * (M - 1)
		if j < N - 1:
			ans += 'D'
	for j in range(N):
		if N % 2 == 0 and j % 2 == 0 or (N % 2 == 1 and j % 2 == 1):
			ans += 'R' * (M - 1)
		else:
			ans += 'L' * (M - 1)
		if j < N - 1:
			ans += 'U'
	return ans
print(solve())


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
info = [list(map(int, input().split())) for i in range(k)]
info2 = [list(map(int, input().split())) for i in range(k)]
ans = []
for i in range(n - 1):
	ans.append('U')
for i in range(m - 1):
	ans.append('L')
for i in range(n):
	for j in range(m - 1):
		if i % 2 == 0:
			ans.append('R')
		else:
			ans.append('L')
	if i != n - 1:
		ans.append('D')
print(len(ans))
print(''.join(ans))


(n, m, k) = input().split()
n = int(n)
m = int(m)
k = int(k)
output = n - 1 + m - 1 + n * m - 1
moves = ''
for i in range(n - 1):
	moves += 'U'
for i in range(m - 1):
	moves += 'R'
for i in range(n):
	for j in range(m - 1):
		moves += 'L' if i % 2 == 0 else 'R'
	moves += 'D'
moves = moves[:len(moves) - 1]
print(output)
print(moves)


line = input().split()
(n, m, k) = (int(line[0]), int(line[1]), int(line[2]))
for i in range(k):
	line = input().split()
for i in range(k):
	line = input().split()
ans = ''
for i in range(n - 1):
	ans += 'U'
for i in range(m - 1):
	ans += 'L'
d = ['R', 'L']
for i in range(n):
	for j in range(m - 1):
		ans += d[i % 2]
	if i < n - 1:
		ans += 'D'
print(len(ans), '\n' + ans)


(n, m, k) = map(int, input().split())
for i in range(k * 2):
	input()
	s = 'D' * (n - 1) + 'R' * (m - 1)
for i in range(m):
	s += ['U' * (n - 1) + 'L', 'D' * (n - 1) + 'L'][i % 2]
print(len(s))
print(s)


(n, m, k) = map(int, input().split())
sxy = [list(map(int, input().split())) for _ in range(k)]
fxy = [list(map(int, input().split())) for _ in range(k)]
ans = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(n):
	if i != 0:
		ans += 'D'
	if i % 2 == 0:
		ans += 'R' * (m - 1)
	else:
		ans += 'L' * (m - 1)
print(len(ans))
print(ans)


from sys import stdin, stdout, setrecursionlimit
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log, pi, sin, cos
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, insort
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
(n, m, k) = mp()
for _ in range(k):
	(a, b) = mp()
for _ in range(k):
	(a, b) = mp()
s = ''
s += 'D' * (n - 1)
s += 'L' * (m - 1)
for i in range(1, n + 1):
	if i % 2 == 1:
		s += 'R' * (m - 1)
	else:
		s += 'L' * (m - 1)
	s += 'U'
print(len(s))
print(s)


import sys
input = sys.stdin.readline
(N, M, K) = map(int, input().split())
for _ in range(K):
	input()
for _ in range(K):
	input()
Ans = []
for _ in range(N - 1):
	Ans.append('U')
for _ in range(M - 1):
	Ans.append('L')
for x in range(N):
	for y in range(M - 1):
		Ans.append('R' if x % 2 == 0 else 'L')
	Ans.append('D')
print(len(Ans))
print(''.join(Ans))
assert len(Ans) <= 2 * N * M


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq 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')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 10 ** 9 + 7
EPS = 1e-06

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

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

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(n, m, k) = value()
for i in range(n):
	input()
ans = 'U' * n
ans += 'L' * m
if n == 1:
	ans = 'L' * m + 'R' * m
	print(len(ans))
	print(ans)
elif m == 1:
	ans = 'U' * n + 'D' * n
	print(len(ans))
	print(ans)
else:
	ans = 'U' * n
	ans += 'L' * m
	for i in range(n):
		if not i % 2:
			ans += 'R' * (m - 1) + 'D' * (i != n - 1)
		else:
			ans += 'L' * (m - 1) + 'D' * (i != n - 1)
	print(len(ans))
	print(ans)


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	(n, m, k) = read_ints()
	(max_x, max_y) = (-1, -1)
	for _ in range(k):
		(x, y) = read_ints()
		max_x = max(max_x, x)
		max_y = max(max_y, y)
	actions = []
	for _ in range(max_x - 1):
		actions.append('U')
	for _ in range(max_y - 1):
		actions.append('L')
	left_to_right = True
	for r in range(n):
		for _ in range(m - 1):
			if left_to_right:
				actions.append('R')
			else:
				actions.append('L')
		left_to_right = not left_to_right
		if r != n - 1:
			actions.append('D')
	return f"{len(actions)}\n{''.join(actions)}"
print(solve())


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	(a, b) = map(int, input().split())
ans = 'D' * (n - 1) + 'L' * (m - 1)
lr = ['R', 'L']
for i in range(n):
	ans += lr[i % 2] * (m - 1)
	ans += 'U'
print(len(ans))
print(ans)


def solve():
	(n, m, k) = map(int, input().split())
	for _ in range(k * 2):
		input()
	operations = ''
	for _ in range(n - 1):
		operations += 'U'
	for _ in range(m - 1):
		operations += 'L'
	isForwarding = True
	for i in range(n):
		if isForwarding:
			operations += 'R' * (m - 1)
		else:
			operations += 'L' * (m - 1)
		operations += 'D'
		isForwarding = not isForwarding
	print(len(operations))
	print(operations)
solve()


import math
(n, m, _) = map(int, input().split())
print(n + m + m * n - 3)
prefix = 'D' * (n - 1) + 'L' * (m - 1)
suffix = math.ceil(n / 2) * ('R' * (m - 1) + 'U' + 'L' * (m - 1) + 'U')
suffix = suffix[:-1 if n % 2 == 0 else -1 - m]
print(prefix + suffix)
exit()


(n, m, k) = map(int, input().split())
s = ''
for j in range(2 * k):
	(p, q) = map(int, input().split())
c = 0
for j in range(m - 1):
	s = s + 'L'
	c = c + 1
for j in range(n - 1):
	s = s + 'U'
	c = c + 1
f = 1
for j in range(n):
	if f == 1:
		s = s + 'R' * (m - 1)
		f = 2
	elif f == 2:
		s = s + 'L' * (m - 1)
		f = 1
	c = c + m
	s = s + 'D'
print(len(s))
print(s)


import sys
from enum import Enum
_DIRECTION_NAMES = 'URDL'

class Dir(Enum):
	UP = 0
	RIGHT = 1
	DOWN = 2
	LEFT = 3

class Point:

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

	def __add__(self, other):
		return Point(self.x + other.x, self.y + other.y)

	def __repr__(self):
		return '({},{})'.format(self.x, self.y)

	def __eq__(self, other):
		return self.x == other.x and self.y == other.y

	def dist(self, other):
		return abs(self.x - other.x) + abs(self.y - other.y)

	def apply_moves(self, moves):
		self.x = max(1, self.x - moves[Dir.UP])
		self.y = min(m, self.y + moves[Dir.RIGHT])
		self.x = min(n, self.x + moves[Dir.DOWN])
		self.y = max(1, self.y - moves[Dir.LEFT])
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
(n, m, k) = map(int, sys.stdin.readline().strip().split())
src_pos = []
dst_pos = []
for _ in range(k):
	(x, y) = map(int, sys.stdin.readline().strip().split())
	src_pos.append(Point(x, y))
for _ in range(k):
	(x, y) = map(int, sys.stdin.readline().strip().split())
	dst_pos.append(Point(x, y))

def solve(n, m, k, src_pos, dst_pos):
	max_x = max_y = 0
	for src in src_pos:
		max_x = max(max_x, src.x)
		max_y = max(max_y, src.y)
	r = 'U' * (max_x - 1) + 'L' * (max_y - 1)
	for i in range(n):
		if i % 2 == 0:
			r += 'R' * (m - 1)
		else:
			r += 'L' * (m - 1)
		if i != n - 1:
			r += 'D'
	return r
r = solve(n, m, k, src_pos, dst_pos)
if r is None:
	print(-1)
else:
	print('{}'.format(len(r)))
	if len(r) > 0:
		print(r)


from functools import partial
(height, width, k) = (int(x) for x in input().split(' '))
print(width - 1 + height - 1 + width * height - 1)
pr = partial(print, sep='', end='', flush=False)
for _ in range(width - 1):
	pr('L')
for _ in range(height - 1):
	pr('U')
for cur_w in range(1, width + 1):
	if cur_w % 2 == 1:
		pr('D' * (height - 1))
		if cur_w == width:
			break
		pr('R')
	else:
		pr('U' * (height - 1))
		if cur_w == width:
			break
		pr('R')
print()


(n, m, k) = map(int, input().split())
if n == 1:
	print(m + m - 2)
	print('L' * (m - 1) + 'R' * (m - 1))
elif m == 1:
	print(n + n - 2)
	print('D' * (n - 1) + 'U' * (n - 1))
else:
	res = 'U' * (n - 1) + 'L' * (m - 1)
	for i in range((n - n % 2) // 2):
		res += 'R' * (m - 1) + 'D' + 'L' * (m - 1) + 'D'
	if n % 2 == 1:
		res += 'R' * (m - 1) + 'D'
	print(len(res) - 1)
	print(res[:-1])


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
ans = 'L' * (m - 1) + 'U' * (n - 1)
for _ in range(n):
	if _:
		ans += 'D'
	ans += 'RL'[_ % 2] * (m - 1)
assert len(ans) <= 2 * m * n
print(len(ans))
print(ans)


def f1():
	import math as m
	T = int(input())
	for i in range(0, T):
		NK = [int(j) for j in input().split(' ')]
		N = NK[0]
		K = NK[1]
		if N % 2 != 0:
			if K % 2 == 0:
				print('NO')
			else:
				sqrt = int(m.sqrt(N))
				if sqrt % 2 == 0:
					sqrt = sqrt - 1
				if 1 <= K <= sqrt:
					print('YES')
				else:
					print('NO')
		elif N % 2 == 0:
			if K % 2 != 0:
				print('NO')
			else:
				sqrt = int(m.sqrt(N))
				if sqrt % 2 != 0:
					sqrt = sqrt - 1
				if 2 <= K <= sqrt:
					print('YES')
				else:
					print('NO')

def JackKnifying(X, y, n=1):
	listofX = list()
	listofy = list()
	import numpy as np
	X = np.array(X)
	y = np.array(y)
	listofX = list()
	listofy = list()
	count = 0
	for I in range(0, len(X) - 1):
		count = I
		X1 = X[0:count]
		X2 = X[count + 1:]
		y1 = y[0:count]
		y2 = y[count + 1:]
		Array2 = Array1 = list()
		if X1.shape[0] == 0:
			listofX.append(X2)
			listofy.append(y2)
		elif X2.shape[0] == 0:
			listofX.append(X1)
			listofy.append(y1)
		else:
			Array1 = np.vstack((X[0:count], X[count + 1:]))
			Array2 = np.hstack((y[0:count], y[count + 1:]))
			listofX.append(Array1)
			listofy.append(Array2)
	for i in listofX:
		print(i)
		print('-' * 80)
	for i in listofy:
		print(i)
		print('- -' * 90)
	return (listofX, listofy)

def f2():
	T = int(input())
	while T != 0:
		T = T - 1
		N = int(input())
		Matrix = list()
		Number = list()
		flag1 = True
		for i in range(0, N):
			l = [int(j) for j in input().split(' ')]
			Matrix.append(l[1:])
			Number.append(l[0])
			if l[0] != N and flag1 == True:
				flag1 = False
		pr = [False] * N
		if flag1 == True:
			print('OPTIMAL')
		else:
			qu = [False] * N
			da = 0
			for i in range(0, len(Matrix)):
				for j in range(0, len(Matrix[i])):
					if pr[Matrix[i][j] - 1] == False:
						da = da + 1
						pr[Matrix[i][j] - 1] = True
						qu[i] = True
						break
			if da == N:
				print('OPTIMAL')
			else:
				flag = False
				for i in range(0, len(qu)):
					if flag == True:
						break
					if qu[i] == False:
						for j in range(0, len(pr)):
							if pr[j] == False:
								print('IMPROVE')
								print(str(i + 1) + str(' ') + str(j + 1))
								flag = True
								break

def A3():
	Array = [int(i) for i in input().split(' ')]
	N = Array[0]
	M = Array[1]
	K = Array[2]
	Initial = list()
	Target = list()
	for i in range(0, 2 * K):
		XY = [int(j) for j in input().split(' ')]
	Sequence = ''
	for i in range(0, N - 1):
		Sequence = Sequence + 'U'
	for i in range(0, M - 1):
		Sequence = Sequence + 'L'
	Lstr = ''
	Rstr = ''
	for i in range(0, M - 1):
		Lstr = Lstr + 'L'
		Rstr = Rstr + 'R'
	for i in range(0, N):
		if i % 2 == 0:
			Sequence = Sequence + Rstr
		else:
			Sequence = Sequence + Lstr
		if i != N - 1:
			Sequence = Sequence + 'D'
	print(len(Sequence))
	print(Sequence)

def f3():
	Array = [int(i) for i in input().split(' ')]
	Initial = []
	Target = []
	K = Array[2]
	N = Array[0]
	M = Array[1]
	import random
	All = list()
	for i in range(0, K):
		XY = [int(j) for j in input().split(' ')]
		Initial.append((XY[0], XY[1]))
	for i in range(0, K):
		XY = [int(j) for j in input().split(' ')]
		Target.append((XY[0], XY[1]))
		All.append((Initial[i][0], Initial[i][1], XY[0], XY[1]))
	if N >= M:
		All = sorted(All, key=lambda x: (x[0], x[1]))
	Initial = list()
	Target = list()
	for i in range(0, K):
		Initial.append((All[i][0], All[i][1]))
		Target.append((All[i][2], All[i][3]))
	Solved = [False] * len(Initial)
	Sequence = ''
	i = 0
	while i < len(Initial):
		Solved[i] = Reached(N, M, Sequence, Initial[i], Target[i])
		if Solved[i] == False:
			New_Coord = GetCoord(N, M, Sequence, Initial[i])
			delX = New_Coord[0] - Target[i][0]
			delY = New_Coord[1] - Target[i][1]
			Sequence = Sequence + Func(delX, delY)
			Solved[i] = Reached(N, M, Sequence, Initial[i], Target[i])
		if len(Sequence) > 2 * M * N:
			print(-1)
			return
		i = i + 1
	print(len(Sequence))
	print(Sequence)

def GetCoord(N, M, S, Initial):
	Xi = Initial[0]
	Yi = Initial[1]
	for i in range(0, len(S)):
		if S[i] == 'D':
			if Xi < N:
				Xi = Xi + 1
		elif S[i] == 'U':
			if Xi > 1:
				Xi = Xi - 1
		elif S[i] == 'R':
			if Yi < M:
				Yi = Yi + 1
		elif S[i] == 'L':
			if Yi > 1:
				Yi = Yi - 1
	return (Xi, Yi)

def Reached(N, M, Strn, Initial, Target):
	Xi = Initial[0]
	Yi = Initial[1]
	Xt = Target[0]
	Yt = Target[1]
	for i in range(0, len(Strn)):
		if Strn[i] == 'D':
			if Xi < N:
				Xi = Xi + 1
		elif Strn[i] == 'U':
			if Xi > 1:
				Xi = Xi - 1
		elif Strn[i] == 'R':
			if Yi < M:
				Yi = Yi + 1
		elif Strn[i] == 'L':
			if Yi > 1:
				Yi = Yi - 1
		if Xi == Xt and Yi == Yt:
			return True
	if Xi == Xt and Yi == Yt:
		return True
	else:
		return False

def Func(delX, delY):
	CurrStr = ''
	if delX < 0:
		for j in range(0, -1 * delX):
			CurrStr = CurrStr + 'D'
	elif delX == 0:
		pass
	else:
		for j in range(0, delX):
			CurrStr = CurrStr + 'U'
	if delY < 0:
		for j in range(0, -1 * delY):
			CurrStr = CurrStr + 'R'
	elif delY == 0:
		pass
	else:
		for j in range(0, delY):
			CurrStr = CurrStr + 'L'
	return CurrStr
A3()


(n, m, k) = map(int, input().split())
xmax = 0
ymax = 0
for _ in range(k):
	(x, y) = map(int, input().split())
	xmax = max(x, xmax)
	ymax = max(y, ymax)
ans = 'U' * (xmax - 1) + 'L' * (ymax - 1)
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1) + 'D'
	else:
		ans += 'L' * (m - 1) + 'D'
print(len(ans))
print(ans)


(n, m, k) = [int(x) for x in input().split()]
(chips, dest) = ([], [])
for i in range(k):
	chips.append([int(x) for x in input().split()])
for i in range(k):
	dest.append([int(x) for x in input().split()])
ans = (n - 1) * 'U' + (m - 1) * 'L'
for i in range(n):
	if i % 2 == 0:
		ans += (m - 1) * 'R'
	else:
		ans += (m - 1) * 'L'
	if i != n - 1:
		ans += 'D'
print(len(ans))
print(ans)


def f():
	(n, m, k) = [int(s) for s in input().split()]
	if m == 1 and n == 1:
		print(1)
		print('L')
		return
	if m == 1 and n == 2:
		print(2)
		print('UD')
		return
	if m == 2 and n == 1:
		print(2)
		print('LR')
		return
	ans = []
	for i in range(m - 1):
		ans.append('L')
	for i in range(n - 1):
		ans.append('U')
	flag = 1
	for i in range(n):
		if flag:
			dir = 'R'
			flag = 0
		else:
			dir = 'L'
			flag = 1
		for j in range(m - 1):
			ans.append(dir)
		ans.append('D')
	ans = ''.join(ans[:-1])
	print(len(ans))
	print(ans)
f()


def main():
	(n, m, k) = map(int, input().split())
	s = ''
	s += (n - 1) * 'U' + (m - 1) * 'L'
	if n <= m:
		i = 1
		while i <= m:
			if i % 2 == 1:
				s += (n - 1) * 'D' + 'R'
			else:
				s += (n - 1) * 'U' + 'R'
			i += 1
	else:
		i = 1
		while i <= n:
			if i % 2 == 1:
				s += (m - 1) * 'R' + 'D'
			else:
				s += (m - 1) * 'L' + 'D'
			i += 1
	print(len(s))
	print(s)
	return
main()


from sys import stdin
input = stdin.buffer.readline
(n, m, k) = map(int, input().split())
d = {'D': 'U', 'L': 'R', 'R': 'L'}
print(2 * (n * m - 1))
s1 = ('L' * (m - 1) + 'D' + 'R' * (m - 1) + 'D') * (n - 1 >> 1) + 'L' * (m - 1)
if not n & 1:
	s1 += 'D' + 'R' * (m - 1)
s2 = ''.join((d[i] for i in s1))
print(s1, s2, sep='')


from sys import stdin

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 list(stdin.readline()[:-1])
(n, m, k) = arr_inp(1)
(pos, tar, ans) = ([arr_inp(1) for i in range(k)], [arr_inp(1) for i in range(k)], [])
ans.extend(['D' for i in range(n - 1)] + ['R' for j in range(m - 1)])
for i in range(n):
	if i % 2:
		ans.extend(['R' for j in range(m - 1)])
	else:
		ans.extend(['L' for j in range(m - 1)])
	if i < n - 1:
		ans.append('U')
print(len(ans))
print(''.join(ans))


(n, m, k) = (int(x) for x in input().split())
start = []
goal = []
for i in range(k):
	start.append([int(x) for x in input().split()])
for i in range(k):
	goal.append([int(x) for x in input().split()])
if n > 1 and m > 1:
	ans = (n - 1) * 'U' + (m - 1) * 'L'
	for i in range(n):
		if i % 2 == 0:
			ans += (m - 1) * 'R' + 'D'
		else:
			ans += (m - 1) * 'L' + 'D'
	ans = ans[:-1]
elif n == 1 and m == 1:
	ans = 'U'
elif n == 1:
	ans = (m - 1) * 'L' + (m - 1) * 'R'
elif m == 1:
	ans = (n - 1) * 'U' + (n - 1) * 'D'
print(len(ans))
print(ans)


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
S = [tuple(map(int, input().split())) for i in range(k)]
R = [tuple(map(int, input().split())) for i in range(k)]
ANS = []
for i in range(n):
	if i % 2 == 0:
		ANS += ['L'] * (m - 1)
	else:
		ANS += ['R'] * (m - 1)
	if i != n - 1:
		ANS += ['D']
ANS2 = []
for a in ANS:
	if a == 'L':
		ANS2 += ['R']
	elif a == 'R':
		ANS2 += ['L']
	else:
		ANS2 += ['U']
print(len(ANS) * 2)
print(''.join(ANS), end='')
print(''.join(ANS2))


from sys import stdin, stdout
[N, M, K] = [int(x) for x in stdin.readline().split()]
res = ''.join(['L' for n in range(M - 1)]) + ''.join(['U' for n in range(N - 1)])
for i in range(N):
	dir = 'R' if i % 2 == 0 else 'L'
	res += ''.join([dir for n in range(M - 1)]) + 'D'
res = res[:-1]
stdout.write(str(len(res)) + '\n')
stdout.write(res)


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
ans = []
for _ in range(n - 1):
	ans.append('U')
for _ in range(m - 1):
	ans.append('L')
for _ in range(n):
	if _:
		ans.append('D')
	for __ in range(m - 1):
		ans.append('R' if _ % 2 == 0 else 'L')
assert len(ans) <= 2 * m * n
print(len(ans))
print(''.join(ans))


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	(x, y) = map(int, input().split())
ans = ''
for i in range(n - 1):
	ans += 'U'
for i in range(m - 1):
	ans += 'L'
c = 1
k = ['R', 'L']
for i in range(n - 1):
	c ^= 1
	for i in range(m - 1):
		ans += k[c]
	ans += 'D'
c ^= 1
for i in range(m - 1):
	ans += k[c]
print(len(ans))
print(ans)


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]

def main():
	(n, m, k) = MI()
	ans = ''
	ans += 'L' * (m - 1)
	ans += 'U' * (n - 1)
	for i in range(n):
		if i & 1:
			ans += 'L' * (m - 1) + 'D'
		else:
			ans += 'R' * (m - 1) + 'D'
	print(m * n + m + n - 2)
	print(ans)
main()


printn = lambda x: print(x, end='')
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
ins = lambda : input().strip()
DBG = True
BIG = 10 ** 18
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)
(n, m, k) = inm()
s = []
for i in range(m - 1):
	s.append('R')
for i in range(n - 1):
	s.append('U')
dir = 1
for i in range(m):
	for j in range(n - 1):
		s.append('D' if dir == 1 else 'U')
	dir = -dir
	if i != m - 1:
		s.append('L')
print(len(s))
print(''.join(s))


(n, m, k) = map(int, input().split())
count = 0
ans = []
for i in range(m - 1):
	ans.append('L')
	count += 1
for i in range(n - 1):
	ans.append('D')
	count += 1
mode = 1
for i in range(n):
	if mode == 1:
		for i2 in range(m - 1):
			ans.append('R')
			count += 1
		mode = 0
	else:
		for i2 in range(m - 1):
			ans.append('L')
			count += 1
		mode = 1
	ans.append('U')
	count += 1
print(count)
for i in ans:
	print(i, end='')


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

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

def inv_mod(n):
	return pow(n, mod - 2, mod)

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')]

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

def check(a, s, n, m, f):
	if a == f:
		return 1
	for i in s:
		if i == 'R':
			if a[1] + 1 <= m:
				a[1] += 1
		elif i == 'L':
			if a[1] - 1 > 0:
				a[1] -= 1
		elif i == 'U':
			if a[0] - 1 > 0:
				a[0] -= 1
		elif a[0] + 1 <= n:
			a[0] += 1
		if a == f:
			return 1
	return 0
(n, m, k) = li()
ini = []
fin = []
for i in range(k):
	ini.append(li())
for i in range(k):
	fin.append(li())
s = ''
for i in range(n):
	if i & 1:
		s += 'L' * (m - 1)
	else:
		s += 'R' * (m - 1)
	if i != n - 1:
		s += 'D'
for i in range(n - 1, -1, -1):
	if i & 1:
		s += 'R' * (m - 1)
	else:
		s += 'L' * (m - 1)
	if i:
		s += 'U'
print(len(s))
print(s)


from math import inf
(N, M, K) = list(map(int, input().split()))
sarray = [list(map(int, input().split())) for line in range(K)]
farray = [list(map(int, input().split())) for line in range(K)]
horizontal = {0: 'L', 1: 'R'}
vertical = {0: 'D', 1: 'U'}
moveorder = ''
for dxn in range(2):
	for row in range(N):
		moveorder += (M - 1) * horizontal[(row + dxn) % 2]
		if row != N - 1:
			moveorder += vertical[dxn]
print(len(moveorder))
print(moveorder)


import sys

def solve():
	get_input = sys.stdin.readline
	(n, m, k) = map(int, get_input().split())
	result = ''
	fps = []
	fps_append = fps.append
	min_sy = 5000
	min_sx = 5000
	for i in range(k):
		(sx, sy) = map(int, get_input().split())
		min_sx = min(min_sx, sx)
		min_sy = min(min_sy, sy)
	for i in range(k):
		fp = list(map(int, get_input().split()))
		fps_append(fp)
	result += 'D' * (n - min_sx)
	result += 'R' * (m - min_sy)
	fps = sorted(fps, reverse=True)
	cur_pos = [n, m]
	for fp in fps:
		result += 'U' * (cur_pos[0] - fp[0])
		if cur_pos[1] >= fp[1]:
			result += 'L' * (cur_pos[1] - fp[1])
		else:
			result += 'R' * (fp[1] - cur_pos[1])
		cur_pos = fp
	print(len(result))
	print(result)
solve()


import bisect
import os
import io
from collections import Counter
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce
from collections import deque
import threading

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 factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
(n, m, k) = rinput()
starts = []
ends = []
for i in range(k):
	(a, b) = rinput()
	starts.append((a, b))
for i in range(k):
	(a, b) = rinput()
	ends.append((a, b))
if n == 1 and m == 1:
	print(0)
elif n == 1:
	print(2 * m)
	print('R' * m + 'L' * m)
elif m == 1:
	print(2 * n)
	print('D' * n + 'U' * n)
else:
	ans = 'U' * n + 'L' * m
	for i in range(n):
		if i % 2:
			ans += 'L' * (m - 1)
		else:
			ans += 'R' * (m - 1)
		ans += 'D'
	print(len(ans))
	print(ans)


(r, c, k) = map(int, input().split())
x = []
y = []
xx = []
yy = []
for i in range(k):
	(a, b) = map(int, input().split())
	x.append(a)
	y.append(b)
for i in range(k):
	(a, b) = map(int, input().split())
	xx.append(a)
	yy.append(b)
print(r - 1 + c - 1 + c * r - 1)
for i in range(r - 1):
	print('U', end='')
for i in range(c - 1):
	print('L', end='')
for i in range(r):
	if i % 2 == 0:
		for j in range(c - 1):
			print('R', end='')
		if i < r - 1:
			print('D', end='')
	else:
		for j in range(c - 1):
			print('L', end='')
		if i < r - 1:
			print('D', end='')


(n, m, k) = map(int, input().split())
chipsSRCx = []
chipsSRCy = []
chipsDESx = []
chipsDESy = []
for _ in range(k):
	(x, y) = map(int, input().split())
	chipsSRCx.append(x)
	chipsSRCy.append(y)
for _ in range(k):
	(x, y) = map(int, input().split())
	chipsDESx.append(x)
	chipsDESy.append(y)
ans = (max(chipsSRCx) - 1) * 'U'
ans += (max(chipsSRCy) - 1) * 'L'
char = 'R'
for x in range(0, n):
	ans += char * (m - 1)
	ans += 'D'
	if char == 'R':
		char = 'L'
	else:
		char = 'R'
print(len(ans) - 1)
print(ans[:-1])


from math import factorial
from collections import Counter, defaultdict
from heapq import heapify, heappop, heappush
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 RL():
	return map(int, sys.stdin.readline().rstrip().split())

def N():
	return int(input())

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
INF = float('inf')

def main():

	def pall(m, n):
		(r, l) = ('R' * (n - 1), 'L' * (n - 1))
		res = ''
		tag = 0
		for i in range(m):
			res += r if tag == 0 else l
			tag ^= 1
			if i != m - 1:
				res += 'D'
		return res
	(n, m, k) = RL()
	pos = []
	for _ in range(k):
		pos.append(list(RL()))
	tar = []
	for _ in range(k):
		tar.append(list(RL()))
	pre = 'L' * (m - 1) + 'U' * (n - 1)
	res = pre + pall(n, m)
	print(len(res))
	print(res)
main()


(n, m, k) = list(map(int, input().split()))
ans = 'U' * (n - 1) + 'L' * (m - 1)
anslis = []
for i in range(n):
	if i % 2 == 0:
		anslis.append('R' * (m - 1) + 'D')
	else:
		anslis.append('L' * (m - 1) + 'D')
ans = ans + ''.join(anslis)
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split())
print(n - 1 + (m - 1) + n * (m - 1) + (n - 1))
a = 'U' * (n - 1) + 'L' * (m - 1)
b = ''
for i in range(n):
	if i != 0:
		b += 'D'
	if i % 2 == 0:
		b += 'R' * (m - 1)
	if i % 2 == 1:
		b += 'L' * (m - 1)
print(a + b)


(n, m, k) = [int(i) for i in input().split(' ')]
for i in range(k):
	input()
	input()
out = ''
for i in range(n - 1):
	out += 'U'
for i in range(m - 1):
	out += 'L'
forward = True
for i in range(n):
	for j in range(m - 1):
		out += 'R' if forward else 'L'
	forward = not forward
	out += 'D'
print(f'{len(out)}\n{out}')


def main():
	(n, m, k) = map(int, input().split())
	ops = n - 1 + (m - 1) + n * (m - 1) + (n - 1)
	print(ops)
	moves = 'U' * (n - 1) + 'L' * (m - 1)
	for i in range(n):
		if i != 0:
			moves += 'D'
		if i % 2 == 0:
			moves += 'R' * (m - 1)
		else:
			moves += 'L' * (m - 1)
	print(moves)
main()


dimensions = list(map(int, input().split()))
for i in range(dimensions[2] * 2):
	temp = input()
result = (dimensions[0] - 1) * 'D' + (dimensions[1] - 1) * 'R'
for i1 in range(dimensions[1]):
	if i1 % 2 == 0:
		result += (dimensions[0] - 1) * 'U'
	else:
		result += (dimensions[0] - 1) * 'D'
	if i1 != dimensions[1] - 1:
		result += 'L'
print(len(result))
print(result)


from sys import stdin, stdout
import traceback
from collections import Counter
read = stdin.readline
write = stdout.write
writeln = lambda x: write(str(x) + '\n')

def reads(typ=int):
	return list(map(typ, read().split()))

class Sol:

	@classmethod
	def input(cls):
		s = cls()
		return s

	def solve(self):
		(n, m, k) = reads()
		for _ in range(k):
			reads()
		for _ in range(k):
			reads()
		res = ['L'] * (m - 1) + ['U'] * (n - 1)
		for i in range(n):
			res += ['R' if i % 2 == 0 else 'L'] * (m - 1)
			res += ['D']
		return ''.join(res[:-1])
try:
	res = Sol.input().solve()
	writeln(len(res))
	writeln(res)
except Exception as e:
	print('Got exception:', repr(e))
	print(traceback.format_exc())


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
(n, m, k) = map(int, input().split())
pos = [list(map(int, input().split())) for i in range(k)]
target = [list(map(int, input().split())) for i in range(k)]
ans = []
for i in range(m - 1):
	ans.append('L')
for i in range(n - 1):
	ans.append('U')
for i in range(n):
	if i & 1 == 0:
		ans.append('R' * (m - 1))
	else:
		ans.append('L' * (m - 1))
	if i != n - 1:
		ans.append('D')
s = ''.join(ans)
print(len(s))
if len(s):
	print(s)


(n, m, k) = map(int, input().split())
s = []
for i in range(k * 2):
	s.append(input().split())
print(n + m + n * m - 3)
a = 'U' * (n - 1) + 'R' * (m - 1)
b = 1
for i in range(n - 1):
	if i % 2 == 0:
		a = a + 'L' * (m - 1)
	else:
		a = a + 'R' * (m - 1)
	a = a + 'D'
	b = i
if b % 2 == 0:
	a = a + 'R' * (m - 1)
else:
	a = a + 'L' * (m - 1)
print(a)


import sys
(l, c, k) = map(int, sys.stdin.readline().split())
posl = 0
posc = 0
out = 'U' * (l - 1) + 'L' * (c - 1)
endc = c - 1
if l % 2 == 0:
	endc = 0
while posl != l - 1 or posc != endc:
	if posc == 0:
		out += 'R' * (c - 1)
		posc = c - 1
		if posl != l - 1:
			out += 'D'
			posl += 1
	else:
		out += 'L' * (c - 1)
		posc = 0
		if posl != l - 1:
			out += 'D'
			posl += 1
print(len(out))
print(out)


def main():
	(n, m, k) = map(int, input().split())
	lst1 = []
	for i in range(k):
		lst1.append(list(map(int, input().split())))
	lst2 = []
	for i in range(k):
		lst2.append(list(map(int, input().split())))
	a = max(lst1, key=lambda x: x[0])[0] - 1
	b = max(lst1, key=lambda x: x[1])[1] - 1
	line = ''
	line += 'L' * b
	line += 'U' * a
	for i in range(n):
		if i % 2 == 0:
			line += 'R' * (m - 1)
		else:
			line += 'L' * (m - 1)
		line += 'D'
	print(len(line) - 1)
	print(line[0:len(line) - 1])
t = 1
for i in range(t):
	main()


(n, m, k) = map(int, input().split())
for _ in range(k):
	input()
for _ in range(k):
	input()
ms = 'U' * (n - 1) + 'L' * (m - 1)
d = 'L'
for i in range(n):
	if d == 'L':
		d = 'R'
	else:
		d = 'L'
	ms += d * (m - 1) + 'D'
print(len(ms))
print(ms)


(n, m, k) = list(map(int, input().split()))
k *= 2
for i in range(k):
	(a, b) = list(map(int, input().split()))
moves = n + m + n * m - 3
print(moves)
ans = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(n):
	if i & 1:
		ans += 'L' * (m - 1)
	else:
		ans += 'R' * (m - 1)
	if i < n - 1:
		ans += 'D'
print(ans)


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

def solve(N, M, K, S, F):
	ans = ['U'] * (N - 1) + ['L'] * (M - 1)
	for i in range(N):
		if i % 2 == 0:
			ans.extend(['R'] * (M - 1))
		else:
			ans.extend(['L'] * (M - 1))
		if i != N - 1:
			ans.append('D')
	assert len(ans) <= 2 * N * M
	return str(len(ans)) + '\n' + ''.join(ans)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(N, M, K) = [int(x) for x in input().split()]
S = [[int(x) for x in input().split()] for i in range(K)]
F = [[int(x) for x in input().split()] for i in range(K)]
ans = solve(N, M, K, S, F)
print(ans)


(n, m, k) = [int(x) for x in input().split()]
start = []
final = []
for _ in range(k):
	start.append([int(x) for x in input().split()])
for _ in range(k):
	final.append([int(x) for x in input().split()])
ans = []
for _ in range(m - 1):
	ans.append('L')
for _ in range(n - 1):
	ans.append('U')
rows = 0
moveRight = True
while True:
	if moveRight:
		c = 'R'
	else:
		c = 'L'
	moveRight = not moveRight
	for _ in range(m - 1):
		ans.append(c)
	rows += 1
	if rows == n:
		break
	ans.append('D')
print(len(ans))
print(''.join([str(x) for x in ans]))


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	(a, b) = map(int, input().split())
	lis = []
lis.append('U' * (n - 1))
lis.append('L' * (m - 1))
prev = 'R'
for i in range(n):
	for j in range(m - 1):
		lis.append(prev)
	if i != n - 1:
		lis.append('D')
	if prev == 'R':
		prev = 'L'
	else:
		prev = 'R'
cnt = 0
for i in lis:
	cnt += len(i)
print(cnt)
for i in lis:
	print(i, end='')


(n, m, k) = map(int, input().split())
l1 = []
for i in range(k):
	l1.append([int(j) for j in input().split()])
l2 = []
for i in range(k):
	l2.append([int(j) for j in input().split()])
total = n * m + n + m - 3
print(total)
print('U' * (n - 1) + 'L' * (m - 1), end='')
for i in range(n):
	if i == n - 1:
		if n % 2 == 0:
			print('L' * (m - 1), end='')
		else:
			print('R' * (m - 1), end='')
	elif i % 2 == 0:
		print('R' * (m - 1), end='')
		print('D', end='')
	else:
		print('L' * (m - 1), end='')
		print('D', end='')


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()
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
(n, m, k) = I()
ans = []
for i in range(m - 1):
	ans.append('L')
for i in range(n - 1):
	ans.append('U')
top = 'U' * (n - 1)
down = 'D' * (n - 1)
for i in range(m):
	if i % 2:
		ans.append(top)
	else:
		ans.append(down)
	if i != m - 1:
		ans.append('R')
ans = ''.join(ans)
print(len(ans))
print(ans)


import sys
(n, m, k) = map(int, input().split())
g = sys.stdin.readlines()
answer = 'D' * (n - 1) + 'R' * (m - 1)
for i in range(n - 1, -1, -1):
	if i % 2 == (n - 1) % 2:
		answer += 'L' * (m - 1)
	else:
		answer += 'R' * (m - 1)
	if i != 0:
		answer += 'U'
print(len(answer))
print(answer)


import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
	(n, m, k) = nm()
	ans = ''
	for i in range(m):
		ans += 'UD'[i % 2] * (n - 1) + 'R' * (i < m - 1)
	for i in range(m):
		ans += 'DU'[i % 2] * (n - 1) + 'L' * (i < m - 1)
	print(len(ans))
	print(ans)
solve()


(a, b, c) = map(int, input().split())
moves = 'R' * (b - 1) + 'D' * (a - 1)
for i in range(a):
	if i % 2 == 0:
		moves += 'L' * (b - 1)
	else:
		moves += 'R' * (b - 1)
	if i < a - 1:
		moves += 'U'
print(len(moves))
print(moves)


moves = []
(rows, cols, chips) = map(int, input().split())
for i in range(chips):
	input()
moves.append('U' * (rows - 1))
moves.append('R' * (cols - 1))
ud = 'DU'
for i in range(cols):
	moves.append(ud[i % 2] * (rows - 1))
	moves.append('L')
moves.pop()
m = ''.join(moves)
print(len(m))
print(m)


import sys

def run_case():
	(n, m, k) = map(int, input().split())
	print(n + m - 3 + n + n * (m - 1))
	print('U' * (n - 1), end='')
	print('L' * (m - 1), end='')
	for i in range(n):
		print('R' * (m - 1) if i % 2 == 0 else 'L' * (m - 1), end='')
		if i != n - 1:
			print('D', end='')
	print()
run_case()


import sys
(n, m, k) = map(int, sys.stdin.readline().split())
s = [[int(x) for x in sys.stdin.readline().split()] for _ in range(k)]
g = [[int(x) for x in sys.stdin.readline().split()] for _ in range(k)]

def main():
	res = 'L' * (m - 1) + 'U' * (n - 1)
	for i in range(n):
		if i + 1 & 1:
			res += 'R' * (m - 1)
			if i < n - 1:
				res += 'D'
		else:
			res += 'L' * (m - 1)
			if i < n - 1:
				res += 'D'
	yield len(res)
	yield res
ans = main()
print(*ans, sep='\n')


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
dg = 1000
s = []
f = []
for i in range(k):
	(x, y) = map(int, input().split())
	s.append((x - 1) * dg + y - 1)
for i in range(k):
	(x, y) = map(int, input().split())
	f.append((x - 1) * dg + y - 1)
res = []
if n == 1:
	res.append('L' * (m - 1))
	res.append('R' * (m - 1))
	ans = ''.join(res)
	print(len(ans))
	print(ans)
elif m == 1:
	res.append('U' * (n - 1))
	res.append('D' * (n - 1))
	ans = ''.join(res)
	print(len(ans))
	print(ans)
else:
	res.append('L' * (m - 1))
	res.append('U' * (n - 1))
	flag = 1
	for i in range(n - 1):
		if flag > 0:
			res.append('R' * (m - 1))
		else:
			res.append('L' * (m - 1))
		flag = -flag
		res.append('D')
	if flag > 0:
		res.append('R' * (m - 1))
	else:
		res.append('L' * (m - 1))
	ans = ''.join(res)
	print(len(ans))
	print(ans)


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 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))
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(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

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

def solve():
	(n, m, k) = sep()
	currpos = []
	for i in range(k):
		(a, b) = sep()
		currpos.append([a, b])
	tovisit = []
	for i in range(k):
		(a, b) = sep()
		tovisit.append([a, b])
	ans = 'U' * (n - 1) + 'L' * (m - 1)
	for i in range(n):
		if i % 2 == 0:
			ans += 'R' * (m - 1)
		else:
			ans += 'L' * (m - 1)
		if i != n - 1:
			ans += 'D'
	print(len(ans))
	print(ans)
testcase(1)


(n, m, k) = map(int, input().split())
a = []
for i in range(k):
	(x, y) = map(int, input().split())
	a.append([x, y])
for i in range(k):
	(x, y) = map(int, input().split())
	a[i].append(x)
	a[i].append(y)
s = ''
if n != 1 and m != 1:
	print(n * m + n + m - 3)
elif n == 1 and m == 1:
	print(0)
else:
	print(2 * n * m - 2)
s += 'U' * (n - 1)
s += 'L' * (m - 1)
c = 0
for i in range(n):
	for j in range(m - 1):
		if c % 2 == 0:
			s += 'R'
		else:
			s += 'L'
	c = 1 - c
	s += 'D'
print(s[:-1])


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
from sys import stdout
print = stdout.write
(n, m, k) = map(int, input().split())
for _ in range(k * 2):
	a = input()
k = ['L'] * (m - 1)
j = ['R'] * (m - 1)
ans = ['D'] * (n - 1)
ans += j
ans += k
for i in range(n - 1):
	ans += ['U']
	if i % 2 == 0:
		ans += j
	else:
		ans += k
print(str(m + n + m * n - 3) + '\n')
print(''.join(ans))


(n, m, k) = map(int, input().split())
starting = []
ending = []
for x in range(0, k):
	(a, b) = map(int, input().split())
	starting.append([a, b])
for x in range(0, k):
	(a, b) = map(int, input().split())
	ending.append([a, b])
if n == 1 and m == 1:
	print(0)
	exit()
elif n == 1:
	print(2 * (m - 1))
	print('R' * (m - 1) + 'L' * (m - 1))
	exit()
elif m == 1:
	print(2 * (n - 1))
	print('D' * (n - 1) + 'U' * (n - 1))
	exit()
s = ''
s += 'U' * (n - 1)
s += 'L' * (m - 1)
for y in range(0, m):
	if y % 2 == 0:
		s += 'D' * n
	else:
		s += 'U' * n
	if y != m - 1:
		s += 'R'
print(len(s))
print(s)


(n, m, k) = list(map(int, input().split()))
L = []
F = []
for i in range(k):
	L.append(list(map(int, input().split())))
for i in range(k):
	F.append(list(map(int, input().split())))
s = ''
s += 'D' * (n - 1)
s += 'L' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		s += 'R' * (m - 1) + 'U'
	else:
		s += 'L' * (m - 1) + 'U'
print(len(s))
print(s)


(n, m, k) = list(map(int, input().split()))
for _ in range(k):
	(u, v) = list(map(int, input().split()))
for _ in range(k):
	(u, v) = list(map(int, input().split()))
ans = ''
if n == 1 or m == 1:
	if n == 1:
		print(2 * m)
		print('L' * m + 'R' * m)
	else:
		print(n * 2)
		print('D' * n + 'U' * n)
else:
	ans += 'U' * n
	ans += 'L' * m
	for i in range(n):
		for j in range(m - 1):
			if i % 2 == 0:
				ans += 'R'
			else:
				ans += 'L'
		if i + 1 < n:
			ans += 'D'
	print(len(ans))
	print(ans)


a = input('').split(' ')
n = int(a[0])
m = int(a[1])
k = int(a[2])
for i in range(k):
	a = input('')
for i in range(k):
	a = input('')
s = ''
for i in range(m - 1):
	s = s + 'R'
for j in range(n - 1):
	s = s + 'D'
for i in range(m):
	for j in range(n - 1):
		if i % 2 == 0:
			s = s + 'U'
		else:
			s = s + 'D'
	if i != m - 1:
		s = s + 'L'
ans = m - 1 + (n - 1) + m * (n - 1) + (m - 1)
print(ans)
print(s)


(n, m, k) = [int(zax) for zax in input().split()]
for i in range(k):
	l = input()
for j in range(k):
	l = input()
if n == 1 and m == 1:
	length = 1
	print(length)
	print('U')
elif n == 1:
	length = 2 * m - 2
	print(length)
	print('L' * (m - 1) + 'R' * (m - 1))
elif m == 1:
	length = 2 * n - 2
	print(length)
	print('U' * (n - 1) + 'D' * (n - 1))
else:
	length = 0
	s1 = 'L' * (m - 1)
	length += m - 1
	s2 = 'U' * (n - 1)
	length += n - 1
	l = [s1, s2]
	type = 0
	i = 1
	prev_i = 1
	if n % 2 == 1:
		goal = n * m
	else:
		goal = n * m - (m - 1)
	while True:
		if i == 1:
			l.append('R')
			length += 1
			prev_i = i
			i = 2
		elif i == goal:
			prev_i = i
			break
		elif i % m == 0:
			l.append('DL')
			length += 2
			type = 1
			prev_i = i
			i += m - 1
		elif i % m == 1:
			l.append('DR')
			length += 2
			type = 0
			prev_i = i
			i += m + 1
		elif type == 0:
			l.append('R')
			length += 1
			prev_i = i
			i += 1
		else:
			l.append('L')
			length += 1
			prev_i = i
			i -= 1
	print(length)
	print(''.join(l))


(n, m, k) = [int(x) for x in input().split()]
for i in range(2):
	for j in range(k):
		(x, y) = [int(x) for x in input().split()]
print(m + n + m * n - 3)
for i in range(n - 1):
	print('U', end='')
for i in range(m - 1):
	print('L', end='')
for i in range(n):
	if not i % 2:
		for j in range(m - 1):
			print('R', end='')
	else:
		for j in range(m - 1):
			print('L', end='')
	if i < n - 1:
		print('D', end='')


from sys import stdin
input = stdin.readline
(n, m, k) = map(int, input().rstrip().split(' '))
for i in range(k):
	_ = input()
for i in range(k):
	_ = input()
out = []
out.extend(['U'] * (n - 1))
out.extend(['L'] * (m - 1))
for i in range(n):
	if i % 2 == 0:
		out.extend(['R'] * (m - 1))
	else:
		out.extend(['L'] * (m - 1))
	out.append('D')
print(len(out))
print(''.join(out))


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	(x, y) = map(int, input().split())
num = 0
ans = (m - 1) * 'L' + (n - 1) * 'U'
num += n + m - 2
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1)
	else:
		ans += 'L' * (m - 1)
	num += m - 1
	if i != n - 1:
		ans += 'D'
		num += 1
if num == 0:
	print(1)
	print('L')
else:
	print(num)
	print(ans)


(n, m, k) = list(map(int, input().split()))
x1 = 0
y1 = 0
for i in range(k):
	(x, y) = list(map(int, input().split()))
	x1 = max(x1, x - 1)
	y1 = max(y1, y - 1)
c = 'U' * x1 + 'L' * y1
for i in range(n):
	for j in range(m - 1):
		c += 'RL'[i % 2]
	if i < n - 1:
		c += 'D'
print(len(c), c, sep='\n')


from sys import stdin, stdout

def main():
	(n, m, k) = list(map(int, stdin.readline().split()))
	for _ in range(k * 2):
		(a, b) = list(map(int, stdin.readline().split()))
	ans = ''
	ans += 'L' * (m - 1)
	ans += 'U' * (n - 1)
	for i in range(n):
		if i % 2 == 0:
			ans += 'R' * (m - 1)
		else:
			ans += 'L' * (m - 1)
		if i < n - 1:
			ans += 'D'
	stdout.write(str(len(ans)) + '\n' + ans)
main()


(n, m, k) = map(int, input().split())
(max_sx, max_sy) = (-1, -1)
for _ in range(k):
	(sx, sy) = map(int, input().split())
	max_sx = max(max_sx, sx)
	max_sy = max(max_sy, sy)
moves = []
num_of_operations = max_sx + max_sy - 2
while max_sy - 1:
	moves.append('L')
	max_sy -= 1
while max_sx - 1:
	moves.append('U')
	max_sx -= 1
cells = set()
for _ in range(k):
	cells.add(tuple(map(int, input().split())))
if (1, 1) in cells:
	cells.remove((1, 1))
row = 1
while 1:
	column = 1
	while column != m:
		moves.append('R')
		num_of_operations += 1
		if (row, column + 1) in cells:
			cells.remove((row, column + 1))
			if not cells:
				break
		column += 1
	if not cells:
		break
	row += 1
	moves.append('D')
	num_of_operations += 1
	if (row, column) in cells:
		cells.remove((row, column))
		if not cells:
			break
	while column != 1:
		moves.append('L')
		num_of_operations += 1
		if (row, column - 1) in cells:
			cells.remove((row, column - 1))
			if not cells:
				break
		column -= 1
	row += 1
	moves.append('D')
	num_of_operations += 1
	if (row, column) in cells:
		cells.remove((row, column))
		if not cells:
			break
print(num_of_operations)
print(''.join(moves))


import sys
input = sys.stdin.readline
(N, M, K) = map(int, input().split())
for _ in range(K):
	input()
for _ in range(K):
	input()
R = ['U'] * (N - 1) + ['L'] * (M - 1)
for i in range(N):
	R += ['L' if i % 2 else 'R'] * (M - 1)
	if i != N - 1:
		R.append('D')
print(len(R))
print(''.join(R))


import sys
import math
input = sys.stdin.buffer.readline
(n, m, k) = [int(c) for c in input().split()]
for i in range(2 * k):
	(i, j) = [int(c) for c in input().split()]
ans = 'L' * (m - 1) + 'U' * (n - 1)
var = 'R'
for i in range(n):
	ans += var * (m - 1)
	ans += 'D'
	if var == 'L':
		var = 'R'
	else:
		var = 'L'
ans = ans[:-1]
print(len(ans))
print(ans)


I = lambda : map(int, input().split())
(n, m, k) = I()
for _ in range(2 * k):
	input()
a = 'U' * (n - 1) + 'L' * (m - 1)
k = 'R'
for i in range(n):
	a += (m - 1) * k + 'D'
	k = 'R' if k == 'L' else 'L'
print(len(a))
print(a)


from sys import stdin, stdout
(n, m, l) = list(map(int, stdin.readline().split()))
answer = ''
counter = 0
for i in range(n - 1):
	answer += 'U'
	counter += 1
for i in range(m - 1):
	answer += 'L'
	counter += 1
for i in range(n):
	if i % 2 == 0:
		for k in range(m - 1):
			answer += 'R'
			counter += 1
	else:
		for k in range(m - 1):
			answer += 'L'
			counter += 1
	if i != n - 1:
		answer += 'D'
		counter += 1
stdout.write(str(counter) + '\n')
stdout.write(str(answer) + '\n')


(m, n, k) = [int(i) for i in input().split()]
(src, dstn) = ([], [])
for i in range(k):
	src.append(input().split())
for i in range(k):
	dstn.append(input().split())
s = ''
s += 'L' * (n - 1)
s += 'U' * (m - 1)
s += ('R' * (n - 1) + 'D' + 'L' * (n - 1) + 'D') * (m // 2)
s += 'R' * (n - 1)
print(len(s))
print(s)


(n, m, k) = [int(s) for s in input().split()]
print(m + n + m * n - 3)
print('L' * (m - 1), end='')
print('U' * (n - 1), end='')
up = True
for i in range(n - 1):
	if up:
		print('R' * (m - 1), end='')
		print('D', end='')
		up = False
	else:
		print('L' * (m - 1), end='')
		print('D', end='')
		up = True
if up:
	print('R' * (m - 1), end='')
else:
	print('L' * (m - 1), end='')


import sys
inp = sys.stdin.readline
out = sys.stdout.write
(n, m) = list(map(int, inp().split()[:2]))
result = ''
for i in range(n - 1):
	result = result + 'U'
for i in range(m - 1):
	result = result + 'L'
current = 'R'
for i in range(n):
	for j in range(m - 1):
		result = result + current
	if current == 'L':
		current = 'R'
	else:
		current = 'L'
	if i != n - 1:
		result = result + 'D'
print(len(result))
print(result)


def solve(n, m, k, s, f):
	dx = [0, 0, 1, -1]
	dy = [-1, 1, 0, 0]
	seq = 'U' * (n - 1) + 'L' * (m - 1)
	for _ in range(n // 2):
		seq += 'R' * (m - 1) + 'D' + 'L' * (m - 1) + 'D'
	seq += 'R' * (m - 1)
	print(len(seq))
	print(seq)

def main():
	(n, m, k) = [int(i) for i in input().split()]
	s = []
	f = []
	for _ in range(k):
		s.append([int(i) for i in input().split()])
	for _ in range(k):
		f.append([int(i) for i in input().split()])
	solve(n, m, k, s, f)
main()


from sys import stdin, stdout

def main():
	(N, M, K) = list(map(int, input().split()))
	res = 'D' * (N - 1) + 'L' * (M - 1)
	for i in range(M):
		if i % 2:
			res += 'D' * (N - 1)
		else:
			res += 'U' * (N - 1)
		res += 'R'
	print(len(res[:-1]))
	print(res[:-1])
main()


import sys
input = sys.stdin.readline
(n, m, k) = [int(a) for a in input().split()]
(sx, sy, fx, fy) = ([], [], [], [])
for i in range(2 * k):
	input()
s = 'U' * (n - 1) + 'L' * (m - 1)
repeat = 'R' * (m - 1) + 'D' + 'L' * (m - 1) + 'D'
s += repeat * ((n - 1) // 2)
if n % 2 == 0:
	s += repeat[:-1]
else:
	s += 'R' * (m - 1)
print(len(s))
print(s)


(n, m, k) = map(int, input().split())
source = []
dest = []
for i in range(k):
	source.append(list(map(int, input().split())))
for i in range(k):
	dest.append(list(map(int, input().split())))
s = ''
for i in range(m - 1):
	s += 'L'
for i in range(n - 1):
	s += 'U'
for i in range(m):
	if i % 2 == 0:
		ch = 'D'
	else:
		ch = 'U'
	for j in range(n - 1):
		s += ch
	if i == m - 1:
		continue
	s += 'R'
print(len(s))
print(s)


import sys
import os
from io import IOBase, BytesIO
import math
mod = 10 ** 9 + 7
pie = 3.1415926536

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

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

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

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

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

def read2DIntArray(row, col):
	arr = []
	for i in range(0, row):
		temp = list(map(int, sin().split()))
		arr.append(temp)
	return arr

def read2DCharArray(row, col):
	arr = []
	for i in range(0, row):
		temp = str(sin())
		arr.append(temp)
	return arr

def smallestNumber(n):
	lst = list(str(n))
	lst.sort()
	tmp = ''
	for (i, n) in enumerate(lst):
		if n != '0':
			tmp = lst.pop(i)
			break
	return str(tmp) + ''.join(lst)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	lst = []
	for p in range(n + 1):
		if prime[p]:
			lst.append(p)
	return lst

def nCr(n, r):
	a = 1
	b = 1
	c = 1
	for i in range(1, n + 1):
		c *= i
	for i in range(1, r + 1):
		b *= i
	for i in range(1, n - r + 1):
		a *= i
	return c // (a * b)

def sieveOfEratosthenes1(N, s):
	prime = [False] * (N + 1)
	for i in range(2, N + 1, 2):
		s[i] = 2
	for i in range(3, N + 1, 2):
		if prime[i] == False:
			s[i] = i
			for j in range(i, int(N / i) + 1, 2):
				if prime[i * j] == False:
					prime[i * j] = True
					s[i * j] = i

def generatePrimeFactors(N):
	s = [0] * (N + 1)
	sieveOfEratosthenes1(N, s)
	curr = s[N]
	cnt = 1
	factors = []
	power = []
	while N > 1:
		N //= s[N]
		if curr == s[N]:
			cnt += 1
			continue
		factors.append(curr)
		power.append(cnt)
		curr = s[N]
		cnt = 1
	return (factors, power)

def main():
	(n, m, k) = map(int, sin().split())
	for _ in range(2 * k):
		(x, y) = map(int, sin().split())
	res = ''
	for _ in range(m - 1):
		res += 'L'
	for _ in range(n - 1):
		res += 'D'
	for i in range(m):
		for j in range(n - 1):
			if i % 2 == 0:
				res += 'U'
			else:
				res += 'D'
		if i != m - 1:
			res += 'R'
	print(len(res))
	print(res)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
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))

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


def main():
	(n, m, k) = map(int, input().split())
	act = ['U' * (n - 1) + 'L' * (m - 1)]
	for i in range(n):
		if i % 2 == 0:
			act.append('R' * (m - 1))
		else:
			act.append('L' * (m - 1))
		if i + 1 != n:
			act.append('D')
	ans = ''.join(act)
	print(len(ans))
	print(ans)
main()


(n, m, k) = list(map(int, input().split()))
for i in range(2 * k):
	(x, y) = map(int, input().split())
ans = ''
if n == 1 and m == 1:
	print(0)
else:
	if n == 1 and m > 1:
		for i in range(m - 1):
			ans += 'L'
		for i in range(1, m):
			ans += 'R'
	elif n > 1 and m == 1:
		for i in range(n - 1):
			ans += 'U'
		for i in range(1, n):
			ans += 'D'
	else:
		for i in range(n - 1):
			ans += 'U'
		for i in range(m - 1):
			ans += 'L'
		start = 1
		end = n
		dir1 = 1
		for i in range(1, m + 1):
			for j in range(start, end, dir1):
				if i % 2 != 0:
					ans += 'D'
				else:
					ans += 'U'
			if j == n - 1:
				ans += 'R'
				dir1 = -1
				start = n - 1
				end = 0
			elif j == 1:
				ans += 'R'
				dir1 = 1
				start = 1
				end = n
			if i == m and j == n - 1:
				break
	print(len(ans))
	print(ans)


t = 1
for _ in range(t):
	(n, m, k) = map(int, input().split())
	df = []
	for i in range(2 * k):
		l = input().split()
		df.append(l)
	ans = ''
	ans += 'U' * (n - 1) + 'L' * (m - 1)
	last = 'L'
	while n > 0:
		if last == 'L':
			ans += 'R' * (m - 1)
			last = 'R'
		else:
			ans += 'L' * (m - 1)
			last = 'L'
		n -= 1
		if n:
			ans += 'D'
	print(len(ans))
	print(ans)


(n, m, k) = map(int, input().split())
mad = 1
mar = 1
for i in range(k):
	(x, y) = map(int, input().split())
	mad = max(mad, x)
	mar = max(mar, y)
for i in range(k):
	(mmm, nnn) = map(int, input().split())
print(mad + mar - 2 + m * n)
print('U' * (mad - 1) + 'L' * (mar - 1), end='')
uu = 'R' * (m - 1)
dd = 'L' * (m - 1)
for i in range(n):
	if i % 2 != 0:
		print(dd, end='')
		print('D', end='')
	else:
		print(uu, end='')
		print('D', end='')


(lx, ly, nc) = map(int, input().split())
s = 'L' * (ly - 1) + 'U' * (lx - 1)
cur = 0
for i in range(ly):
	if i:
		s += 'R'
	s += 'DU'[cur] * (lx - 1)
	cur = 1 - cur
print(len(s))
print(s)


(n, m, k) = [int(i) for i in input().split()]
for i in range(2 * k):
	arr = input()
if n == 1:
	s = 'L' * m
	s += 'R' * (m - 1)
	print(len(s))
	print(s)
elif m == 1:
	s = 'U' * n
	s += 'D' * (n - 1)
	print(len(s))
	print(s)
else:
	s = 'U' * n
	s += 'L' * m
	for i in range(m):
		if i % 2 == 0:
			s += 'D' * (n - 1)
		else:
			s += 'U' * (n - 1)
		if i != m - 1:
			s += 'R'
	print(len(s))
	print(s)


def solver(n, m, k):
	print(n + m + n * m - 2)
	print('U' * (n - 1) + 'L' * (m - 1), end='')
	dirc = 'R'
	for i in range(n):
		if dirc == 'R':
			print('R' * (m - 1) + 'D', end='')
			dirc = 'L'
		else:
			print('L' * (m - 1) + 'D', end='')
			dirc = 'R'
	print()
(n, m, k) = map(int, input().split())
for _ in range(2 * k):
	waste = input()
solver(n, m, k)


(n, m, k) = map(int, input().split(' '))
arr = [input().split(' ') for i in range(2 * k)]
arr1 = []
arr2 = []
moves = ''
for i in range(k):
	arr1.append(int(arr[i][0]))
for j in range(k):
	arr2.append(int(arr[j][1]))
max1 = max(arr1)
max2 = max(arr2)
moves += (max2 - 1) * 'L' + (max1 - 1) * 'U'
for k in range(n):
	if k % 2 == 0:
		moves += (m - 1) * 'R' + 'D'
	else:
		moves += (m - 1) * 'L' + 'D'
print(len(moves))
print(moves)


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

def print(x):
	sys.stdout.write(str(x) + '\n')
(n, m, k) = map(int, input().split())
sxm = 0
sym = 0
for i in range(k):
	(sx, sy) = map(int, input().split())
	sym = max(sy, sym)
	sxm = max(sx, sxm)
sxf = 0
syf = 0
for i in range(k):
	(fx, fy) = map(int, input().split())
	syf = max(fy, syf)
	sxf = max(fx, sxf)
ans = n - 1 + m - 1
st = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		st += 'R' * (m - 1)
	else:
		st += 'L' * (m - 1)
	ans += m
	st += 'D'
print(ans - 1)
print(st[:-1])


def solve(n, m):
	moves = 2 * (n - 1) + (n + 1) * (m - 1)
	string = 'U' * (n - 1) + 'L' * (m - 1)
	for i in range(n):
		if i != 0:
			string += 'D'
		if i % 2 == 0:
			string += 'R' * (m - 1)
		else:
			string += 'L' * (m - 1)
	print(moves)
	print(string)
	return
(n, m, k) = [int(x) for x in input().split()]
li = [[int(j) for j in input().split()] for i in range(2 * k)]
solve(n, m)


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	(x, y) = map(int, input().split())
ans = []
if n == 1 and m == 1:
	print(0)
	exit()
else:
	for i in range(m - 1):
		ans.append('R')
	for i in range(n - 1):
		ans.append('D')
	for j in range(n):
		if j % 2 == 0:
			for i in range(m - 1):
				ans.append('L')
			ans.append('U')
		else:
			for i in range(m - 1):
				ans.append('R')
			ans.append('U')
	print(len(ans))
	print(''.join(map(str, ans)))


import os
import sys
if os.path.exists('/mnt/c/Users/Square/square/codeforces'):
	f = iter(open('C.txt').readlines())

	def input():
		return next(f).strip()
else:
	input = lambda : sys.stdin.readline().strip()
fprint = lambda *args: print(*args, flush=True)
import itertools
for _ in range(1):
	(n, m, k) = map(int, input().split())
	res = ['D'] * (n - 1) + ['L'] * (m - 1)
	for i in range(k):
		input()
	for i in range(k):
		input()
	for i in range(n):
		res += ['R' if i % 2 == 0 else 'L'] * (m - 1)
		res.append('U')
	print(len(res))
	print(''.join(res))


import math
import collections
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect_left as bsl
from bisect import bisect_right as bsr
import heapq as hq
setrecursionlimit(2 ** 20)
t = 1
for _ in range(t):
	(n, m, k) = list(map(int, stdin.readline().rstrip().split()))
	for j in range(2 * k):
		(t1, t2) = list(map(int, stdin.readline().rstrip().split()))
	print(2 * (n - 1) + (n + 1) * (m - 1))
	print('U' * (n - 1) + 'L' * (m - 1), end='')
	for i in range(n):
		if i != 0:
			print('D', end='')
		if i % 2 == 0:
			print('R' * (m - 1), end='')
		else:
			print('L' * (m - 1), end='')


(m, n, k) = map(int, input().split())
s = []
for i in range(k):
	s.append(tuple(map(int, input().split())))
f = []
for i in range(k):
	f.append(tuple(map(int, input().split())))
ans = 'L' * (n - 1) + 'U' * (m - 1)
xdirections = ['R', 'L']
for i in range(m):
	direction = xdirections[i % 2]
	ans += direction * (n - 1)
	ans += 'D'
ans = ans[:-1]
print(n + m + n * m - 3)
print(ans)


from sys import stdout, stdin
for _ in range(1):
	(n, m, k) = map(int, stdin.readline().split())
	currpos = []
	for i in range(k):
		(x, y) = map(int, stdin.readline().split())
		currpos.append([x, y])
	finalpos = []
	for i in range(k):
		(x, y) = map(int, stdin.readline().split())
		finalpos.append([x, y])
	s = ''
	s += 'U' * n
	s += 'L' * m
	for i in range(n):
		if i % 2 == 0:
			s += 'R' * (m - 1)
		else:
			s += 'L' * (m - 1)
		if i != n - 1:
			s += 'D'
	stdout.write(f'{len(s)}\n')
	stdout.write(s)


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()
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 ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r))

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():
	(n, m, k) = mi()
	a = []
	b = []
	for i in range(k):
		a.append(li())
	for i in range(k):
		b.append(li())
	ans = ''
	for i in range(n - 1):
		ans += 'U'
	for i in range(m - 1):
		ans += 'L'
	f = 0
	for i in range(n):
		f ^= 1
		for j in range(m - 1):
			if f == 1:
				ans += 'R'
			else:
				ans += 'L'
		if i != n - 1:
			ans += 'D'
	print(len(ans))
	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()


from sys import exit

def i():
	return input()

def ii():
	return int(input())

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

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

def print_array(a):
	print(' '.join(map(str, a)))
(n, m, k) = iis()

def move(side, distances, chips):
	if side == 'L':
		for i in distances:
			i[0] = max(0, i[0] - 1)
	elif side == 'R':
		for i in distances:
			i[0] = min(len(distances[0]) - 1, i[0] + 1)
	elif side == 'U':
		for i in distances:
			i[1] = max(0, i[1] - 1)
	else:
		for i in distances:
			i[1] = min(i[1] + 1, len(distances) - 1)
	for i in range(len(distances)):
		if distances[i][0] == 0 and distances[i][1] == 0:
			chips.discard(i)
	return (distances, chips)
ans = []
cur = []
chips = set()
for i in range(k):
	cur.append(liis())
	chips.add(i)
should = []
for i in range(k):
	should.append(liis())
for i in range(n - 1):
	ans.append('U')
for i in range(m - 1):
	ans.append('L')
flag = True
for i in range(n):
	for j in range(m - 1):
		if flag:
			ans.append('R')
		else:
			ans.append('L')
	flag = not flag
	if i != n - 1:
		ans.append('D')
print(len(ans))
print(''.join(ans))


(n, m, k) = map(int, input().split())

def fill():
	x = 1
	y = 1
	res = ''
	direction = 'right'
	while x <= n:
		if direction == 'right':
			while y < m:
				y += 1
				res += 'R'
				direction = 'left'
		else:
			while y > 1:
				y -= 1
				res += 'L'
				direction = 'right'
		x += 1
		if x > n:
			break
		res += 'D'
	return res
res = ''
res += 'L' * (m - 1)
res += 'U' * (n - 1)
res += fill()
print(m - 1 + n - 1 + n * m - 1)
print(res)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
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 YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		(m, n, k) = LI()
		sf = []
		for _ in range(k):
			s = LI()
			f = LI()
			sf.append(s + f)
		r = 'L' * (n - 1) + 'U' * (m - 1)
		for i in range(n):
			if i % 2 == 0:
				r += 'D' * (m - 1)
			else:
				r += 'U' * (m - 1)
			r += 'R'
		rr.append(len(r))
		rr.append(r)
	return JA(rr, '\n')
print(main())


def get(x, n):
	if x <= 0:
		return 0
	if x >= n:
		return n
	return x
(n, m, k) = map(int, input().split())
s = []
f = []
for i in range(k):
	(x, y) = map(int, input().split())
	s.append((x, y))
for i in range(k):
	(x, y) = map(int, input().split())
	f.append((x, y))
print(n + m + n * m - 1)
for i in range(m):
	print('L', end='')
for i in range(n):
	print('U', end='')
ct = 0
for i in range(n):
	if ct % 2 == 0:
		for j in range(m - 1):
			print('R', end='')
	else:
		for j in range(m - 1):
			print('L', end='')
	if i < n - 1:
		print('D', end='')
	ct += 1
print()


(n, m, k) = map(int, input().split())
l = ''
for a in range(2 * k):
	input()
for i in range(n - 1):
	l = l + 'U'
for j in range(m - 1):
	l = l + 'L'
for h in range(n * m - 1):
	if h % m == m - 1:
		l = l + 'D'
	elif h // m % 2 == 0:
		l = l + 'R'
	else:
		l = l + 'L'
print(len(l))
print(l)


import sys, os, io
(n, m, k) = [int(i) for i in input().split()]
for i in range(2 * k):
	input()
r = 'R' * (m - 1)
l = 'L' * (m - 1)
print(2 * m * n)
for i in range(n):
	if i % 2:
		print(l, end='')
		if i != n - 1:
			print('D', end='')
	else:
		print(r, end='')
		if i == 0:
			print('R', end='')
		if i != n - 1:
			print('D', end='')
for i in range(n - 1, -1, -1):
	if i % 2:
		print(r, end='')
		if i == n - 1:
			print('R', end='')
		print('U', end='')
	else:
		print(l, end='')
		if i == n - 1:
			print('L', end='')
		if i != 0:
			print('U', end='')
print()


mod = 10 ** 9
(n, m, k) = map(int, input().split())
start = []
final = []
for i in range(k):
	(X, Y) = map(int, input().split())
	Z = []
	Z.append(X)
	Z.append(Y)
	start.append(Z)
for j in range(k):
	(X, Y) = map(int, input().split())
	Z = []
	Z.append(X)
	Z.append(Y)
	final.append(Z)
StringX = ''
X = 'U' * (n - 1)
X = X + 'L' * (m - 1)
for i in range(m):
	for j in range(n - 1):
		if i % 2 == 1:
			X += 'U'
		else:
			X += 'D'
	X += 'R'
print(len(X))
print(X)


def main():
	import sys
	input = sys.stdin.readline
	(n, m, k) = map(int, input().split())
	ans = 'L' * (m - 1) + 'U' * (n - 1)
	flag = 1
	for i in range(m):
		if flag == 1:
			ans += 'D' * (n - 1) + 'R'
		else:
			ans += 'U' * (n - 1) + 'R'
		flag *= -1
	print(len(ans))
	print(ans)
main()


(n, m, k) = map(int, input().split())
sx = sy = -1
for _ in range(k):
	(csx, csy) = tuple(map(int, input().split()))
	sx = max(sx, csx)
	sy = max(sy, csy)
ans = ''
ans += 'U' * (sx - 1)
ans += 'L' * (sy - 1)
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1)
	else:
		ans += 'L' * (m - 1)
	if i != n - 1:
		ans += 'D'
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split())
s = []
f = []
st = ''
for _ in range(k):
	s.append(list(map(int, input().split())))
for _ in range(k):
	f.append(list(map(int, input().split())))
s.sort()
f.sort()
st += (n - 1) * 'U' + (m - 1) * 'L'
for i in range(1, 1 + n):
	if i % 2 == 0:
		st += 'L' * (m - 1)
	else:
		st += 'R' * (m - 1)
	if i != n:
		st += 'D'
if len(st) <= 2 * m * n:
	print(str(len(st)) + '\n' + st)
else:
	print('-1')


a = [int(i) for i in input().split()]
n = a[0]
m = a[1]
k = a[2]
s = []
for _ in range(k):
	s.append([int(i) for i in input().split()])
f = []
for _ in range(k):
	f.append([int(i) for i in input().split()])
ans = []
ans.append((n - 1) * 'U')
ans.append((m - 1) * 'L')
for i in range(n):
	if i != 0:
		ans.append('D')
	if i % 2 == 0:
		ans.append((m - 1) * 'R')
	else:
		ans.append((m - 1) * 'L')
ans = ''.join(ans)
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split(' '))
chips_start = []
chips_end = []
for i in range(k):
	(row, col) = map(int, input().split(' '))
	chips_start.append([row, col])
for i in range(k):
	(row, col) = map(int, input().split(' '))
	chips_end.append([row, col])
moves = []
for i in range(n - 1):
	moves.append('U')
for i in range(m - 1):
	moves.append('L')
at_top = True
for i in range(m):
	if at_top:
		for j in range(n - 1):
			moves.append('D')
		at_top = False
	else:
		for j in range(n - 1):
			moves.append('U')
		at_top = True
	moves.append('R')
if len(moves) > 2 * n * m:
	print(-1)
else:
	print(len(moves))
	print(''.join(moves))


(n, m, k) = map(int, input().split())
l = []
z = []
for i in range(0, k):
	z.append(list(map(int, input().split())))
for i in range(0, k):
	l.append(list(map(int, input().split())))
if m * n == 1:
	print(0)
elif m * n == max(m, n):
	if m != 1:
		print(2 * m - 2)
		print('L' * (m - 1) + 'R' * (m - 1))
	else:
		print(2 * n - 2)
		print('U' * (n - 1) + 'D' * (n - 1))
else:
	s = 'R' * (m - 1) + 'U' * (n - 1)
	c = 0
	while n != 0:
		if c % 2 == 0:
			s = s + 'L' * (m - 1)
		else:
			s = s + 'R' * (m - 1)
		s = s + 'D'
		n = n - 1
		c = c + 1
	print(len(s) - 1)
	print(s[0:len(s) - 1])


from math import ceil, floor
(n, m, k) = map(int, input().split())
s = dict()
d = dict()
ans = ''
for i in range(k):
	s[i + 1] = list(map(int, input().split()))
for i in range(k):
	d[i + 1] = list(map(int, input().split()))
u = n - 1
d = n - 1
l = m - 1 + ceil(n / 2) * (m - 1)
r = floor(n / 2) * (m - 1)
ans = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		ans = ans + 'R' * (m - 1)
	else:
		ans = ans + 'L' * (m - 1)
	if i != n - 1:
		ans = ans + 'D'
s = l + d + u + r
if s > 2 * n * m:
	print(-1)
else:
	print(s)
	print(ans)


def task4(n, m, k, start, end):
	print(n + m + n * m - 3)
	for i in range(n - 1):
		print('U', end='')
	for i in range(m - 1):
		print('L', end='')
	for i in range(n):
		if i:
			print('D', end='')
		for j in range(m - 1):
			if i % 2:
				print('L', end='')
			else:
				print('R', end='')
[n, m, k] = input().split()
start = []
end = []
for i in range(int(k)):
	[x, y] = input().split()
	start.append([int(x), int(y)])
for i in range(int(k)):
	[x, y] = input().split()
	end.append([int(x), int(y)])
task4(int(n), int(m), int(k), start, end)


from sys import stdin
input = stdin.readline
(n, m, k) = map(int, input().split())
s = ''
for _ in range(2 * k):
	input()
if n == m == 1:
	print(0)
elif m == 1:
	s = 'U' * (n - 1) + 'D' * (n - 1)
	print(len(s))
	print(s)
elif n == 1:
	s = 'R' * (m - 1) + 'L' * (m - 1)
	print(len(s))
	print(s)
else:
	s = 'U' * (n - 1) + 'L' * (m - 1)
	for x in range(n):
		if x % 2 == 0:
			s += 'R' * (m - 1) + 'D'
		else:
			s += 'L' * (m - 1) + 'D'
	print(len(s) - 1)
	print(s[:-1])


(n, m, k) = map(int, input().split(' '))
ip = []
fp = []
for i in range(k):
	(x, y) = map(int, input().split(' '))
	ip.append([x, y])
for i in range(k):
	(x, y) = map(int, input().split(' '))
	fp.append([x, y])
(lu, ld, ru, rd) = ([], [], [], [])
print(n + m + n * m - 3)
print('U' * (n - 1), end='')
print('L' * (m - 1), end='')
for i in range(n):
	if i != 0:
		print('D', end='')
	if i % 2 == 0:
		print('R' * (m - 1), end='')
	else:
		print('L' * (m - 1), end='')


(n, m, k) = map(int, input().split())
moves = 'U' * (n - 1) + 'R' * (m - 1)
for i in range(0, n):
	moves += (m - 1) * 'LR'[i % 2]
	moves += 'D'
print(len(moves))
print(moves)


(n, m, k) = map(int, input().split())
ans = 'L' * (m - 1) + 'U' * (n - 1)
ans = list(ans)
cur = 'R'
for x in range(1, n + 1):
	ans.extend(cur * (m - 1))
	if x != n:
		ans.append('D')
	cur = 'L' if cur == 'R' else 'R'
print(len(ans))
print(''.join(ans))


(n, m, k) = map(int, input().split())
s = list(['U' for x in range(n - 1)])
s.extend(['L' for x in range(m - 1)])
odd = ['L' for x in range(m - 1)]
even = ['R' for x in range(m - 1)]
for x in range(2 * k):
	(a, b) = input().split()
for y in range(n):
	if y % 2 == 0:
		s.extend(even)
	else:
		s.extend(odd)
	s.append('D')
print(len(s) - 1)
print(''.join(s[:len(s) - 1]))


(x, y, k) = map(int, input().split())
for _ in range(2 * k):
	input()
accu = 'L' * y + 'U' * x
flag = True
for i in range(x - 1):
	if flag:
		accu += 'R' * (y - 1)
		flag = False
	else:
		accu += 'L' * (y - 1)
		flag = True
	accu += 'D'
if flag:
	accu += 'R' * (y - 1)
else:
	accu += 'L' * (y - 1)
print(len(accu))
print(accu)


from math import *
(n, m, k) = map(int, input().split())
a = []
for i in range(k):
	a.append([int(i) for i in input().split()])
b = []
for i in range(k):
	b.append([int(i) for i in input().split()])
c = []
for i in range(k):
	c.append([b[i][0] - a[i][0], b[i][1] - a[i][1]])
s = (n - 1) * 'U' + (m - 1) * 'L'
ci = 0
for i in range(m):
	if ci == 0:
		s += 'D' * (n - 1)
	else:
		s += 'U' * (n - 1)
	ci = 1 - ci
	s += 'R'
print(len(s))
print(s)


(n, m, k) = map(int, input().split())
ans = 'L' * (m - 1) + 'U' * (n - 1)
for i in range(1, n + 1):
	ans += 'LR'[i % 2] * (m - 1)
	if i != n:
		ans += 'D'
print(len(ans))
print(ans)


a = [int(x) for x in input().split()]
n = a[0]
m = a[1]
k = a[2]
corona = input()
covid_19 = input()
R = 'R' * (m - 1)
L = 'L' * (m - 1)
U = 'U' * (n - 1)
D = 'D' * (n - 1)
ans = ''
ans += R + U
for i in range(n):
	if i % 2 == 0:
		ans += L
	else:
		ans += R
	if i != n - 1:
		ans += 'D'
print(n - 1 + (m - 1) + n * m - 1)
print(ans)


from sys import stdin
(n, m, k) = map(int, stdin.readline().split())
start = []
for _ in range(k):
	(x, y) = map(int, stdin.readline().split())
	start.append((x, y))
end = []
for _ in range(k):
	(x, y) = map(int, stdin.readline().split())
	end.append((x, y))
time = 0
max_x = 0
max_y = 0
for (x, y) in start:
	if x > max_x:
		max_x = x
	if y > max_y:
		max_y = y
string = ''
for _ in range(max_x - 1):
	time += 1
	string += 'U'
for _ in range(max_y - 1):
	time += 1
	string += 'L'
for i in range(n):
	for j in range(m - 1):
		if i % 2 == 0:
			string += 'R'
		else:
			string += 'L'
		time += 1
	string += 'D'
	time += 1
print(time - 1)
print(string[:-1])


(n, m, k) = list(map(int, input().split()))
for i in range(k):
	(sx, sy) = map(int, input().split())
for i in range(k):
	(fx, fy) = map(int, input().split())
ans = 'L' * (m - 1) + 'U' * (n - 1)
for i in range(n):
	if i != 0:
		ans = ans + 'D'
	if i % 2 == 0:
		ans = ans + 'R' * (m - 1)
	elif i % 2 != 0:
		ans = ans + 'L' * (m - 1)
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split())
a = []
b = []
for i in range(k):
	g = list(map(int, input().split()))
	a.append(g)
for i in range(k):
	g = list(map(int, input().split()))
	b.append(g)
print(n - 1 + (m - 1) + n * (m - 1) + (n - 1))
ans = 'U' * (n - 1)
ans += 'L' * (m - 1)
for i in range(n):
	if i != 0:
		ans += 'D'
	if i % 2 == 0:
		ans += 'R' * (m - 1)
	else:
		ans += 'L' * (m - 1)
print(ans)


import sys
import heapq
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

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

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

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 [l1d(n, val) for j in range(m)]
(n, m, k) = sp()
answer = []
for i in range(k):
	l()
for i in range(k):
	l()
answer.extend(['D'] * (n - 1))
answer.extend(['R'] * (m - 1))
c = 'L'
for i in range(n):
	for j in range(m - 1):
		answer.append(c)
	if i != n - 1:
		answer.append('U')
	if c == 'L':
		c = 'R'
	else:
		c = 'L'
out(str(len(answer)) + '\n' + ''.join(answer))


t = input()
n = int(t.split(' ')[0])
m = int(t.split(' ')[1])
k = int(t.split(' ')[2])
out = []
for i in range(0, k):
	b = input()
for i in range(0, k):
	b = input()
if n > 1 and m > 1:
	print(2 * (n - 1) + (n + 1) * (m - 1))
	print('U' * (n - 1) + 'L' * (m - 1), end='')
	for i in range(n):
		if i != 0:
			print('D', end='')
		if i % 2 == 0:
			print('R' * (m - 1), end='')
		else:
			print('L' * (m - 1), end='')
elif n == 1:
	out.append('R' * (m - 1))
	out.append('L' * (m - 1))
	print(2 * m - 2)
else:
	out.append('U' * (n - 1))
	out.append('D' * (n - 1))
	print(2 * n - 2)
for i in range(0, len(out)):
	print(out[i], end='')


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
(r, c, k) = R()
for _ in range(2 * k):
	S()
print(r - 1 + c - 1 + c * r)
print('U' * (r - 1) + 'L' * (c - 1) + ''.join(['L' * (c - 1) + 'D' if i & 1 else 'R' * (c - 1) + 'D' for i in range(r)]))


(n, m, k) = list(map(int, input().split()))
(m, n) = (n, m)
out = ''
out += 'D' * (m - 1)
out += 'L' * (n - 1)
out += 'U' * (m - 1)
iter = 1
while iter < n:
	out += 'R'
	if iter % 2 == 1:
		out += 'D' * (m - 1)
	else:
		out += 'U' * (m - 1)
	iter += 1
print(len(out))
print(out)


(n, m, k) = map(int, input().split())
for i in range(k):
	(sx, sy) = map(int, input().split())
for i in range(k):
	(fx, fy) = map(int, input().split())
s = 'L' * (m - 1) + 'U' * (n - 1)
for i in range(n):
	if i % 2 == 0:
		s += 'R' * (m - 1) + 'D'
	else:
		s += 'L' * (m - 1) + 'D'
print(len(s))
print(s)


from sys import stdin, stdout
import math
import heapq
t = 1

def aint():
	return int(input().strip())

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

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

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

def main():
	(n, m, k) = lint()
	s = 'U' * (n - 1) + 'L' * (m - 1)
	for i in range(n):
		if i % 2 == 0:
			s += 'R' * (m - 1) + 'D'
		else:
			s += 'L' * (m - 1) + 'D'
	print(len(s))
	print(s)
t = 1
for i in range(t):
	main()


(n, m, k) = map(int, input().split())
for i in range(2 * k):
	_ = input()
if n == 1 and m == 1:
	print(0)
elif n == 1:
	print(2 * m)
	print('R' * m + 'L' * m)
elif m == 1:
	print(2 * n)
	print('U' * n + 'D' * n)
else:
	print(m * (n - 1) + m - 1 + n - 1 + m - 1)
	s = 'R' * (m - 1) + 'U' * (n - 1)
	D = 'D' * (n - 1)
	L = 'L'
	U = 'U' * (n - 1)
	down = True
	for i in range(m):
		if down:
			s += D
		else:
			s += U
		s += L
		down = not down
	print(s[:-1])


import sys
input = sys.stdin.readline
from math import *
t = 1
while t > 0:
	t -= 1
	(n, m, k) = map(int, input().split())
	s = ''
	for i in range(n):
		if i % 2 == 0:
			s += 'R' * (m - 1)
			if i != n - 1:
				s += 'D'
		else:
			s += 'L' * (m - 1)
			if i != n - 1:
				s += 'D'
	for i in range(n):
		if i % 2 == 0:
			s += 'L' * (m - 1)
			if i != n - 1:
				s += 'U'
		else:
			s += 'R' * (m - 1)
			if i != n - 1:
				s += 'U'
	print(len(s))
	print(s)


(n, m, k) = map(int, input().split())
s = []
for i in range(k):
	(x, y) = map(int, input().split())
	s.append([x, y])
f = []
for i in range(k):
	(x, y) = map(int, input().split())
	f.append([x, y])
print(m + n - 2 + m * n - 1)
print('L' * (m - 1) + 'U' * (n - 1), end='')
for i in range(m):
	if i % 2:
		print('U' * (n - 1), end='')
	else:
		print('D' * (n - 1), end='')
	if i < m - 1:
		print('R', end='')


(n, m, k) = map(int, input().split())
starts = []
ends = []
for _ in range(k):
	(sx, sy) = map(int, input().split())
	starts.append((sx, sy))
for _ in range(k):
	(sx, sy) = map(int, input().split())
	ends.append((sx, sy))
if n == 1 and m == 2:
	print('2\nLR')
else:
	res = 'U' * (n - 1) + 'L' * (m - 1) + (('R' * (m - 1) + 'D' + 'L' * (m - 1) + 'D') * (n // 2))[:-1] + ('' if n % 2 == 0 else 'D' + 'R' * (m - 1))
	print(len(res))
	print(res)


(n, m, k) = map(int, input().split())
for _ in range(k):
	(sx, sy) = map(int, input().split())
	(ex, ey) = map(int, input().split())
ans = ''
ans += 'L' * (m - 1)
ans += 'U' * (n - 1)
for i in range(n):
	if i & 1:
		ans += 'L' * (m - 1)
	else:
		ans += 'R' * (m - 1)
	if i != n - 1:
		ans += 'D'
print(len(ans))
print(ans)


(m, n, k) = map(int, input().split())
s = 'U' * (m - 1) + 'L' * (n - 1)
c = 0
for i in range(m):
	if c == 0:
		s += 'R' * (n - 1) + 'D'
		c = 1
	else:
		c = 0
		s += 'L' * (n - 1) + 'D'
print(m * n + m + n - 3)
print(s[:m * n + m + n - 3])


(n, m, k) = [int(i) for i in input().split(' ')]
mov = n * m + m + n - 3
for i in range(k):
	input()
if n == 1 and m == 1:
	print(0)
elif n == 1:
	print(2 * (m - 1))
	print(''.join(['R'] * (m - 1) + ['L'] * (m - 1)))
elif m == 1:
	print(2 * (n - 1))
	print(''.join(['D'] * (n - 1) + ['U'] * (n - 1)))
else:
	print(mov)
	print(''.join(['U'] * (n - 1) + ['R'] * (m - 1) + ['L'] * (m - 1)), end='')
	print(''.join((['D'] + ['R'] * (m - 1) + (['D'] + ['L'] * (m - 1))) * ((n - 1) // 2)), end='')
	if (n - 1) % 2 == 1:
		print(''.join(['D'] + ['R'] * (m - 1)))


import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
from io import BytesIO, IOBase
from bisect import bisect_left as bl
from bisect import bisect_right as br

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)

def ddd():
	return collections.defaultdict(collections.defaultdict(int))
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')
(n, m, k) = mi()
for i in range(2 * k):
	(x, y) = mi()
print(n + m + n * m - 2)
res = ''
for i in range(n - 1):
	res += 'U'
for i in range(m - 1):
	res += 'L'
f = 0
for i in range(n):
	for j in range(m - 1):
		if f == 0:
			res += 'R'
		else:
			res += 'L'
	res += 'D'
	f = 1 - f
print(res)


def main():
	import sys
	input = sys.stdin.buffer.readline
	(H, W, K) = map(int, input().split())
	N = H - 1 + W - 1 + H * W - 1
	print(N)
	ans = [''] * N
	for i in range(H - 1):
		ans[i] = 'U'
	for i in range(H - 1, H + W - 2):
		ans[i] = 'L'
	flg = 1
	N0 = H - 1 + W - 2
	for i in range(1, H * W):
		if i % W == 0:
			flg ^= 1
			ans[i + N0] = 'D'
		elif flg:
			ans[i + N0] = 'R'
		else:
			ans[i + N0] = 'L'
	print(''.join(ans))
main()


(n, m, k) = map(int, input().split())
initial_pos_x = []
initial_pos_y = []
for _ in range(k):
	(x, y) = list(map(int, input().split()))
	initial_pos_x.append(x)
	initial_pos_y.append(y)
end_pos_x = []
end_pos_y = []
for _ in range(k):
	(x, y) = list(map(int, input().split()))
	end_pos_x.append(x)
	end_pos_y.append(y)
if n > 1 and m > 1:
	outputstr = 'L' * (m - 1) + 'U' * (n - 1)
	for i in range(n):
		if i % 2 == 0:
			outputstr = outputstr + 'R' * (m - 1) + 'D'
		else:
			outputstr = outputstr + 'L' * (m - 1) + 'D'
	outputstr = outputstr[:-1]
elif n == 1:
	outputstr = 'L' * (m - 1) + 'R' * (m - 1)
elif m == 1:
	outputstr = 'U' * (n - 1) + 'D' * (n - 1)
else:
	outputstr = ''
print(len(outputstr))
print(outputstr)


(n, m, k) = map(int, input().split())
for t in range(k):
	(c, cc) = input().split()
l = []
for t in range(m - 1):
	l.append('L')
for t in range(n - 1):
	l.append('U')
for t in range(n):
	for i in range(m - 1):
		if t % 2 == 0:
			l.append('R')
		else:
			l.append('L')
	l.append('D')
print(len(l))
print(*l, sep='')


(n, m, k) = map(int, input().split())
for i in range(k * 2):
	input()
print(m + n - 2 + m * n - 1)
print('L' * (m - 1) + 'U' * (n - 1), end='')
f = 1
ans = 0
while ans < n * m - 1:
	print('D' * (n - 1), end='')
	ans += n - 1
	if ans == n * m - 1:
		break
	print('R', end='')
	ans += 1
	if ans == n * m - 1:
		break
	print('U' * (n - 1), end='')
	ans += n - 1
	if ans == n * m - 1:
		break
	print('R', end='')
	ans += 1
	if ans == n * m - 1:
		break


(n, m, k) = list(map(int, input().split()))
for _ in range(k):
	input()
for _ in range(k):
	input()
res = 'D' * (n - 1) + 'R' * (m - 1)
step = 'L'
for i in range(n):
	for j in range(m - 1):
		res += step
	if i != n - 1:
		res += 'U'
	if step == 'L':
		step = 'R'
	else:
		step = 'L'
print(len(res))
print(res)


from sys import stdin, stdout
(n, m, k) = map(int, stdin.readline().split(' '))
if n > 1 and n / (n - 1) <= m:
	seq = []
	seq.append('U' * (n - 1))
	seq.append('L' * (m - 1))
	for i in range(1, n + 1):
		if i % 2 == 0:
			seq.append('L' * (m - 1))
		else:
			seq.append('R' * (m - 1))
		seq.append('D')
	s = ''.join(seq[:-1])
	stdout.write(str(len(s)))
	stdout.write('\n')
	stdout.write(s)
else:
	seq = []
	if n == 1:
		seq.append('L' * (m - 1))
		seq.append('R' * (m - 1))
	else:
		seq.append('U' * (n - 1))
		seq.append('D' * (n - 1))
	s = ''.join(seq)
	stdout.write(str(len(s)))
	stdout.write('\n')
	stdout.write(s)


(n, m, k) = map(int, input().split())
s = []
f = []
for _ in range(k):
	s.append(map(int, input().split()))
for _ in range(k):
	f.append(map(int, input().split()))
if n == 1:
	if m == 1:
		print(1)
		print('R')
	else:
		print(2 * m - 2)
		print('L' * (m - 1) + 'R' * (m - 1))
	exit()
elif m == 1:
	print(2 * n - 2)
	print('U' * (n - 1) + 'D' * (n - 1))
	exit()
ans = 'L' * (m - 1) + 'U' * (n - 1)
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1)
	else:
		ans += 'L' * (m - 1)
	ans += 'D'
print(len(ans))
print(ans)


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())
res = []
len = 0
(m, n, k) = inlt()
for i in range(n - 1):
	res.append('L')
	len += 1
for i in range(m - 1):
	res.append('U')
	len += 1
for i in range(m):
	for j in range(n - 1):
		if i % 2 == 0:
			res.append('R')
		else:
			res.append('L')
		len += 1
	if i < m - 1:
		res.append('D')
		len += 1
print(len)
listToStr = ''.join(map(str, res))
print(listToStr)


(n, m, k) = map(int, input().split())
s = 'L' * m
s += 'U' * n
for i in range(2 * k):
	(x, y) = map(int, input().split())
if m == 1:
	print(2 * n)
	print('U' * n + 'D' * n)
	exit()
if n == 1:
	print(2 * m)
	print('L' * m + 'R' * m)
	exit()
for i in range(n):
	if i % 2 == 0:
		s += 'R' * (m - 1)
	else:
		s += 'L' * (m - 1)
	s += 'D'
print(len(s[:-1]))
print(s[:-1])


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 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
(n, m, k) = inputnums()
print(2 * (n - 1) + (n + 1) * (m - 1))
print('U' * (n - 1) + 'L' * (m - 1), end='')
for i in range(n):
	if i != 0:
		print('D', end='')
	if i % 2 == 0:
		print('R' * (m - 1), end='')
	else:
		print('L' * (m - 1), end='')


(n, m, k) = map(int, input().split())
out = []
for i in range(n - 1):
	out.append('D')
for i in range(m - 1):
	out.append('L')
curr = 'U'
for i in range(m):
	out.append(curr * (n - 1))
	out.append('R')
	if curr == 'U':
		curr = 'D'
	else:
		curr = 'U'
s = ''.join(out)
print(len(s))
print(s)


import sys
from math import *
from collections import defaultdict
from queue import deque
from heapq import heappush, heappop
lines = [line.strip() for line in sys.stdin.readlines()]
(n, m, k) = list(map(int, lines[0].split()))
buf = ['L' * (m - 1) + 'U' * (n - 1)]
for i in range(n):
	buf += [('D' if i > 0 else '') + 'RL'[i % 2] * (m - 1)]
ret = ''.join(buf)
print(len(ret))
print(ret)


from sys import stdin, exit
from itertools import combinations
from collections import deque
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()
(n, m, k) = mi()
if n * m == 1:
	print(0)
	exit()
if n == 1:
	print(m * 2)
	print(m * 'L' + m * 'R')
	exit()
if m == 1:
	print(n * 2)
	print(n * 'U' + n * 'D')
	exit()
print(n + m + n * m)
print(n * 'U' + m * 'L', end='')
print(m * 'R', end='')
if n % 2 == 0:
	for i in range(n // 2 - 1):
		print('D', end='')
		print((m - 1) * 'L', end='')
		print('D', end='')
		print((m - 1) * 'R', end='')
	print('D', end='')
	print((m - 1) * 'L', end='')
else:
	for i in range(n // 2):
		print('D', end='')
		print((m - 1) * 'L', end='')
		print('D', end='')
		print((m - 1) * 'R', end='')


(n, m, k) = map(int, input().split())
ans = ''
ans += 'U' * (n - 1)
ans += 'R' * (m - 1)
d = 'L'
for _ in range(n - 1):
	ans += d * (m - 1)
	ans += 'D'
	d = {'L': 'R', 'R': 'L'}[d]
ans += d * (m - 1)
if len(ans) <= 2 * n * m:
	print(len(ans))
	print(ans)
else:
	print(-1)


(n, m, k) = map(int, input().split())
for i in range(k):
	(a, b) = map(int, input().split())
for i in range(k):
	(a, b) = map(int, input().split())
if m == 1:
	print(2 * n)
	print('D' * n + 'U' * n)
	exit()
elif n == 1:
	print(2 * m)
	print('L' * m + 'R' * m)
	exit()
ans = n + m
r = 'D' * n + 'L' * m
for i in range(n - 1):
	if i % 2 == 0:
		r += 'R' * (m - 1) + 'U'
		ans += m
	else:
		r += 'L' * (m - 1) + 'U'
		ans += m
if n % 2 == 1:
	r += 'R' * m
	ans += m
else:
	r += 'L' * m
	ans += m
print(ans)
print(r)


def f(n, m, k):
	s = ''
	s += n * 'D'
	s += m * 'R'
	s += ((m - 1) * 'L' + 'U' + (m - 1) * 'R' + 'U') * (n // 2)
	if n % 2 == 0:
		s = s[:-1]
	else:
		s += (m - 1) * 'L'
	print(len(s))
	return s

def main():
	(n, m, k) = [int(i) for i in input().split()]
	for _ in range(k):
		a = input()
	for _ in range(k):
		b = input()
	print(f(n, m, k))
main()


(n, m, k) = map(int, input().split())
old_coordinates = []
new_coordinates = []
str_ans = ''
for i in range(k):
	input_k = [int(x) for x in input().split()]
	old_coordinates.append(input_k)
for i in range(k):
	input_k = [int(x) for x in input().split()]
	new_coordinates.append(input_k)
for y in range(m):
	for z in range(n - 1):
		if y % 2 == 0:
			str_ans = str_ans + 'U'
		else:
			str_ans = str_ans + 'D'
	if y != m - 1:
		str_ans = str_ans + 'L'
for t in range(len(str_ans) - 1, -1, -1):
	if str_ans[t] == 'U':
		str_ans = str_ans + 'D'
	elif str_ans[t] == 'D':
		str_ans = str_ans + 'U'
	else:
		str_ans = str_ans + 'R'
print(len(str_ans))
print(str_ans)


(n, m, k) = map(int, input().split())
(xi, yi, xf, yf, s) = ([], [], [], [], [])
for i in range(k):
	(x, y) = map(int, input().split())
	xi.append(x)
	yi.append(y)
for i in range(k):
	(x, y) = map(int, input().split())
	xf.append(x)
	yf.append(y)
s.extend(['U'] * (max(xi) - 1) + ['L'] * (max(yi) - 1))
for i in range(n):
	if i % 2 == 0:
		s.extend(['R'] * (m - 1) + ['D'])
	else:
		s.extend(['L'] * (m - 1) + ['D'])
print(len(s))
print(''.join(s))


(n, m, k) = map(int, input().split())
x = []
for i in range(k):
	x.append(list(map(int, input().split())))
y = []
for i in range(k):
	y.append(list(map(int, input().split())))
ans = ''
ans += 'U' * (n - 1)
ans += 'L' * (m - 1)
d = 1
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1)
	else:
		ans += 'L' * (m - 1)
	if i != n - 1:
		ans += 'D'
print(len(ans))
print(ans)


nmk = input().split(' ')
n = int(nmk[0])
m = int(nmk[1])
k = int(nmk[2])
start = []
for i in range(k):
	start.append(list(map(int, input().split(' '))))
end = []
for i in range(k):
	end.append(list(map(int, input().split(' '))))
s = ''
for i in range(n - 1):
	s += 'D'
for i in range(m - 1):
	s += 'R'
kk = 1
for i in range(m):
	if kk == 1:
		kk = -1
		for j in range(n - 1):
			s += 'U'
	else:
		kk = 1
		for j in range(n - 1):
			s += 'D'
	s += 'L'
tt = len(s)
ss = ''
for i in range(tt - 1):
	ss += s[i]
tt = len(ss)
print(tt)
print(ss)


(n, m, k) = map(int, input().split())
if n == 1 and m == 1:
	print('1')
	print('D')
else:
	l = ''
	l += 'L' * (m - 1) + 'D' * (n - 1)
	if n % 2 == 0:
		for i in range(n // 2):
			l += 'R' * (m - 1) + 'U' + 'L' * (m - 1) + 'U'
	else:
		for i in range(n // 2):
			l += 'R' * (m - 1) + 'U' + 'L' * (m - 1) + 'U'
		l += 'R' * (m - 1) + 'U'
	print(str(n + m - 2 + n * m))
	print(l)


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(n, m, k) = list(map(int, input().split()))
for i in range(k):
	(_, _) = list(map(int, input().split()))
for i in range(k):
	(_, _) = list(map(int, input().split()))
print(n * m + n + m - 3)
s1 = 'D' * (n - 1) + 'R' * (m - 1)
s2 = 'U' * (n - 1)
f = 0
for i in range(m - 1):
	s2 += 'L'
	if f == 0:
		s2 += 'D' * (n - 1)
		f = 1
	else:
		s2 += 'U' * (n - 1)
		f = 0
print(s1 + s2)


(n, m, _) = map(int, input().split())
s = ''
s += 'U' * (n - 1) + 'R' * (m - 1) + 'L' * (m - 1)
k = 1
while k < n:
	s += 'D'
	if k & 1:
		s += 'R' * (m - 1)
	else:
		s += 'L' * (m - 1)
	k += 1
print(len(s))
print(s)


(n, m, k) = list(map(int, input().split()))
for i in range(k):
	(_, _) = list(map(int, input().split()))
for i in range(k):
	(_, _) = list(map(int, input().split()))
print(n * m + n + m - 3)
s1 = 'D' * (n - 1) + 'R' * (m - 1)
s2 = 'U' * (n - 1)
f = 0
for i in range(m - 1):
	s2 += 'L'
	if f == 0:
		s2 += 'D' * (n - 1)
		f = 1
	else:
		s2 += 'U' * (n - 1)
		f = 0
print(s1 + s2)


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

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

def solve():
	(n, m, k) = rl()
	for i in range(2 * k):
		rl()
	out = ['L'] * (m - 1) + ['D'] * (n - 1)
	col = 0
	d = 1
	while col < m:
		if d:
			out += ['U'] * (n - 1) + ['R']
		else:
			out += ['D'] * (n - 1) + ['R']
		d = 1 - d
		col += 1
	print(len(out[:-1]))
	print(''.join(out[:-1]))
mode = 's'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


(n, m, k) = map(int, input().split())
for i in range(k):
	(a, b) = map(int, input().split())
st = ''
for i in range(m - 1):
	st += 'L'
for i in range(n - 1):
	st += 'U'
t1 = 0
t2 = 0
for i in range(n - 1):
	for j in range(m - 1):
		if t1 % 2 == 0:
			st += 'R'
		else:
			st += 'L'
	t1 += 1
	st += 'D'
for j in range(m - 1):
	if t1 % 2 == 0:
		st += 'R'
	else:
		st += 'L'
print(len(st))
print(st)


a = [int(x) for x in input().split()]
n = a[0]
m = a[1]
k = a[2]
s = []
for i in range(k):
	temp = [int(x) for x in input().split()]
	s.append(temp)
f = []
for i in range(k):
	temp = [int(x) for x in input().split()]
	f.append(temp)
maxx = 0
maxy = 0
for i in range(k):
	if s[i][0] > maxx:
		maxx = s[i][0]
	if s[i][1] > maxy:
		maxy = s[i][1]
ans = ''
for i in range(maxx - 1):
	ans += 'U'
for i in range(maxy - 1):
	ans += 'L'
for i in range(n):
	for j in range(m):
		if i % 2 == 0:
			if j == m - 1:
				if i != n - 1:
					ans += 'D'
			else:
				ans += 'R'
		elif j == m - 1:
			if i != n - 1:
				ans += 'D'
		else:
			ans += 'L'
if len(ans) > 2 * m * n:
	print(-1)
else:
	print(len(ans))
	print(ans)


(n, m, k) = map(int, input().split())
for i in range(k):
	(x, y) = map(int, input().split())
	(x, y) = map(int, input().split())
turns = n + m + n * m - 3
s = 'D' * (n - 1)
for i in range(m - 1):
	s += 'L'
i = 0
j = 0
x = n + m - 2
up = 1
while x < turns:
	if up == 1:
		if i < n - 1:
			i += 1
			s += 'U'
		else:
			j += 1
			s += 'R'
			up = 0
	elif i > 0:
		i -= 1
		s += 'D'
	else:
		j += 1
		s += 'R'
		up = 1
	x += 1
print(turns)
print(s)


def main():
	(n, m, _) = map(int, input().split())
	print(2 * (n - 1) + (n + 1) * (m - 1))
	print('U' * (n - 1) + 'L' * (m - 1), end='')
	for i in range(n):
		if i != 0:
			print('D', end='')
		if i % 2 == 0:
			print('R' * (m - 1), end='')
		else:
			print('L' * (m - 1), end='')
	return
main()


numbers = input().split(' ')
rows = int(numbers[0])
cols = int(numbers[1])
chips = int(numbers[2])
for i in range(chips * 2):
	input()
st = 'U' * (rows - 1) + 'L' * (cols - 1)
for i in range(0, cols - 1, 2):
	st += 'D' * (rows - 1) + 'R' + 'U' * (rows - 1) + 'R'
if cols % 2 == 0:
	st = st[:len(st) - 1]
else:
	st += 'D' * (rows - 1)
assert len(st) < 2 * rows * cols
print(len(st))
print(st)


from sys import stdin, stdout
(n, m, k) = map(int, stdin.readline().split())
dict1 = {}
dict2 = {}
dict3 = {}
for i in range(k):
	(x, y) = map(int, stdin.readline().split())
for i in range(k):
	(x, y) = map(int, stdin.readline().split())
s = ''
for i in range(n - 1):
	s = s + 'U'
for i in range(m - 1):
	s = s + 'L'
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			s = s + 'R'
	else:
		for j in range(m - 1):
			s = s + 'L'
	s = s + 'D'
print(len(s))
print(s)


(n, m, k) = map(int, input().split())
i = []
f = []
s = []
for q in range(k):
	(x, y) = map(int, input().split())
	i.append([x, y])
for q in range(k):
	(x, y) = map(int, input().split())
	f.append([x, y])
count = n - 1 + m - 1
seq = 'L' * (m - 1)
seq += 'U' * (n - 1)
for x in range(n):
	if x % 2 == 0:
		seq += 'R' * (m - 1)
	else:
		seq += 'L' * (m - 1)
	if x != n - 1:
		seq += 'D'
count += n * (m - 1)
count += n - 1
print(count)
print(seq)


def move(x1, y1, x2, y2):
	res = ''
	if x1 < x2:
		res += abs(x2 - x1) * 'D'
	else:
		res += abs(x2 - x1) * 'U'
	if y1 < y2:
		res += abs(y2 - y1) * 'R'
	else:
		res += abs(y2 - y1) * 'L'
	return res
(n, m, k) = map(int, input().split())
points = [list(map(int, input().split())) for i in range(k)]
place = [list(map(int, input().split())) for i in range(k)]
ans = 'U' * (n - 1) + 'L' * (m - 1)
fl = 1
for i in range(m):
	if fl:
		ans += 'D' * (n - 1)
		fl = 0
	else:
		ans += 'U' * (n - 1)
		fl = 1
	ans += 'R'
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split())
for zboub in range(2 * k):
	input()
ret = (n - 1) * 'U' + (m - 1) * 'L'
for i in range(n):
	if i % 2 == 0:
		ret += (m - 1) * 'R'
	else:
		ret += (m - 1) * 'L'
	if i != n - 1:
		ret += 'D'
if n == 1 and m == 1:
	ret = 'D'
print(len(ret))
print(ret)


(n, m, k) = map(int, input().split())
l = [[*map(int, input().split())] for i in range(k)]
m1 = [[*map(int, input().split())] for i in range(k)]
cnt = 0
x = ''
for i in range(m - 1):
	x += 'L'
	cnt += 1
for i in range(n - 1):
	x += 'U'
	cnt += 1
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			x += 'R'
			cnt += 1
		if i < n - 1:
			x += 'D'
			cnt += 1
	else:
		for j in range(m - 1):
			x += 'L'
			cnt += 1
		if i < n - 1:
			x += 'D'
			cnt += 1
print(cnt)
print(x)


import math, string, itertools, fractions, heapq, collections, re, array, bisect
(n, m, k) = list(map(int, input().strip().split(' ')))
for i in range(k * 2):
	input().strip()
ans = ''
for i in range(n):
	ans += 'U'
for i in range(m):
	ans += 'L'
for i in range(n):
	for j in range(m - 1):
		if i % 2 == 0:
			ans += 'R'
		else:
			ans += 'L'
	if i < n - 1:
		ans += 'D'
print(len(ans))
print(ans)


(n, m, k) = [int(i) for i in input().split()]
s = ''
flag = 0
for i in range(n):
	for j in range(m - 1):
		if flag == 0:
			s += 'R'
		else:
			s += 'L'
	if flag == 1:
		flag = 0
	else:
		flag = 1
	s += 'D'
for i in range(n):
	for j in range(m - 1):
		if flag == 1:
			s += 'L'
		else:
			s += 'R'
	if flag == 1:
		flag = 0
	else:
		flag = 1
	s += 'U'
print(len(s))
print(s)


(N, M, K) = map(int, input().split())
for _ in range(K * 2):
	input()
X = ['U'] * (N - 1) + ['L'] * (M - 1)
for i in range(N):
	if i % 2 == 0:
		X += ['R'] * (M - 1)
	else:
		X += ['L'] * (M - 1)
	X += ['D']
print(len(X))
print(''.join(X))


from sys import stdin

def main():
	(n, m, k) = map(int, stdin.readline().split())
	for _ in range(k):
		(x, y) = map(int, stdin.readline().split())
	ans = str()
	for _ in range(n - 1):
		ans += 'U'
	for _ in range(m - 1):
		ans += 'L'
	for i in range(n):
		if i % 2:
			char = 'L'
		else:
			char = 'R'
		for _ in range(m - 1):
			ans += char
		ans += 'D'
	print(len(ans))
	print(ans)
main()


(n, m, k) = map(int, input().split())
maxx = 0
maxy = 0
for i in range(k):
	(sx, sy) = map(int, input().split())
	maxx = max(maxx, sx)
	maxy = max(maxy, sy)
for i in range(k):
	(fx, fy) = map(int, input().split())
ans = ''
ans += 'U' * (maxx - 1)
ans += 'L' * (maxy - 1)
for i in range(m):
	if i % 2 == 0:
		ans += 'D' * (n - 1)
	else:
		ans += 'U' * (n - 1)
	if i != m - 1:
		ans += 'R'
print(len(ans))
print(ans)


import math
a = input().split()
m = int(a[0])
n = int(a[1])
k = int(a[2])
movestring = ''
for i in range(n - 1):
	movestring += 'L'
for i in range(m - 1):
	movestring += 'D'
up = 1
for i in range(n):
	for j in range(m - 1):
		if up == 1:
			movestring += 'U'
		else:
			movestring += 'D'
	up *= -1
	if i != n - 1:
		movestring += 'R'
if n == 1:
	movestring = ''
	movestring += 'U' * (m - 1)
	movestring += 'D' * (m - 1)
if m == 1:
	movestring = ''
	movestring += 'L' * (n - 1)
	movestring += 'R' * (n - 1)
print(len(movestring))
print(movestring)


(n, m, k) = map(int, input().split())
for _ in range(2 * k):
	a = list(map(int, input().split()))
ans = []
for i in range(n - 1):
	ans.append('U')
for i in range(m - 1):
	ans.append('L')
if n == 1:
	for i in range(m - 1):
		ans.append('R')
elif m == 1:
	for i in range(n - 1):
		ans.append('D')
else:
	for i in range(n):
		for j in range(m):
			if i is n - 1:
				if i % 2 == 0:
					for i in range(m - 1):
						ans.append('R')
				else:
					for i in range(m - 1):
						ans.append('L')
			elif i % 2 == 0:
				if j is m - 1:
					ans.append('D')
				else:
					ans.append('R')
			elif j is m - 1:
				ans.append('D')
			else:
				ans.append('L')
print(len(ans))
print(''.join(map(str, ans)))


for _ in range(1):
	(n, m, k) = map(int, input().split())
	currpos = []
	for i in range(k):
		(x, y) = map(int, input().split())
		currpos.append([x, y])
	finalpos = []
	for i in range(k):
		(x, y) = map(int, input().split())
		finalpos.append([x, y])
	s = ''
	s += 'U' * n
	s += 'L' * m
	for i in range(n):
		if i % 2 == 0:
			for j in range(m - 1):
				s += 'R'
		else:
			for j in range(m - 1):
				s += 'L'
		if i != n - 1:
			s += 'D'
	print(len(s))
	print(s)


(n, m, k) = map(int, input().split())
ans = ['D' * (n - 1), 'L' * (m - 1)]
for i in range(max(n - 1, 1)):
	x = 'L' if i & 1 else 'R'
	ans.append(x * (m - 1))
	ans.append('U')
if n > 1:
	x = 'R' if i & 1 else 'L'
	ans.append(x * (m - 1))
ans = ''.join(ans)
print(len(ans))
print(ans)


(m, n, k) = map(int, input().split())
source = []
for i in range(k):
	(a, b) = map(int, input().split())
	source.append((a, b))
dest = []
for i in range(k):
	(a, b) = map(int, input().split())
	dest.append((a, b))
moves = n + m + m * n - 3
print(moves)
print('U' * (m - 1) + 'L' * (n - 1), end='')
for i in range(m):
	if i % 2 == 1:
		print('L' * (n - 1), end='')
	else:
		print('R' * (n - 1), end='')
	if i < m - 1:
		print('D', end='')


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
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
from itertools import permutations
from math import factorial as f

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
from collections import defaultdict
from heapq import heappop, heappush, heapify
(n, m, k) = map(int, input().split())
max1 = 0
max2 = 0
ans = ''
hash = defaultdict(set)
for i in range(k):
	(a, b) = map(int, input().split())
	seti = set()
	max1 = max(max1, b)
	max2 = max(max2, a)
	for j in range(b, 0, -1):
		seti.add((a, j))
	for j in range(a, 0, -1):
		seti.add((j, 1))
	hash[i + 1] = seti
ba = set()
sa = []
ans = 'L' * max1 + 'U' * max2
for i in range(k):
	(a, b) = map(int, input().split())
	if (a, b) not in hash[i + 1]:
		sa.append([b, a])
sa.sort()
(x, y) = (1, 1)
for i in sa:
	(b, a) = i
	if a > x:
		ans += 'D' * (a - x)
	elif x > a:
		ans += 'U' * (x - a)
	ans += 'R' * (b - y)
	(x, y) = (a, b)
if len(ans) <= 2 * m * n:
	print(len(ans))
	print(ans)
else:
	print(-1)


(n, m, k) = list(map(int, input().split()))
fromm = [[] for i in range(k)]
to = [[] for i in range(k)]
L = 0
R = 0
D = 0
U = 0
for i in range(k):
	fromm[i] = input()
for i in range(k):
	s = list(map(int, input().split()))
ans = 'U' * (n - 1)
ans += 'L' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1) + 'D'
	else:
		ans += 'L' * (m - 1) + 'D'
print(len(ans))
print(ans)


import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
from functools import lru_cache
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

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

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
(n, m, k) = mapi()
a = []
for i in range(k):
	(x, y) = mapi()
	a.append([x, y])
b = []
c = []
for i in range(k):
	(x, y) = mapi()
	b.append([x, y])
	c.append([x - a[i][0], y - a[i][1]])
res = 0
ans = []
for i in range(m - 1):
	res += 1
	ans.append('L')
for i in range(n - 1):
	res += 1
	ans.append('U')
for i in range(n):
	if i % 2 == 0:
		for j in range(m - 1):
			res += 1
			ans.append('R')
		if i < n - 1:
			res += 1
			ans.append('D')
	else:
		for j in range(m - 1):
			res += 1
			ans.append('L')
		if i < n - 1:
			res += 1
			ans.append('D')
if res > 2 * n * m:
	print(-1)
	exit(0)
print(res)
print(''.join(ans))


from sys import stdin
from bisect import bisect_left as bl
from bisect import bisect_right as br

def input():
	return stdin.readline()[:-1]

def intput():
	return int(input())

def sinput():
	return input().split()

def intsput():
	return map(int, sinput())

class RangedList:

	def __init__(self, start, stop, val=0):
		self.shift = 0 - start
		self.start = start
		self.stop = stop
		self.list = [val] * (stop - start)

	def __setitem__(self, key, value):
		self.list[key + self.shift] = value

	def __getitem__(self, key):
		return self.list[key + self.shift]

	def __repr__(self):
		return str(self.list)

	def __iter__(self):
		return iter(self.list)

def dprint(*args, **kwargs):
	if debugging:
		print(*args, **kwargs)
debugging = 1
(n, m, k) = intsput()
starts = []
targets = []
for _ in range(k):
	starts.append(list(intsput()))
for _ in range(k):
	targets.append(list(intsput()))
sol = []
for i in range(m - 1):
	sol.append('L')
for i in range(n - 1):
	sol.append('D')
for i in range(n - 1):
	sol.append('U')
for right in range(m - 1):
	sol.append('R')
	if right % 2:
		for _ in range(n - 1):
			sol.append('U')
	else:
		for _ in range(n - 1):
			sol.append('D')
print(len(sol))
print(''.join(sol))


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
(cx, cy) = ([0] * k, [0] * k)
(tx, ty) = ([0] * k, [0] * k)
for (i, (x, y)) in enumerate((map(int, input().split()) for _ in range(k))):
	cx[i] = x
	cy[i] = y
for (i, (x, y)) in enumerate((map(int, input().split()) for _ in range(k))):
	tx[i] = x
	ty[i] = y
ans = 'L' * (m - 1) + 'U' * (n - 1)
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1)
	else:
		ans += 'L' * (m - 1)
	ans += 'D'
print(len(ans))
print(ans)


(n, m, k) = map(int, input().split())
sx = []
sy = []
fx = []
fy = []
for i in range(k):
	(a, b) = map(int, input().split())
	sx.append(a)
	sy.append(b)
for i in range(k):
	(a, b) = map(int, input().split())
	fx.append(a)
	fy.append(b)

def dist(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)

def route(x1, y1, x2, y2):
	res = ''
	if x1 - x2 >= 0:
		res += 'U' * (x1 - x2)
	else:
		res += 'D' * (x2 - x1)
	if y1 - y2 >= 0:
		res += 'L' * (y1 - y2)
	else:
		res += 'R' * (y2 - y1)
	x = x2 - x1
	y = y2 - y1
	return (res, x, y)
res = ''
res += (n - 1) * 'U'
res += (m - 1) * 'L'
for i in range(n):
	if i % 2 == 0:
		res += (m - 1) * 'R'
	else:
		res += (m - 1) * 'L'
	if i != n - 1:
		res += 'D'
print(len(res))
print(res)
n * m + n


while True:
	try:

		def solution(r, c, k, source, destination):
			res = ''
			for a in range(r - 1):
				res += 'U'
			for a in range(c - 1):
				res += 'L'
			for a in range(r):
				if a % 2 == 0:
					for b in range(c - 1):
						res += 'R'
				else:
					for b in range(c - 1):
						res += 'L'
				if a + 1 < r:
					res += 'D'
			print(len(res))
			print(res)

		def read():
			(r, c, k) = map(int, input().split())
			source = list()
			destination = list()
			for _ in range(k):
				(a, b) = map(int, input().split())
				source.append([a, b])
			for _ in range(k):
				(a, b) = map(int, input().split())
				destination.append([a, b])
			solution(r, c, k, source, destination)
		if __name__ == '__main__':
			read()
	except EOFError:
		break


(M, N, K) = [int(i) for i in input().split()]
res = ''
res += 'L' * (N - 1) + 'U' * (M - 1)
for i in range(2 * K):
	input()
for i in range(M):
	if i % 2:
		res += 'L' * (N - 1)
	else:
		res += 'R' * (N - 1)
	res += 'D'
print(N * M + N - 1 + M - 1)
print(res)


(n, m, k) = map(int, input().split())
Sx = [0] * k
Sy = [0] * k
for i in range(k):
	(Sx[i], Sy[i]) = map(int, input().split())
Fx = [0] * k
Fy = [0] * k
for i in range(k):
	(Fx[i], Fy[i]) = map(int, input().split())
ans = []
ans += ['U'] * (n - 1)
ans += ['L'] * (m - 1)
for i in range(n):
	if i % 2 == 0:
		ans += ['R'] * (m - 1)
	else:
		ans += ['L'] * (m - 1)
	if i != n - 1:
		ans += ['D']
print(len(ans))
print(''.join(ans))


(n, m, k) = [int(_) for _ in input().split()]
ans = n - 1 + m - 1 + n * (m - 1) + n - 1
out = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(1, n + 1):
	if i % 2:
		out += 'R' * (m - 1) + 'D'
	else:
		out += 'L' * (m - 1) + 'D'
print(ans, out[:len(out) - 1])


def fib(n):
	if n == 0:
		return [0, 1]
	p = fib(n >> 1)
	c = p[0] * (2 * p[1] - p[0])
	d = p[0] * p[0] + p[1] * p[1]
	if n & 1:
		return [d, c + d]
	else:
		return [c, d]
(n, m, k) = map(int, input().split())
(n, m) = (m, n)
for _ in range(2 * k):
	(x, y) = map(int, input().split())
ans = 'L' * (n - 1) + 'U' * (m - 1)
current = 'R'
for i in range(m):
	ans += current * (n - 1)
	if i != m - 1:
		ans += 'D'
	current = 'LR'.replace(current, '')
print(len(ans))
print(ans)


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())
data = list(invr())
row = data[0]
col = data[1]
chips = data[2]
chips *= 2
while chips > 0:
	d = list(invr())
	chips -= 1
moves = row + col + row * col - 3
print(moves)
for i in range(row - 1):
	print('U', end='')
for i in range(col - 1):
	print('L', end='')
for i in range(row):
	if i & 1:
		for j in range(col - 1):
			print('L', end='')
	else:
		for j in range(col - 1):
			print('R', end='')
	if i < row - 1:
		print('D', end='')


w = input().split(' ')
n = int(w[0])
m = int(w[1])
k = int(w[2])
str = ''
for i in range(0, k):
	input()
	input()
for i in range(0, n - 1):
	str = str + 'U'
for i in range(0, m - 1):
	str = str + 'L'
for i in range(0, n):
	if i % 2 == 0:
		for j in range(0, m - 1):
			str = str + 'R'
	else:
		for i in range(0, m - 1):
			str = str + 'L'
	if i != n - 1:
		str = str + 'D'
print(len(str))
print(str)


import sys
import heapq

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

def iinput():
	return int(input())

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

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

def main():
	(m, n, k) = rinput()
	s = 'D' * m + 'L' * n
	for i in range(n):
		if not i % 2:
			s = s + 'U' * (m - 1)
			if i != n - 1:
				s = s + 'R'
		else:
			s = s + 'D' * (m - 1)
			if i != n - 1:
				s = s + 'R'
	print(len(s))
	print(s)
for i in range(1):
	main()


def linput():
	return [int(i) for i in input().split()]
for ______ in range(1):
	(m, n, k) = linput()
	sss = 'D' * m + 'L' * n
	for i in range(n):
		if not i % 2:
			sss = sss + 'U' * (m - 1)
			if i != n - 1:
				sss = sss + 'R'
		else:
			sss = sss + 'D' * (m - 1)
			if i != n - 1:
				sss = sss + 'R'
	print(len(sss))
	print(sss)


(n, m, k) = map(int, input().split())
chips = []
pos = []
for i in range(k):
	(x, y) = map(int, input().split())
	chips.append((x, y))
for i in range(k):
	(x, y) = map(int, input().split())
	pos.append((x, y))
m = m - 1
string = n // 2 * (m * 'R' + 'D' + m * 'L' + 'D') + n % 2 * (m * 'R') + n // 2 * (m * 'L' + 'U' + m * 'R' + 'U') + n % 2 * (m * 'L')
print(len(string))
print(string)


from sys import stdin, stdout
input = stdin.readline
(n, m, k) = map(int, input().split())
print(n * m + n + m - 3)
for i in range(n - 1):
	stdout.write('D')
for i in range(m - 1):
	stdout.write('L')
for i in range(n - 1):
	stdout.write('U')
for i in range(1, m):
	stdout.write('R')
	if i % 2 == 1:
		for j in range(n - 1):
			stdout.write('D')
	else:
		for j in range(n - 1):
			stdout.write('U')


(n, m, k) = input().split()
(n, m, k) = (int(n), int(m), int(k))
xys = []
for i in range(k):
	xys.append(input().split())
maxL = 0
maxR = 0
maxU = 0
maxD = 0
for i in range(k):
	(xn, yn) = input().split()
	(xn, yn) = (int(xn), int(yn))
	maxL = max(int(xys[i][1]) - yn, maxL)
	maxR = max(yn - int(xys[i][1]), maxR)
	maxU = max(int(xys[i][0]) - xn, maxU)
	maxD = max(xn - int(xys[i][0]), maxD)
res = ''
for i in range(n - 1):
	res += 'U'
for i in range(m - 1):
	res += 'L'
for x in range(n):
	if x % 2 == 0:
		for y in range(m - 1):
			res += 'R'
	else:
		for y in range(m - 1):
			res += 'L'
	if x != n - 1:
		res += 'D'
print(len(res))
print(res)


import os
import heapq
import sys, threading
import math as mt
import operator
from copy import copy
from collections import defaultdict, deque
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)

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

def inpt():
	return [int(k) for k in input().split()]

def main():
	(n, m, k) = inpt()
	ar = []
	for _ in range(n):
		ar.append([0] * m)
	res = ''
	(r, c) = (0, 0)
	for i in range(k):
		(a, b) = inpt()
		r = max(r, a)
		c = max(c, b)
	ans = 'U' * (r - 1)
	ans += 'L' * (c - 1)
	for i in range(k):
		(a, b) = inpt()
	x = 0
	for i in range(n):
		if x == 0:
			if i != n - 1:
				ans += 'R' * (m - 1) + 'D'
			else:
				ans += 'R' * (m - 1)
		elif i != n - 1:
			ans += 'L' * (m - 1) + 'D'
		else:
			ans += 'L' * (m - 1)
		x ^= 1
	if len(ans) > 2 * n * m:
		print(-1)
		exit()
	print(len(ans))
	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')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
from collections import Counter

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
(H, W, K) = MAP()
for _ in range(K * 2):
	MAP()
ans = 'L' * (W - 1) + 'U' * (H - 1)
for i in range(H):
	if i % 2 == 0:
		ans += 'R' * (W - 1)
	else:
		ans += 'L' * (W - 1)
	if i != H - 1:
		ans += 'D'
print(len(ans))
print(ans)


(n, m, k) = [int(x) for x in input().split()]
print(m + n - 3 + n * m)
for _ in range(m - 1):
	print('L', end='')
for _ in range(n - 1):
	print('U', end='')
for i in range(n):
	if i % 2 == 0:
		for _ in range(m - 1):
			print('R', end='')
	else:
		for _ in range(m - 1):
			print('L', end='')
	if i != n - 1:
		print('D', end='')


from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
import sys, bisect, string, math, time, functools, random

def Golf():
	(*a,) = map(int, open(0))

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

def S_():
	return input()

def IS():
	return input().split()

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

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

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def GI(V, E, Directed=False, index=0):
	org_inp = []
	g = [[] for i in range(n)]
	for i in range(E):
		inp = LI()
		org_inp.append(inp)
		if index == 0:
			inp[0] -= 1
			inp[1] -= 1
		if len(inp) == 2:
			(a, b) = inp
			g[a].append(b)
			if not Directed:
				g[b].append(a)
		elif len(inp) == 3:
			(a, b, c) = inp
			aa = (inp[0], inp[2])
			bb = (inp[1], inp[2])
			g[a].append(bb)
			if not Directed:
				g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, boundary=1, search=[], replacement_of_found='.', mp_def={'#': 1, '.': 0}):
	mp = [boundary] * (w + 2)
	found = {}
	for i in range(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def bit_combination(k, n=2):
	return [[tb // n ** bt % n for bt in range(k)] for tb in range(n ** k)]

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)

def show2d(g, h, w):
	for i in range(h):
		show(g[i * w:i * w + w])
YN = ['YES', 'NO']
Yn = ['Yes', 'No']
mo = 10 ** 9 + 7
inf = float('inf')
l_alp = string.ascii_lowercase
input = lambda : sys.stdin.readline().rstrip()

def ran_input():
	n = random.randint(4, 16)
	(rmin, rmax) = (1, 10)
	a = [random.randint(rmin, rmax) for _ in range(n)]
	return (n, a)
show_flg = False
show_flg = True
(n, m, k) = LI()
s = []
g = []
for i in range(k):
	(a, b) = LI_()
	s += [(a, b)]
for i in range(k):
	(a, b) = LI_()
	g += [(a, b)]
x = 'DULR'
d = [-29, -12, -21, -15]
ans = [d[1]] * (n - 1) + [d[2]] * (m - 1)
for i in range(n):
	if i % 2 == 0:
		ans += [d[3]] * (m - 1) + [d[0]]
	else:
		ans += [d[2]] * (m - 1) + [d[0]]
print(len(ans), LtoS(ans))


def solve():
	(n, m, k) = map(int, input().split())
	path = ''
	path += 'L' * (m - 1)
	path += 'U' * (n - 1)
	for i in range(n):
		if i % 2 == 0:
			path += 'R' * (m - 1)
		else:
			path += 'L' * (m - 1)
		if i != n - 1:
			path += 'D'
	print(len(path))
	print(path)

def main():
	solve()
main()


for i in range(1):
	(n, m, k) = map(int, input().split())
	for j in range(2 * k):
		li = input().split()
	d = []
	d.append((n - 1) * 'D')
	p = (m - 1) * 'R'
	p1 = (m - 1) * 'L'
	d.append(p)
	d.append(p1)
	for i in range(n - 1):
		if i % 2 == 0:
			d.append('U')
			d.append(p)
		else:
			d.append('U')
			d.append(p1)
	print(n - 1 + 2 * m - 2 + (n - 1) * m)
	print(''.join(d))


(n, m, k) = map(int, input().split())
points = [tuple(map(int, input().split())) for _ in range(k)]
dests = [tuple(map(int, input().split())) for _ in range(k)]
(max_x, max_y) = map(max, zip(*points))
(max_dest_x, max_dest_y) = map(max, zip(*dests))
plan = 'L' * (max_y - 1) + 'U' * (max_x - 1)
plan += ('R' * (max_dest_y - 1) + 'D' + 'L' * (max_dest_y - 1) + 'D') * (max_dest_x // 2)
if max_dest_x % 2 == 1:
	plan += 'R' * (max_dest_y - 1)
assert len(plan) <= 2 * m * n
print(len(plan))
print(plan)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_str():
	return input().decode().strip()

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

def oint():
	return int(input())
(n, m, k) = rint()
s = []
f = []
for i in range(k):
	s.append(list(rint()))
for i in range(k):
	f.append(list(rint()))
ans = []
for i in range(m):
	ans.append('L')
for i in range(n):
	ans.append('U')
for c in range(m):
	if c % 2 == 0:
		for r in range(n - 1):
			ans.append('D')
	else:
		for r in range(n - 1):
			ans.append('U')
	if c != m - 1:
		ans.append('R')
print(len(ans))
print(''.join(ans))


import sys
(n, m, k) = [int(j) for j in sys.stdin.readline().split()]
s = []
for i in range(k):
	(s1, s2) = [int(j) for j in sys.stdin.readline().split()]
	s.append((s1, s2))
l = [(0, 0)]
for i in range(k):
	(f1, f2) = [int(j) for j in sys.stdin.readline().split()]
	ls = (s[i][0] - f1, s[i][1] - f2)
	l.append(ls)
ans = ''
ans += 'L' * (m - 1)
ans += 'U' * (n - 1)
for i in range(n // 2):
	ans += 'R' * (m - 1) + 'D' + 'L' * (m - 1) + 'D'
if n % 2 == 1:
	ans += 'R' * (m - 1)
else:
	ans = ans[:-1]
sys.stdout.write(str(len(ans)))
sys.stdout.write('\n')
sys.stdout.write(ans)
sys.stdout.write('\n')


def split_input():
	return map(int, input().strip().split())
(n, m, k) = split_input()
s = [list(split_input()) for _ in range(k)]
f = [list(split_input()) for _ in range(k)]
if n == 1:
	print(2 * m)
	print('L' * m + 'R' * m)
elif m == 1:
	print(2 * n)
	print('U' * n + 'D' * n)
else:
	print(m + n + m * n)
	path = 'L' * m + 'U' * n
	for i in range(n):
		path += ('R' if i % 2 == 0 else 'L') * (m - 1) + 'D'
	print(path)


import sys
input = sys.stdin.readline
(n, m, k) = map(int, input().split())
sxy = []
for _ in range(k):
	(sx, sy) = map(int, input().split())
	sxy.append((sx, sy))
fxy = []
for _ in range(k):
	(fx, fy) = map(int, input().split())
	fxy.append((fx, fy))
ans = 'U' * (n - 1) + 'L' * (m - 1)
for i in range(n):
	if i % 2 == 0:
		ans += 'R' * (m - 1) + 'D'
	else:
		ans += 'L' * (m - 1) + 'D'
print(len(ans))
print(ans)


import sys
(n, m, k) = list(map(int, sys.stdin.readline().strip().split()))
for i in range(0, 2 * k):
	x = sys.stdin.readline()
print(n + m + n * m - 3)
ans = []
for i in range(0, n - 1):
	ans.append('U')
for i in range(0, m - 1):
	ans.append('L')
v = True
for i in range(0, n):
	for j in range(0, m - 1):
		if v == True:
			ans.append('R')
		else:
			ans.append('L')
	if i != n - 1:
		ans.append('D')
	if v == True:
		v = False
	else:
		v = True
print(''.join(ans))