import random, sys
import time
inputs = lambda: map(int, raw_input().split())
random.seed()
h, w, k, t = inputs()
X, Y = h, w
Cars = [inputs() for i in xrange(k)]
Coms = []
com_str = "LRUD-"
dd = [(0, -1), (0, 1), (-1, 0), (1, 0), (0, 0)]
order = range(k)
ds = range(4)
pre = 1000
def dist(x0, y0, x1, y1):
return abs(x0 - x1) + abs(y0 - y1)
L = 0
for l in xrange(t):
update = 0
coms = [4]*k
exist = {(x0, y0) for x0, y0, x1, y1 in Cars}
nCars = [e[:] for e in Cars]
random.shuffle(order)
for i in order:
x0, y0, x1, y1 = Cars[i]
random.shuffle(ds)
if abs(x0 - x1) + abs(y0 - y1) < 5:
wild = random.randint(0, 2) < 1 and l < pre
else:
wild = random.randint(0, 1) and l < pre
for d in ds:
dx, dy = dd[d]
nx = x0 + dx; ny = y0 + dy
if not 0 < nx <= X or not 0 < ny <= Y:
continue
if not wild and dist(x0, y0, x1, y1) <= dist(nx, ny, x1, y1):
continue
if (nx, ny) not in exist:
update = 1
exist.add((nx, ny))
nCars[i] = (nx, ny, x1, y1)
coms[i] = d
break
if l > pre:
if update == 0:
L = l
break
for i in xrange(k):
dx, dy = dd[coms[i]]
x0, y0, x1, y1 = Cars[i]
Cars[i] = (x0+dx, y0+dy, x1, y1)
Coms.append(map(com_str.__getitem__, coms))
sys.stdout.write("%d\n" % L)
sys.stdout.write("\n".join("".join(e) for e in Coms))