The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting his time, he wants to get from his current position s to square t in the least number of moves. Help him to do this.  In one move the king can get to the square that has a common side or a common vertex with the square the king is currently in (generally there are 8 different squares he can move to).

The first line contains the chessboard coordinates of square s, the second line — of square t. Chessboard coordinates consist of two characters, the first one is a lowercase Latin letter (from a to h), the second one is a digit from 1 to 8.

In the first line print n — minimum number of the king's moves. Then in n lines print the moves themselves. Each move is described with one of the 8: L, R, U, D, LU, LD, RU or RD.  L, R, U, D stand respectively for moves left, right, up and down (according to the picture), and 2-letter combinations stand for diagonal moves. If the answer is not unique, print any of them.

point1=raw_input()
point2=raw_input()

l=list(point1+point2)

l = [w.replace('a', '1') for w in l]
l = [w.replace('b', '2') for w in l]
l = [w.replace('c', '3') for w in l]
l = [w.replace('d', '4') for w in l]
l = [w.replace('e', '5') for w in l]
l = [w.replace('f', '6') for w in l]
l = [w.replace('g', '7') for w in l]
l = [w.replace('h', '8') for w in l]

arr = []
steps = 0
l = map(int, l)
x1=l[0]
y1=l[1]
x2=l[2]
y2=l[3]

def infinity():
    while True:
        yield
for _ in infinity():
   if (x2>x1 and y2>y1):
      x1+=1
      y1+=1
      steps+=1
      arr.append("RU" )
   elif (x2>x1 and y2<y1):
      x1+=1
      y1-=1
      steps+=1
      arr.append("RD" )
   elif (x2>x1 and y2==y1):
      x1+=1
      steps+=1
      arr.append("R" )
   elif (x2<x1 and y2>y1):
      x1-=1
      y1+=1
      steps+=1
      arr.append("LU" )
   elif (x2<x1 and y2<y1):
      y1-=1
      x1-=1
      steps+=1
      arr.append("LD" )
   elif (x2<x1 and y2==y1):
      x1-=1
      steps+=1
      arr.append("L" )
   elif (x2==x1 and y2>y1):
      y1+=1
      arr.append("U" )
      steps+=1
   elif (x2==x1 and y2<y1):
      y1-=1
      steps+=1
      arr.append("D" )
   elif (x2==x1 and y2==y1):
      break;
print steps
print "\n".join(arr)

x1, y1 = input()
x2, y2 = input()

y1, y2 = map(int, [y1, y2])
x1, x2 = map(ord, [x1, x2])

x = abs(x1 - x2)
y = abs(y1 - y2)
path = max([x, y])
print(path)

for i in range(path):
	x0 = x1 - x2
	y0 = y1 - y2
	if x0 != 0 and y0 != 0:
		if x0 < 0 and y0 < 0:
			print("RU")
			x1 += 1
			y1 += 1
		elif x0 < 0 and y0 > 0:
			print("RD")
			x1 += 1
			y1 -= 1
		elif x0 > 0 and y0 < 0:
			print("LU")
			y1 += 1
			x1 -= 1
		elif x0 > 0 and y0 > 0:
			print("LD")
			y1 -= 1
			x1 -= 1
	elif x0 == 0 or y0 == 0:
		if x0 > 0:
			print("L")
			x1 -= 1
		elif x0 < 0:
			print("R")
			x1 += 1
		elif y0 > 0:
			print("D")
			y1 -= 1
		elif y0 < 0:
			print("U")
			y1 += 1
	else:
		print("No need for more")

"""

A. Shortest path of the king

time limit per test
1 second

memory limit per test
64 megabytes

input
standard input

output
standard output

The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting his time, he wants to get from his current position s to square t in the least number of moves. Help him to do this.

In one move the king can get to the square that has a common side or a common vertex with the square the king is currently in (generally there are 8 different squares he can move to).

Input

The first line contains the chessboard coordinates of square s, the second line — of square t.

Chessboard coordinates consist of two characters, the first one is a lowercase Latin letter (from a to h), the second one is a digit from 1 to 8.

Output

In the first line print n — minimum number of the king's moves. Then in n lines print the moves themselves. Each move is described with one of the 8: L, R, U, D, LU, LD, RU or RD.

L, R, U, D stand respectively for moves left, right, up and down (according to the picture), and 2-letter combinations stand for diagonal moves. If the answer is not unique, print any of them.

Examples

Input

a8
h1

Output

7
RD
RD
RD
RD
RD
RD
RD

A. Shortest path of the king
time limit per test1 second
memory limit per test64 megabytes
inputstandard input
outputstandard output
The king is left alone on the chessboard. In spite of this loneliness, h
e doesn't lose heart, because he has business of national importance. Fo
r example, he has to pay an official visit to square t. As the king is n
ot in habit of wasting his time, he wants to get from his current positi
on s to square t in the least number of moves. Help him to do this.

In one move the king can get to the square that has a common side or a c
ommon vertex with the square the king is currently in (generally there a
re 8 different squares he can move to).

Input
The first line contains the chessboard coordinates of square s, the seco
nd line — of square t.

Chessboard coordinates consist of two characters, the first one is a low
ercase Latin letter (from a to h), the second one is a digit from 1 to 8
.

Output
In the first line print n — minimum number of the king's moves. Then in
n lines print the moves themselves. Each move is described with one of t
he 8: L, R, U, D, LU, LD, RU or RD.

L, R, U, D stand respectively for moves left, right, up and down (accord
ing to the picture), and 2-letter combinations stand for diagonal moves.
 If the answer is not unique, print any of them.

Examples
input
a8
h1
output
7
RD
RD
RD
RD
RD
RD
RD
"""

from sys import stdin, stdout

a1 = stdin.readline().strip()
a2 = stdin.readline().strip()

z1 = map(ord,a1)
z2 = map(ord,a2)

def f(p1 = [], p2 = []):
    a1 = ''
    if   p1[0] > p2[0] and p1[1] < p2[1]:
        p1[0] -= 1
        p1[1] += 1
        a1 = 'LU'
    elif p1[0] > p2[0] and p1[1] > p2[1]:
        p1[0] -= 1
        p1[1] -= 1
        a1 = 'LD'
    elif p1[0] > p2[0] and p1[1] == p2[1]:
        p1[0] -= 1
        a1 = 'L'
    elif p1[0] < p2[0] and p1[1] < p2[1]:
        p1[0] += 1
        p1[1] += 1
        a1 = 'RU'
    elif p1[0] < p2[0] and p1[1] > p2[1]:
        p1[0] += 1
        p1[1] -= 1
        a1 = 'RD'
    elif p1[0] < p2[0] and p1[1] == p2[1]:
        p1[0] += 1
        a1 = 'R'
    elif p1[0] == p2[0] and p1[1] < p2[1]:
        p1[1] += 1
        a1 = 'U'
    elif p1[0] == p2[0] and p1[1] > p2[1]:
        p1[1] -= 1
        a1 = 'D'

    return a1

ans = []
c1 = 0
while z1 != z2:
    ans.append(f(z1,z2))
    c1 += 1

stdout.write('{:d}\n'.format(c1))

for i1 in ans:
    stdout.write('{:s}\n'.format(i1))

start, end, lettermap, numbermap = input(), input(), {'a': 1, 'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8}, {1:'a', 2:'b', 3:'c', 4:'d', 5:'e', 6:'f', 7:'g', 8:'h'}
if start == end:
	print(0)
else:
	start = (lettermap[start[0]], int(start[1]))
	end = (lettermap[end[0]], int(end[1]))
	difference = [end[0]-start[0], end[1]-start[1]]
	#print(difference)
	moves = []
	while difference != [0,0]:
		moves.append("")
		if difference[0] > 0:
			moves[-1] = "R"
			difference[0]-=1
		elif difference[0] < 0:
			difference[0]+=1
			moves[-1] = "L"
		if difference[1] < 0:
			difference[1]+=1
			moves[-1] +="D"
		elif difference[1] > 0:
			difference[1]-=1
			moves[-1] += "U"
	print(len(moves))
	for move in moves:
		print(move)

s1 = input()
s2 = input()

start = (8 - (ord(s1[1]) -ord('0')), ord(s1[0]) - ord('a'))
end = (8 - (ord(s2[1]) - ord('0')), ord(s2[0]) - ord('a'))

x = end[0] - start[0]
y = end[1] - start[1]
step = max(abs(x), abs(y))
print(step)
a = min(abs(x), abs(y))
if x >= 0 and y >= 0:
    for i in range(0, a):
        print("RD")
elif x >= 0 and y <= 0:
    for i in range(0, a):
        print("LD")
elif x <= 0 and y >= 0:
    for i in range(0, a):
        print("RU")
elif x <= 0 and y <= 0:
    for i in range(0, a):
        print("LU")

if abs(x) != a:
    b = abs(x) - a
    if x >= 0:
        for i in range(0, b):
            print("D")
    else:
        for i in range(0, b):
            print("U")
else:
    b = abs(y) - a
    if y >= 0:
        for i in range(0, b):
            print("R")
    else:
        for i in range(0, b):
            print("L")

# print(start, end)

str = ""

s=raw_input()
e=raw_input()

sx = ord(e[0])-ord(s[0])
sy = ord(e[1])-ord(s[1])

moves=0

while sx!=0 or sy!=0:
    if sx>0:
        str+="R"
        sx-=1
    elif sx<0:
        str+="L"
        sx+=1
    if sy>0:
        str+="U"
        sy-=1
    elif sy<0:
        str+="D"
        sy+=1
    str+="\n"
    moves+=1

print moves
print str

x=input()
p=x[0];q=int(x[1]);
y=input()
a=y[0];b=int(y[1]);t=0;d={};
for i in "abcdefgh" :
    t+=1
    d[i]=t
max=max(abs(d[p]-d[a]),abs(q-b))
min=min(abs(d[p]-d[a]),abs(q-b))
print(max)
if d[p]-d[a]>=0 :
    for i in range(min) :
        print("L",end="")
        if q-b >=0 :
            print("D")
        else :
            print("U")
else :
    for i in range(min) :
        print("R",end="")
        if q-b >=0 :
            print("D")
        else :
            print("U")
if abs(d[p]-d[a]) < abs(q-b) :
 for i in range (max-min) :
        if q-b >=0 :
            print("D")
        else :
            print("U")
else :
    for i in range (max-min) :
        if d[p]-d[a] >=0 :
            print("L")
        else :
            print("R")

# Class for Point
class Point:
     def __init__(self , x , y):
         self.x = x
         self.y = y

# input start and end Point
str = raw_input()
start = Point(8-int(str[1]) , ord(str[0])-97)

str = raw_input()
end = Point(8-int(str[1]) , ord(str[0])-97)

# solve this problem
dir = [[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1]]
move = ["U","RU","R","RD","D","LD","L","LU"]
ans = max(abs(start.x-end.x) , abs(start.y-end.y))

# output
print ans
m = ans

x = start.x
y = start.y

# print "%d %d" % (start.x , start.y)
# print "%d %d" % (end.x , end.y)

while m > 0:
    for i in range(8):
        tmpx = x+dir[i][0]
        tmpy = y+dir[i][1]
        if (tmpx >= 0 and tmpx < 8 and tmpy >= 0 and tmpy < 8):
           dis = max(abs(tmpx-end.x) , abs(tmpy-end.y))
           if dis < m:
              print move[i]
              x = tmpx
              y = tmpy
              break
    m -= 1

s = input()
d = input()

sr = int(s[1])
sc = ord(s[0]) - ord('a') + 1

dr = int(d[1])
dc = ord(d[0]) - ord('a') + 1

count = 0

l = []

while(sr != dr or sc != dc):
    count += 1
    s = ''
    if dc > sc:
        sc+=1
        s+='R'
        #print('R',end='')
    if dc < sc:
        sc -= 1
        s+='L'
        #print('L',end='')

    if dr > sr:
        sr += 1
        s+='U'
        #print('U',end='')

    if dr < sr:
        sr -= 1
        s+='D'
        #print('D',end='')

    l.append(s)

print(count)
for x in l:
    print(x)

#!/usr/bin/python

def move(dx, dy):
    res = ""
    if (dx == -1): res +=  "L"
    if (dx == 1): res += "R"
    if (dy == -1): res += "D"
    if (dy == 1): res += "U"
    return res

field = [ [ -1  for x in xrange(8)] for y in xrange(8) ]
turn = [ [ [] for x in xrange(8)] for y in xrange(8) ]

num = { 'a':0, 'b':1, 'c':2, 'd':3, 'e':4, 'f':5, 'g':6, 'h':7}

st = raw_input()
x0,y0 = num[st[0]], int(st[1]) - 1

fin = raw_input()
x1, y1 = num[fin[0]], int(fin[1]) - 1

#print x0, y0, x1, y1

que = [ (x0, y0) ]
field[x0][y0] = 0;

nturn = 0
while (len(que) > 0):
    new_que = []
    for x,y in que:
        #print 'now in ', (x,y), 'turn:', turn[x][y]
        if x == x1 and y == y1:
            print nturn
            for t in turn[x][y]:
                print t
            exit()
        for dx in (-1,0,1):
            for dy in (-1,0,1):
                xx = x + dx
                yy = y + dy
                if 0 <= xx <= 7 and 0 <= yy <= 7 and field[xx][yy] == -1:
                    field[xx][yy] = nturn
                    turn[xx][yy] = list(turn[x][y])
                    new_que.append( (xx,yy) )
                    turn[xx][yy].append( move(dx,dy) )
    que = new_que
    nturn += 1

s = input()
s1, s2 = s[0], s[1]
t = input()
t1, t2 = t[0], t[1]
v_dif = int(s2)-int(t2)
h_dif = ord(s1)-ord(t1)
step = max(abs(v_dif), abs(h_dif))
nond = abs(abs(v_dif) - abs(h_dif))
print(step)
for i in range(nond):
    if abs(v_dif) > abs(h_dif):
        if v_dif < 0:
            print("U")
        else:
            print("D")
    else:
        if h_dif < 0:
            print("R")
        else:
            print("L")
for i in range(step - nond):
    if v_dif < 0 and h_dif < 0:
        print("RU")
    elif v_dif > 0 and h_dif < 0:
        print("RD")
    elif v_dif < 0 and h_dif > 0:
        print("LU")
    elif v_dif > 0 and h_dif > 0:
        print("LD")

def p(a):
    c = 'zabcdefgh'.index(a[0])
    r = int(a[1])
    return c, r

def move2(s, d, p):
    cdist = d[0] - s[0]
    rdist = d[1] - s[1]
    path = []

    # do diagonal
    d = min(abs(cdist), abs(rdist))
    cd = 'R' if cdist > 0 else 'L'
    rd = 'U' if rdist > 0 else 'D'
    dire = cd + rd
    if d:
        path += [dire] * d
    if cdist > 0:
        cdist -= d
    else:
        cdist += d
    if rdist > 0:
        rdist -= d
    else:
        rdist += d

    if cdist != 0:
        cd = 'R' if cdist > 0 else 'L'
        path += [cd] * abs(cdist)
    elif rdist != 0:
        rd = 'U' if rdist > 0 else 'D'
        path += [rd] * abs(rdist)
    return path

def move(s, d, p):
    if s == d:  # reached
        return p
    if s[0] == d[0]: # same c
        dist = d[1] - s[1]
        di = 'U' if dist > 0 else 'D'
        return p + ([di] * abs(dist))
    if s[1] == d[1]:  # same r
        dist = d[0] - s[0]
        di = 'R' if dist > 0 else 'L'
        return p + ([di] * abs(dist))
    else:
        if s[0] < d[0] and s[1] < d[1]:
            return move((s[0]+1, s[1]+1 ), d, p + ['RU'])
        if s[0] < d[0] and s[1] > d[1]:
            return move((s[0]+1, s[1]-1 ), d, p + ['RD'])
        if s[0] > d[0] and s[1] < d[1]:
            return move((s[0]-1, s[1]+1 ), d, p + ['LU'])
        if s[0] > d[0] and s[1] > d[1]:
            return move((s[0]-1, s[1]-1 ), d, p + ['LD'])

soln = move2(p(raw_input()), p(raw_input()), [])
print len(soln)
for l in soln:
    print l

def get_position(position):
    y, x = position
    y = ord(y)-ord('a')
    x = 8 - int(x)
    return x,y

source = input()
destination = input()
source_x, source_y = get_position(source)
destination_x, destination_y = get_position(destination)
#print(source_x, source_y)
#print(destination_x, destination_y)
if source_x == destination_x and source_y == destination_y:
    print(0)
elif source_x == destination_x:
    d = abs(source_y-destination_y)
    print(d)
    if source_y<destination_y:
        for i in range(d):
            print("R")
    else:
        for i in range(d):
            print("L")
elif source_y == destination_y:
    d = abs(source_x-destination_x)
    print(d)
    if source_x<destination_x:
        for i in range(d):
            print("D")
    else:
        for i in range(d):
            print("U")

elif (source_x - destination_x) == (source_y - destination_y):
    d = abs(source_x-destination_x)
    print(d)
    if source_x<destination_x:
        for i in range(d):
            print("RD")
    elif source_x>destination_x:
        for i in range(d):
            print("RU")
    elif source_y<destination_y:
        for i in range(d):
            print("LD")
    elif source_y>destination_y:
        for i in range(d):
            print("LU")
else:
    if source_x<destination_x and source_y<destination_y:
        dx = abs(source_x-destination_x)
        dy = abs(source_y-destination_y)
        diag = min(dx, dy)
        line = max(dx, dy) - diag
        print(diag + line)
        for i in range(diag):
            print("RD")
            source_x += 1
            source_y += 1
        if source_y == destination_y:
            for i in range(line):
                print("D")
        else:
            for i in range(line):
                print("R")
    elif source_x<destination_x and source_y>destination_y:
        dx = abs(source_x-destination_x)
        dy = abs(source_y-destination_y)
        diag = min(dx, dy)
        line = max(dx, dy) - diag
        print(diag + line)
        for i in range(diag):
            print("LD")
            source_x += 1
            source_y -= 1
        if source_y == destination_y:
            for i in range(line):
                print("D")
        else:
            for i in range(line):
                print("L")
    elif source_x>destination_x and source_y<destination_y:
        dx = abs(source_x-destination_x)
        dy = abs(source_y-destination_y)
        diag = min(dx, dy)
        line = max(dx, dy) - diag
        print(diag + line)
        for i in range(diag):
            print("RU")
            source_x -= 1
            source_y += 1
        if source_x == destination_x:
            for i in range(line):
                print("R")
        else:
            for i in range(line):
                print("U")
    elif source_x>destination_x and source_y>destination_y:
        dx = abs(source_x-destination_x)
        dy = abs(source_y-destination_y)
        diag = min(dx, dy)
        line = max(dx, dy) - diag
        print(diag + line)
        for i in range(diag):
            print("LU")
            source_x -= 1
            source_y -= 1
        if source_x == destination_x:
            for i in range(line):
                print("L")
        else:
            for i in range(line):
                print("U")
"""
b7
h8

Input
h1
b2
7 7
6 1

Output
7
LU
U
U
U
U
U
U
Answer
6
LU
L
L
L
L
L
"""

import string
import sys

s, t = sys.stdin.readline(), sys.stdin.readline()
s = (string.letters.index(s[0])+1, int(s[1]))
t = (string.letters.index(t[0])+1, int(t[1]))

path_x, path_y = (s[0]-t[0]), (s[1]-t[1])
if path_x < 0:
    path_x *= (-1)
    letter_x = 'R' * path_x
elif path_x > 0:
    letter_x = 'L' * path_x
else:
    letter_x = ''

if path_y < 0:
    path_y *= (-1)
    letter_y = 'U' * path_y
elif path_y > 0:
    letter_y = 'D' * path_y
else:
    letter_y = ''

merge, total = min(len(letter_x), len(letter_y)), max(len(letter_x), len(letter_y))
print total
for _ in range(merge):
    print letter_x[_] + letter_y[_]

try:
    for p in letter_x[merge:]:
        print p
except IndexError:
    pass

try:
    for p in letter_y[merge:]:
        print p
except IndexError:
    pass

def move2(s, d):
    cdist = ord(d[0]) - ord(s[0])
    rdist = int(d[1]) - int(s[1])
    path = []

    # do diagonal
    d = min(abs(cdist), abs(rdist))
    if cdist > 0:
        cd = 'R'
        cdist -= d
    else:
        cd = 'L'
        cdist += d
    if rdist > 0:
        rd = 'U'
        rdist -= d
    else:
        rd = 'D'
        rdist += d

    dire = cd + rd
    for i in range(d):
        path.append(dire)

    if cdist != 0:
        for i in range(abs(cdist)):
            path.append(cd)
    elif rdist != 0:
        for i in range(abs(rdist)):
            path.append(rd)
    return path

soln = move2((raw_input()), (raw_input()))
print len(soln)
for l in soln:
    print l

st = raw_input()
fn = raw_input()
dist = [ord(st[1]) - ord(fn[1]), ord(st[0]) - ord(fn[0])]
print max(abs(dist[0]), abs(dist[1]))

while dist.count(0)!=2:
    l = ""
    if dist[1]<0:
        l+="R"
        dist[1] += 1
    elif dist[1]>0:
        l+="L"
        dist[1] -= 1
    if dist[0]<0:
        l+="U"
        dist[0] += 1
    elif dist[0]>0:
        l+="D"
        dist[0] -= 1
    print l

n = input()
m = input()
x0 = ord(n[0])
y0 = ord(n[1])
x1 = ord(m[0])      #initial positions and final position
y1 = ord(m[1])
k = abs(x0 - x1)
u = abs(y0 - y1)
print(min(k,u)+ abs(k-u))
while True:
    if x0 < x1:
        print('R', end='')
        x0 = x0 + 1
    elif x0 > x1:
        print('L', end='')
        x0 = x0 - 1
    if y0 < y1:
        print('U', end='')
        y0 = y0 + 1
    elif y0 > y1:
        print('D', end='')
        y0 = y0 - 1
    print('')
    if x0 == x1 and y0 == y1:
        break

position = list(input())
end = list(input())

position[1] = int(position[1])
end[1] = int(end[1])

moves = []

while position != end:
    current_move = ''

    if position[0] < end[0]:
        position[0] = chr(ord(position[0]) + 1)
        current_move += 'R'

    elif position[0] > end[0]:
        position[0] = chr(ord(position[0]) - 1)
        current_move += 'L'

    if position[1] < end[1]:
        position[1] += 1
        current_move = current_move + 'U'

    elif position[1] > end[1]:
        position[1] -= 1
        current_move = current_move + 'D'

    moves.append(current_move)

print(len(moves))
for move in moves:
    print(move)

import sys
sc, sr = map(ord, list(raw_input()))
tc, tr = map(ord, list(raw_input()))
fc = sc-tc
fr = sr-tr
mx = max(abs(fc), abs(fr))
mn = min(abs(fc), abs(fr))
print mx
r = ['U', 'D']
c = ['L', 'R']
for _ in xrange(mx):
  s = ''
  if fc != 0:
    s += 'R' if fc < 0 else 'L'
    fc = fc - 1 if fc > 0 else fc + 1
  if fr != 0:
    s += 'U' if fr < 0 else 'D'
    fr = fr - 1 if fr > 0 else fr + 1
  print s

Read=lambda:map(int,raw_input().split())
s = raw_input()
s1 = int(ord(s[0]))
s2 = int(s[1])
t = raw_input()
t1 = int(ord(t[0]))
t2 = int(t[1])
r = []
while s1 != t1 or s2 != t2:
    x = ''
    if s1 > t1:
        x = 'L'
        s1 -= 1
    elif s1 < t1:
        x = 'R'
        s1 += 1
    if s2 > t2:
        x += 'D'
        s2 -= 1
    elif s2 < t2:
        x += 'U'
        s2 += 1
    r.append(x)

print len(r)
for x in r:
    print x

p1, p2 = input(), input()
x1, y1 = ord(p1[0]) - ord('a') + 1, int(p1[1])
x2, y2 = ord(p2[0]) - ord('a') + 1, int(p2[1])
x = x2 - x1
y = y2 - y1
d1, d2 = 'L', 'D'
if x > 0:
    d1 = 'R'
else:
    x = -x
if y > 0:
    d2 = 'U'
else:
    y = -y
if x > y:
    print(x)
else:
    print(y)
while x or y:
    if x:
        x -= 1
        print(d1, end='')
    if y:
        y -= 1
        print(d2, end='')
    print()

def sign(n):
    if n > 0:
        return 1
    if n < 0:
        return -1
    return 0
def ter(n,sn,sz,sp):
    return sn if n < 0 else (sz if n == 0 else sp)
s = input()
t = input()
n = 0
a = []
s = [ord(s[0])-ord('a')+1,int(s[1])]
t = [ord(t[0])-ord('a')+1,int(t[1])]
while s != t:
    d0 = sign(t[0]-s[0])
    d1 = sign(t[1]-s[1])
    s[0] += d0
    s[1] += d1
    a.append(ter(d0,'L','','R')+ter(d1,'D','','U'))
print(len(a))
for s in a:
    print(s)

alphabetic = " abcdefgh"
s = input()
t = input()
sx = alphabetic.index(s[0])
sy = int(s[1])
tx = alphabetic.index(t[0])
ty = int(t[1])
res = ""
cnt = 0
while sx != tx or sy != ty:
    cnt += 1
    if sx < tx:
        res += "R"
        sx += 1
    elif sx > tx:
        res += "L"
        sx -= 1
    if sy < ty:
        res += "U"
        sy += 1
    elif sy > ty:
        res += "D"
        sy -= 1
    res += "\n"

print(cnt)
print(res)

s = input() #a8
t = input() #h1

steps = 0
moves = []
row_dist = int(t[1]) - int(s[1])
col_dist = ord(t[0]) - ord(s[0])

while(row_dist != 0 or col_dist != 0):

    if abs(row_dist) > abs(col_dist):
        if row_dist > 0:
            moves.append("U")
            steps += 1
            row_dist -= 1
        elif row_dist < 0:
            moves.append("D")
            steps += 1
            row_dist += 1
        else:
            break

    elif abs(row_dist) < abs(col_dist):
        if col_dist > 0:
            moves.append("R")
            steps += 1
            col_dist -= 1
        elif col_dist < 0:
            moves.append("L")
            steps += 1
            col_dist += 1
        else:
            break

    elif abs(row_dist) == abs(col_dist):
        for i in range(abs(col_dist)):
            if col_dist > 0 and row_dist > 0:
                moves.append("RU")
                steps += 1
                col_dist -= 1
                row_dist -= 1
            elif col_dist > 0 and row_dist < 0:
                moves.append("RD")
                steps += 1
                col_dist -= 1
                row_dist += 1
            elif col_dist < 0 and row_dist > 0:
                moves.append("LU")
                steps += 1
                col_dist += 1
                row_dist -= 1
            elif col_dist < 0 and row_dist < 0:
                moves.append("LD")
                steps += 1
                col_dist += 1
                row_dist += 1

print(steps)
for i in moves:
    print(i)

s = input()
f = input()
x = ord(s[0])-ord(f[0])
y = ord(s[1])-ord(f[1])
print(max(x,y,-x,-y))
while x != 0 or y != 0:
    st = ""
    if x < 0:
      st += "R"
      x = x + 1
    if x > 0:
        st = st + "L"
        x = x - 1
    if y < 0:
        st = st + "U"
        y = y + 1
    if y > 0:
        st = st + "D"
        y = y - 1
    print(st)

s = raw_input()
t = raw_input()

sx = ord(s[0])-ord("a")+1
sy = int(s[1])
tx = ord(t[0])-ord("a")+1
ty = int(t[1])

print max(abs(sx - tx), abs(sy - ty))
while (sx != tx or sy != ty):
    res = ""
    if (tx > sx):
        sx += 1
        res += "R"
    if (tx < sx):
        sx -= 1
        res += "L"
    if (ty > sy):
        sy += 1
        res += "U"
    if (ty < sy):
        sy -= 1
        res += "D"
    print res

def Shortestpathoftheking(s,t):

    a = s+t
    a,b = (ord(a[i])-ord(a[i+2]) for i in (0,1))

    print(max(a,-a,b,-b))

    while a != 0 or b != 0:

        r = ""

        if a < 0: r = "R"; a += 1

        elif a > 0: r = "L"; a -= 1

        if b < 0: r += "U"; b += 1

        elif b > 0: r += "D"; b -= 1

        print(r)

    return ""

Lista = []

for i in range(2):
    All = [str(i) for i in input().split()]
    Lista.append(All)

for j in range(0,len(Lista),2):
    print(Shortestpathoftheking(Lista[j][0],Lista[j+1][0]))

s=input()
t=input()

kx=ord(s[0])-ord('a')+1
ky=int(s[1])

dx=ord(t[0])-ord('a')+1
dy=int(t[1])

path=[]
while kx!=dx or ky!=dy:
    move=''
    if kx>dx:
        move='L'
        kx-=1
    elif kx<dx:
        move='R'
        kx+=1
    if ky>dy:
        move=move+'D'
        ky-=1
    elif ky<dy:
        move=move+'U'
        ky+=1
    path.append(move)

print(len(path))
for x in path:
    print(x)

s=[i for i in input()]
t=[i for i in input()]
a=ord(s[0])-ord(t[0])
b=ord(s[1])-ord(t[1])
print(max(a,-a,b,-b))
while a!=0 or b!=0:
    kk=''
    if a<0:kk='R';a+=1
    if a>0:kk='L';a-=1
    if b<0:kk+='U';b+=1
    if b>0:kk+='D';b-=1
    print(kk)

import string

if __name__ == '__main__':
    s = raw_input()
    t = raw_input()

    letter2loc = dict(zip('abcdefgh', range(1, 9)))

    loc = [letter2loc[s[0]], int(s[1])]
    target = [letter2loc[t[0]], int(t[1])]

    vertical_dict = {True: 'U', False: 'D'}
    horizontal_dict = {True: 'R', False: 'L'}

    move_dict = {'U': 1, 'D': -1, 'L': -1, 'R': 1}

    horiz, vert = target[0]-loc[0], target[1]-loc[1]
    diag_dist = min(abs(horiz), abs(vert))
    print max(abs(horiz)-diag_dist, abs(vert)-diag_dist) + diag_dist
    while (not horiz == 0) and (not vert == 0):
        horiz_move = horizontal_dict[horiz > 0]
        vert_move = vertical_dict[vert > 0]

        print horiz_move + vert_move

        loc[0] += move_dict[horiz_move]
        loc[1] += move_dict[vert_move]

        horiz, vert = target[0]-loc[0], target[1]-loc[1]

    if not vert == 0:
        while abs(vert) > 0:
            vert_move = vertical_dict[vert > 0]
            print vert_move
            loc[1] += move_dict[vert_move]
            vert = target[1]-loc[1]
    elif not horiz == 0:
        while abs(horiz) > 0:
            horiz_move = horizontal_dict[horiz > 0]
            print horiz_move
            loc[0] += move_dict[horiz_move]
            horiz = target[0]-loc[0]

sp = raw_input()
lp = raw_input()
alp = 'abcdefgh'
posalp = {}
for i in range(8):
     posalp[alp[i]]=i+1
xi = posalp[sp[0]]
yi = int(sp[1])
xf = posalp[lp[0]]
yf = int(lp[1])
disx = xf-xi
disy = yf-yi
l = 0
r = 0
u = 0
d = 0

if disx>0:
     r = disx
elif disx<0:
     l = abs(disx)
if disy>0:
     u = disy
elif disy<0:
     d = abs(disy)
hor = max(l,r)
ver = max(u,d)
if l==hor:
     keyhor = 'L'
else:
     keyhor = 'R'
if ver==u:
     keyver = 'U'
else:
     keyver = 'D'
comm = min(hor,ver)
hor = hor-comm
ver = ver-comm
key = []
for s in range(comm):
     key.append(keyhor+keyver)
for d in range(hor):
     key.append(keyhor)
for f in range(ver):
     key.append(keyver)
print len(key)
for q in range(len(key)):
     print key[q]

x1, y1 = input()
x2, y2 = input()

y1, y2 = map(int, [y1, y2])
x1, x2 = map(ord, [x1, x2])

x = abs(x1 - x2)
y = abs(y1 - y2)
path = max([x, y])
print(path)

for i in range(path):
	x0 = x1 - x2
	y0 = y1 - y2
	if x0 != 0 and y0 != 0:
		if x0 < 0 and y0 < 0:
			print("RU")
			x1 += 1
			y1 += 1
		elif x0 < 0 and y0 > 0:
			print("RD")
			x1 += 1
			y1 -= 1
		elif x0 > 0 and y0 < 0:
			print("LU")
			y1 += 1
			x1 -= 1
		elif x0 > 0 and y0 > 0:
			print("LD")
			y1 -= 1
			x1 -= 1
	elif x0 == 0 or y0 == 0:
		if x0 > 0:
			print("L")
			x1 -= 1
		elif x0 < 0:
			print("R")
			x1 += 1
		elif y0 > 0:
			print("D")
			y1 -= 1
		elif y0 < 0:
			print("U")
			y1 += 1
	else:
		print("No need for more")

s = raw_input()
t = raw_input()
num_moves = 0
moves = []
while s != t:
    move = ''
    if ord(s[0]) > ord(t[0]):
        move += 'L'
        s = chr(ord(s[0]) - 1) + s[1]
    elif ord(s[0]) < ord(t[0]):
        move += 'R'
        s = chr(ord(s[0]) + 1) + s[1]

    if int(s[1]) > int(t[1]):
        move += 'D'
        s = s[0] + str(int(s[1])-1)
    elif int(s[1]) < int(t[1]):
        move += 'U'
        s = s[0] + str(int(s[1])+1)

    moves.append(move)
    num_moves += 1
print num_moves
for move in moves: print move

start=list(raw_input())
stop=list(raw_input())
h=ord(start[0])-ord(stop[0])
v=int(start[1])-int(stop[1])
V="D" if v>=0 else "U"
H="L" if h>=0 else "R"
v=abs(v)
h=abs(h)
M=H if h>v else V
print max(v,h)
for i in range(min(h,v)):
	print H+V
for i in range(abs(h-v)):
	print M

def coordinates():
    s = input()
    return " abcdefgh".index(s[0]), int(s[1])

sx, sy = coordinates()
tx, ty = coordinates()
res = ""
cnt = 0
while sx != tx or sy != ty:
    cnt += 1
    if sx < tx:
        res += "R"
        sx += 1
    elif sx > tx:
        res += "L"
        sx -= 1
    if sy < ty:
        res += "U"
        sy += 1
    elif sy > ty:
        res += "D"
        sy -= 1
    res += "\n"

print(cnt)
print(res)

s=input()
t=input()
count=0
if(s[0]==t[0]):
    if(s[1]>t[1]):
        value1=int(s[1])-int(t[1])
        count=count+value1
        print(value1)
        for i in range(value1):
            print('D')

    elif(s[1]<t[1]):
        value1=int(t[1])-int(s[1])
        count=count+value1
        print(value1)
        for i in range(value1):
            print('U')
    else:
        print(0)
elif(s[1]==t[1]):
    if(s[0]>t[0]):
        value1=ord(s[0])-ord(t[0])
        count=count+value1
        print(value1)
        for i in range(value1):
            print('L')

    elif(s[0]<t[0]):
        value1=ord(t[0])-ord(s[0])
        count=count+value1
        print(value1)
        for i in range(value1):
            print('R')
elif(s[0]<t[0]):
    if(s[1]>t[1]):
        a=ord(t[0])-ord(s[0])
        b=int(s[1])-int(t[1])
        value1=min(a,b)
        count=count+value1
        s=s.replace(s[0],chr(ord(s[0])+value1))
        s=s.replace(s[1],str(int(s[1])-value1))
        if(s[0]==t[0]):
            value2=int(s[1])-int(t[1])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('RD')
            for i in range(value2):
                print('D')
        elif(s[1]==t[1]):
            value2=ord(t[0])-ord(s[0])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('RD')
            for i in range(value2):
                print('R')

    elif(s[1]<t[1]):
        a=ord(t[0])-ord(s[0])
        b=int(t[1])-int(s[1])
        value1=min(a,b)
        count=count+value1

        s=s.replace(s[0],chr(ord(s[0])+value1))
        s=s.replace(s[1],str(int(s[1])+value1))
        if(s[0]==t[0]):
            value2=int(t[1])-int(s[1])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('RU')
            for i in range(value2):
                print('U')
        elif(s[1]==t[1]):
            value2=ord(t[0])-ord(s[0])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('RU')
            for i in range(value2):
                print('R')
elif(s[0]>t[0]):
    if(s[1]<t[1]):
        a=ord(s[0])-ord(t[0])
        b=int(t[1])-int(s[1])
        value1=min(a,b)
        count=count+value1

        s=s.replace(s[0],chr(ord(s[0])-value1))
        s=s.replace(s[1],str(int(s[1])+value1))
        if(s[0]==t[0]):
            value2=int(t[1])-int(s[1])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('LU')
            for i in range(value2):
                print('U')
        elif(s[1]==t[1]):
            value2=ord(s[0])-ord(t[0])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('LU')
            for i in range(value2):
                print('L')
    elif(s[1]>t[1]):
        a=ord(s[0])-ord(t[0])
        b=int(s[1])-int(t[1])
        value1=min(a,b)
        count=count+value1

        s=s.replace(s[0],chr(ord(s[0])-value1))
        s=s.replace(s[1],str(int(s[1])-value1))
        if(s[0]==t[0]):
            value2=int(s[1])-int(t[1])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('LD')
            for i in range(value2):
                print('D')
        elif(s[1]==t[1]):
            value2=ord(s[0])-ord(t[0])
            count=count+value2
            print(value1+value2)
            for i in range(value1):
                print('LD')
            for i in range(value2):
                print('L')

a,b = list(raw_input())
c,d = list(raw_input())
a = ord(a)-96
c = ord(c)-96
b = int(b)
d = int(d)
maxdiff = abs(d-b) if abs(d-b)>abs(c-a) else abs(c-a)
mov_verti = []
while c>a:
    mov_verti.append('R')
    a+=1
while c<a:
    mov_verti.append('L')
    a-=1
mov_hori = []
while d<b:
    mov_hori.append('D')
    b-=1
while d>b:
    mov_hori.append('U')
    b+=1
print maxdiff
for i in xrange(maxdiff):
    try:
        nxt_mov = mov_verti[i]+mov_hori[i]
    except:
        try:
            nxt_mov = mov_verti[i]
        except:
            nxt_mov = mov_hori[i]
    print nxt_mov

#!/usr/bin/python
s1= raw_input()
s2 =raw_input()

#if ord(s2[0])-ord(s1[0])<0 :
#    print 'ss',ord(s2[0])-ord(s1[0])
if ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1])<0 :
    ss = 'LD'
elif  ord(s2[0])-ord(s1[0])>0 and ord(s2[1])-ord(s1[1]) <0 :
    ss='RD'
elif  ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1]) >0 :
    ss='LU'
else:
    ss='RU'

#if ord(s2[0])-ord(s1[0])<0:
#    ss1 = 'U'
#else :
#    ss1 = 'D'

#if ord(s2[1])-ord(s1[1])<0:
#    ss2 = 'R'
#else :
#    ss2 = 'L'
if ord(s2[0])-ord(s1[0])<0:
    ss1 = 'L'
else :
    ss1 = 'R'

if ord(s2[1])-ord(s1[1])<0:
    ss2 = 'D'
else :
    ss2 = 'U'

big = abs(ord(s2[0])-ord(s1[0]))
small = abs(ord(s2[1])-ord(s1[1]))

if big < small :
    temp =big;
    big=small;
    small=temp;
    ss1=ss2;

print big

for i in range (0,small):
    print ss

for i in range (0,big-small):
    print ss1

import sys

def get_double_move(h,v):
    if h < 0 and v < 0:
        return 'LD'
    elif h > 0 and v < 0:
        return 'RD'
    elif h < 0 and v > 0:
        return 'LU'
    elif h > 0 and v > 0:
        return 'RU'

def get_single_move(h,v):
    if abs(h)>abs(v):
        if h > 0:
            return 'R'
        elif h < 0:
            return 'L'
    elif abs(h)<abs(v):
        if v < 0:
            return 'D'
        elif v > 0:
            return 'U'

line1 = sys.stdin.readline()
line2 = sys.stdin.readline()

dx = int(ord(line2[0])-ord(line1[0]))
dy = int(ord(line2[1])-ord(line1[1]))
double = get_double_move(dx,dy)
single = get_single_move(dx,dy)

print(max(abs(dx),abs(dy)))
for i in range(0,min(abs(dx),abs(dy))):
    print(double)

for i in range(min(abs(dx),abs(dy)), max(abs(dx),abs(dy))):
    print(single)

tab = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}

def norm(a):
    x = tab[a[0]]
    y = int(a[1]) - 1
    return (x, y)

# l:1 r:10 u:100 d:1000

def decode(d):
    dic = {1: 'L', 2: 'R', 4: 'U', 5: 'LU', 6: 'RU', 8: 'D', 9: 'LD', 10: 'RD'}
    return dic[d]

def getDirection(fx, fy, tx, ty):
    r = 0
    x = y = 0
    if fx < tx:
        r |= 1 << 1
        x = 1
    elif fx > tx:
        r |= 1
        x = -1
    else:
        x = 0
    if fy < ty:
        r |= 1 << 2
        y = 1
    elif fy > ty:
        r |= 1 << 3
        y = -1
    else:
        y = 0
    return r, x, y

fro = input()
fx, fy = norm(fro)
to = input()
tx, ty = norm(to)
move = []
while fx != tx or fy != ty:
    r, x, y = getDirection(fx, fy, tx, ty)
    move.append(decode(r))
    fx += x
    fy += y
print(len(move))
for m in move:
    print(m)

s = raw_input()
t = raw_input()
res = 0
moves = []
while s!=t:
  move = ""
  if s[0] < t[0]:
    move+='R'
    s = chr(ord(s[0]) + 1) + s[1]
  elif s[0] > t[0]:
    move+='L'
    s = chr(ord(s[0]) - 1) + s[1]
  if s[1] < t[1]:
    move+='U'
    s = s[0] + chr(ord(s[1]) + 1)
  elif s[1] > t[1]:
    move+='D'
    s = s[0] + chr(ord(s[1]) - 1)
  res+=1
  moves.append(move)
print(res)
for move in moves:
  print(move)

s = raw_input()
f = raw_input()

cnt = max(abs(ord(s[0]) - ord(f[0])), abs(int(s[1]) - int(f[1])))
print cnt
if cnt == 0:
    exit()

s1 = int(s[1])
f1 = int(f[1])
A = abs(ord(s[0]) - ord(f[0]))
B = abs(s1 - f1)

if ord(s[0]) < ord(f[0]):
    if s1 < f1:
        for i in range(min(A, B)):
            print "RU"
        if B > A:
            for i in range(max(A, B)-min(A, B)):
                print "U"
        else:
            for i in range(max(A, B)-min(A, B)):
                print "R"
        exit()
    elif s1 > f1:
        for i in range(min(A, B)):
            print "RD"
        if B > A:
            for i in range(max(A, B)-min(A, B)):
                print "D"
        else:
            for i in range(max(A, B)-min(A, B)):
                print "R"
        exit()
    else:
        for i in range(A):
            print "R"
        exit()

if ord(s[0]) > ord(f[0]):
    if s1 < f1:
        for i in range(min(A, B)):
            print "LU"
        if A > B:
            for i in range(max(A, B)-min(A, B)):
                print "L"
        else:
            for i in range(max(A, B)-min(A, B)):
                print "U"
        exit()
    elif s1 > f1:
        for i in range(min(A, B)):
            print "LD"
        if A > B:
            for i in range(max(A, B)-min(A, B)):
                print "L"
        else:
            for i in range(max(A, B)-min(A, B)):
                print "D"
        exit()
    else:
        for i in range(A):
            print "L"
        exit()

if ord(s[0]) == ord(f[0]):
    if s1 < f1:
        for i in range(B):
            print "U"
        exit()
    if s1 > f1:
        for i in range(B):
            print "D"
        exit()

s=input()
n=input()
if s==n:
    print(0)
    exit()
m=['','a','b','c','d','e','f','g','h']
for i in range(1,len(m)):
    if s[0]==m[i]:
        x=i
    if n[0]==m[i]:
        x2=i
y=int(s[1])
y2=int(n[1])
M=[]
b=''
xod=0
while True:
    if x>x2:
        x-=1
        b+='L'

    if x<x2:
        x+=1
        b+='R'
    if y>y2:
        y-=1
        b+='D'
    if y<y2:
        y+=1
        b+='U'
    xod+=1
    M.append(b)
    b=''
    if x==x2 and y==y2:
        break
print(xod)
for i in range(len(M)):
    print(M[i])

m = input()
n = input()
x1 = ord(m[0])
y1 = ord(m[1])
x2 = ord(n[0])
y2 = ord(n[1])
dx = x1-x2
dy = y1-y2
if abs(dx) > abs(dy) : print(abs(dx))
else: print(abs(dy))
while dx != 0 or dy != 0:
    result = ""
    b1=0
    b2=0
    if dx < 0 :
        dx = dx+1
        b1 = 1
    elif dx > 0:
        dx = dx-1
        b1 =-1
    if dy < 0:
        dy = dy + 1
        b2 = 1
    elif dy > 0:
        dy = dy - 1
        b2 = -1
    if b1 == 1 :
        result = result + "R"
    elif b1 == -1 :
        result = result + "L"
    if b2 == 1:
        result = result + "U"
    elif b2 == -1 :
        result = result + "D"
    print(result[0:len(result)])

startpoint = input()
endpoint = input()
start=[0,0]
end = [0,0]
counter = 0
moves = []
def gettingfirst(n):
    if n[0]=="a":
        return 1
    elif n[0]=="b":
        return 2
    elif n[0]=="c":
        return 3
    elif n[0]=="d":
        return 4
    elif n[0]=="e":
        return 5
    elif n[0]=="f":
        return 6
    elif n[0]=="g":
        return 7
    elif n[0]=="h":
        return 8
start[0] = gettingfirst(startpoint)
end[0] = gettingfirst(endpoint)
start[1] = int(startpoint[1])
end[1] = int(endpoint[1])
direction = [0,0]
direction[0] = end[0] - start[0]
direction[1] = end[1] - start[1]
while not 0 in direction:
    if direction[0] * direction[1] < 0:
        if direction[0] < 0:
            moves.append("LU")
            counter+=1
            direction[0] += 1
            direction[1] -= 1
        else:
            moves.append("RD")
            counter+=1
            direction[0]-=1
            direction[1]+=1
    else:
        if direction[0] < 0:
            moves.append("LD")
            counter+=1
            direction[0] += 1
            direction[1] += 1
        else:
            if direction[0] >0:
                moves.append("RU")
                counter+=1
                direction[0] -= 1
                direction[1] -= 1
while not direction[0] == 0:
    if direction[0] > 0:
        moves.append("R")
        counter+=1
        direction[0]-=1
    else:
        moves.append("L")
        counter+=1
        direction[0]+=1
while not direction[1] == 0:
    if direction[1] > 0:
        moves.append("U")
        counter+=1
        direction[1]-=1
    else:
        moves.append("D")
        counter+=1
        direction[1]+=1

print(counter)
for i in moves:
    print(i)

n=input()
s=input()
a=ord(n[0])-ord(s[0])
b=int(n[1])-int(s[1])
print(max(-a,-b,a,b))
while a!=0 or b!=0:
    ans=''
    if a>0:
        ans+="L"
        a-=1
    if a<0:
        ans+="R"
        a+=1
    if b>0:
        ans+="D"
        b-=1
    if b<0:
        ans+='U'
        b+=1
    print(ans)

s=input()
t=input()

kx=ord(s[0])-ord('a')+1
ky=int(s[1])

dx=ord(t[0])-ord('a')+1
dy=int(t[1])

path=[]
while kx!=dx or ky!=dy:
    move=''
    if kx>dx:
        move='L'
        kx-=1
    elif kx<dx:
        move='R'
        kx+=1
    if ky>dy:
        move=move+'D'
        ky-=1
    elif ky<dy:
        move=move+'U'
        ky+=1
    path.append(move)

print(len(path))
for x in path:
    print(x)

s=list(input())
a=list(input())
r=ord(s[0])-ord(a[0])
y=int(s[1])-int(a[1])
print(max(r,y,-r,-y))
l=[]
while(r!=0 or y!=0):
	l=[]
	if(r>0):
		l.append('L')
		r=r-1
	if(r<0):
		l.append('R')
		r=r+1
	if(y>0):
		l.append('D')
		y=y-1
	if(y<0):
		l.append('U')
		y=y+1
	print("".join(l))

# -*- coding: utf-8 -*-
"""
Created on Mon May 11 15:03:20 2020

@author: alexi
"""

class Node():

    def __init__(self, parent = None, position = None):
        self.parent = parent
        self.position = position
        self.g = 0
        self.h = 0
        self.f = 0

    def __eq__(self, other):
        return self.position == other.position

def heuristic(A, B):
    return abs(A[0]-B[0]) + abs(A[1]-B[1])

def Astar(maze, start, end):

    start_node = Node(None, start)
    start_node.g = 0
    start_node.h = heuristic(start, end)
    start_node.f = start_node.g + start_node.h

    end_node = Node(None, end)
    end_node.g = heuristic(start, end)
    end_node.h = 0
    end_node.f = end_node.g + end_node.h

    open_list = []
    closed_list = []

    open_list.append(start_node)

    while True:

        if len(open_list) == 0:
            return -1

        current_node = open_list[0]
        current_index = 0

        for index, item in enumerate(open_list):
            if item.f < current_node.f:
                current_node = item
                current_index = index

        open_list.pop(current_index)
        closed_list.append(current_node)

        if current_node == end_node:
            path = []
            current = current_node
            while current is not None:
                path.append(current.position)
                current = current.parent

            return path[::-1]
        else:

            children = []

            for new_position in [(0, -1),(0, 1),(1, 0),(-1, 0),(-1, -1),(-1, 1),(1, -1),(1, 1)]:

                node_position = (current_node.position[0] + new_position[0], current_node.position[1] + new_position[1])

                if node_position[0] > (len(maze)-1) or node_position[0] < 0 or node_position[1] > (len(maze[len(maze)-1])-1) or node_position[1] < 0:
                    continue

                if maze[node_position[0]][node_position[1]] != 0:
                    continue

                new_node = Node(current_node, node_position)
                new_node.g = current_node.g + 1
                new_node.h = heuristic(new_node.position, end)
                new_node.f = new_node.g + new_node.h

                children.append(new_node)

            visited = False

            for child in children:
                for open_child in open_list:
                    if child.position == open_child.position:
                        if child.f < open_child.f:
                            open_child = child
                        visited = True

                for closed_child in closed_list:
                    if child.position == closed_child.position:
                        if child.f < closed_child.f:
                            closed_child = child
                        visited = True

                if visited:
                    visited = False
                else:
                    open_list.append(child)

def move_the_king():

    maze = [[0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
            [0, 0, 0, 0, 0, 0, 0, 0],
          ]

    dic_letters = {'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7}
    dic_numbers = {8:0,7:1,6:2,5:3,4:4,3:5,2:6,1:7}
    dic_move = {(1,0):'D',(-1,0):'U',(0,1):'R',(0,-1):'L',(-1, -1):'LU',(-1, 1):'RU',(1, -1):'LD',(1, 1):'RD'}

    start = input()
    end = input()

    actual_start = (dic_numbers[int(start[1])],dic_letters[start[0]])
    actual_end = (dic_numbers[int(end[1])],dic_letters[end[0]])

    path = Astar(maze, actual_start, actual_end)
    print(len(path)-1)

    for i in range(1, len(path)):
        temp = (path[i][0] - path[i-1][0], path[i][1] - path[i-1][1])
        print(dic_move[temp])

move_the_king()

tmp = raw_input()
s = [ord(tmp[0]) - ord('a') + 1, int(tmp[1])]

tmp = raw_input()
t = [ord(tmp[0]) - ord('a') + 1, int(tmp[1])]

res = []
while s != t:
    dir = ''

    if s[0] < t[0]:
        dir += 'R'
        s[0] += 1
    elif s[0] > t[0]:
        dir += 'L'
        s[0] -= 1

    if s[1] > t[1]:
        dir += 'D'
        s[1] -= 1
    elif s[1] < t[1]:
        dir += 'U'
        s[1] += 1

    res.append(dir)

print len(res)
for r in res: print r

start = raw_input()
end = raw_input()
st_point = (ord(start[0]) - ord('a'), ord(start[1]) - ord('1'))
en_point = (ord(end[0]) - ord('a'), ord(end[1]) - ord('1'))

stepNum = max(abs(en_point[0] - st_point[0]), abs(en_point[1] - st_point[1]))

print stepNum

# the problem can be divided into 4 conditions (dialog)
x1, y1 = st_point[0], st_point[1]
x2, y2 = en_point[0], en_point[1]
path = []
if x1 < x2:
    if y1 < y2:
        while y1 < y2 and x1 < x2:
            x1 += 1
            y1 += 1
            path.append('RU')
        if y1 == y2:
            while x1 < x2:
                x1 += 1
                path.append('R')
        if x1 == x2:
            while y1 < y2:
                y1 += 1
                path.append('U')
    elif y1 > y2:
        while y1 > y2 and x1 < x2:
            x1 += 1
            y1 -= 1
            path.append('RD')
        if y1 == y2:
            while x1 < x2:
                x1 += 1
                path.append('R')
        if x1 == x2:
            while y1 > y2:
                y1 -= 1
                path.append('D')
    else:
        while x1 < x2:
            x1 += 1
            path.append('R')

if x1 > x2:
    if y1 < y2:
        while x1 > x2 and y1 < y2:
            x1 -= 1
            y1 += 1
            path.append('LU')
        if y1 == y2:
            while x1 > x2:
                x1 -= 1
                path.append('L')
        if x1 == x2:
            while y1 < y2:
                y1 += 1
                path.append('U')
    elif y1 > y2:
        while x1 > x2 and y1 > y2:
            x1 -= 1
            y1 -= 1
            path.append('LD')
        if y1 == y2:
            while x1 > x2:
                x1 -= 1
                path.append('L')
        if x1 == x2:
            while y1 > y2:
                y1 -= 1
                path.append('D')
    else:
        while x1 > x2:
            x1 -= 1
            path.append('L')

else:
    if y1 > y2:
        while y1 > y2:
            y1 -= 1
            path.append('D')
    elif y1 < y2:
        while y1 < y2:
            y1 += 1
            path.append('U')

for i in path:
    print i

point1=raw_input()
point2=raw_input()

l=list(point1+point2)

l = [w.replace('a', '1') for w in l]
l = [w.replace('b', '2') for w in l]
l = [w.replace('c', '3') for w in l]
l = [w.replace('d', '4') for w in l]
l = [w.replace('e', '5') for w in l]
l = [w.replace('f', '6') for w in l]
l = [w.replace('g', '7') for w in l]
l = [w.replace('h', '8') for w in l]

arr = []
steps = 0
l = map(int, l)
def infinity():
    while True:
        yield
for _ in infinity():
   if (l[2]>l[0] and l[3]>l[1]):
      l[0]+=1
      l[1]+=1
      steps+=1
      arr.append("RU" )
   elif (l[2]>l[0] and l[3]<l[1]):
      l[0]+=1
      l[1]-=1
      steps+=1
      arr.append("RD" )
   elif (l[2]>l[0] and l[3]==l[1]):
      l[0]+=1
      steps+=1
      arr.append("R" )
   elif (l[2]<l[0] and l[3]>l[1]):
      l[0]-=1
      l[1]+=1
      steps+=1
      arr.append("LU" )
   elif (l[2]<l[0] and l[3]<l[1]):
      l[1]-=1
      l[0]-=1
      steps+=1
      arr.append("LD" )
   elif (l[2]<l[0] and l[3]==l[1]):
      l[0]-=1
      steps+=1
      arr.append("L" )
   elif (l[2]==l[0] and l[3]>l[1]):
      l[1]+=1
      arr.append("U" )
      steps+=1
   elif (l[2]==l[0] and l[3]<l[1]):
      l[1]-=1
      steps+=1
      arr.append("D" )
   elif (l[2]==l[0] and l[3]==l[1]):
      break;
print steps
print "\n".join(arr)

class ShortestPathKing:
    def solve(self, s, t):
        movect = 0
        moves = []
        horiz = {}
        vert = {}
        startcol = ord(s[0]) - 96
        startrow = int(s[1])
        endcol = ord(t[0]) - 96
        endrow = int(t[1])
        coldist = endcol - startcol
        rowdist = endrow - startrow
        if coldist < 0:
            horiz["L"] = abs(coldist)
        else:
            horiz["R"] = coldist
        if rowdist < 0:
            vert["D"] = abs(rowdist)
        else:
            vert["U"] = rowdist

        horizontal = horiz.values()[0]
        vertical = vert.values()[0]
        if vertical > horizontal:
            for x in range(0, horizontal): moves.append((horiz.keys()[0] + vert.keys()[0]))
            vertical -= horizontal
            horizontal = 0
            for y in range(0, vertical): moves.append((vert.keys()[0]))
        else:
            for x in range(0, vertical): moves.append((horiz.keys()[0] + vert.keys()[0]))
            horizontal -= vertical
            vertical = 0
            for y in range(0, horizontal): moves.append((horiz.keys()[0]))

        print len(moves)
        for x in moves:
            print x

if __name__ == "__main__":
    s = str(raw_input())
    t = str(raw_input())
    spk = ShortestPathKing()
    spk.solve(s, t)

'''
Created on Jun 14, 2011

@author: andrei
'''
import sys

def main():
    def scrie(x, y):
        a[x][y] -= 1
        print a[x][y]
        for i in xrange(a[x][y]):
            aux = prev[x][y]
            print mv[aux]
            x -= dx[aux]
            y -= dy[aux]

    mv = ("L", "R", "U", "D", "LU", "LD", "RU", "RD")
    dx = (0, 0, -1, 1, -1, 1, -1, 1)
    dy = (-1, 1, 0, 0, -1, -1, 1, 1)

    a = []
    prev = []
    for i in xrange(10):
        a.append([])
        prev.append([])
        for j in xrange(10):
            a[i].append(0)
            prev[i].append(0)

    for i in xrange(10):
        a[i][0] = a[i][9] = a[0][i] = a[9][i] = 1

    fin = sys.stdin
    s = fin.readline()

    y, x = 8-(ord(s[0])-ord("a")), int(s[1])
    a[x][y] = -1

    s = fin.readline()
    y, x = 8-(ord(s[0])-ord("a")), int(s[1])

    if(a[x][y]==-1):
        print 0
        exit(0)

    a[x][y] = 1
    q = [(x, y)]

    while q:
        x, y = q.pop(0)

        for i in xrange(8):
            x1 = x + dx[i]
            y1 = y + dy[i]

            if a[x1][y1]==-1:
                a[x1][y1] = a[x][y] + 1
                prev[x1][y1] = i
                scrie(x1, y1)
                exit(0)

            if a[x1][y1]:
                continue

            a[x1][y1] = a[x][y] + 1
            prev[x1][y1] = i
            q.append((x1, y1))

if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-

start = raw_input().lower()
end = raw_input().lower()

sx, sy = ord(start[0]) - ord('a') + 1, int(start[1])
dx, dy = ord(end[0]) - ord('a') + 1, int(end[1])

n = 0
steps = []

while (sx, sy) != (dx, dy):
    n += 1
    if sx > dx:
        if sy > dy:
            steps.append('LD')
            sx -= 1
            sy -= 1
        elif sy == dy:
            steps.append('L')
            sx -= 1
        elif sy < dy:
            steps.append('LU')
            sx -= 1
            sy += 1

    elif sx == dx:
        if sy > dy:
            steps.append('D')
            sy -= 1
        elif sy < dy:
            steps.append('U')
            sy += 1

    elif sx < dx:
        if sy > dy:
            steps.append('RD')
            sx += 1
            sy -= 1
        elif sy == dy:
            steps.append('R')
            sx += 1
        elif sy < dy:
            steps.append('RU')
            sx += 1
            sy += 1

print(n)
print('\n'.join(steps))

a,b=raw_input(),raw_input()
a,b=ord(b[0])-ord(a[0]),ord(b[1])-ord(a[1])
print max(abs(a),abs(b))
if a and b:
	t='R'if a>0 else'L'
	t+='U'if b>0 else'D'
	a,b=abs(a),abs(b)
	for i in range(min(a,b)):
		print t
else:
	if a:
		if a>0:
			for i in range(a):
				print'R'
		else:
			for i in range(-a):
				print'L'
	if b>0:
		for i in range(b):
			print'U'
	else:
		for i in range(-b):
			print'D'
	exit()
if a<b:
	a=b-a
	t=t[1]
else:
	a=a-b
	t=t[0]
for i in range(a):
	print t

line=['a','b','c','d','e','f','g','h']
a=str(input())
b=str(input())
x=line.index(list(a)[0])-line.index(list(b)[0])
y=int(a[1])-int(b[1])
i=0
j=0
k=0
if abs(x)<abs(y):
    k=1
print(max(abs(x),abs(y)))
while i<min(abs(x),abs(y)):
    if x>0 and y>0:
        print('LD')
    if x<0 and y>0:
        print('RD')
    if x>0 and y<0:
        print('LU')
    if x<0 and y<0:
        print('RU')
    i=i+1
while j<abs(abs(x)-abs(y)):
    if k==1 and y<0:
        print('U')
    if k==1 and y>0:
        print('D')
    if k==0 and x<0:
        print('R')
    if k==0 and x>0:
        print('L')
    j=j+1

#Exercise 3A - Stupid King Path
#We need to take 2 lines of input, which we store as a
#single string to work with
a=input()+input()
#Then we tell our program to process store the Unicode
#code point behind the letters in the variable b which
#is meant to mimic the chess table and how many
#moves the king needs to make to get from one point to another.
#The input has the following format:
# letter_Number_letter_Number
a,b=(ord(a[i])-ord(a[i+2])for i in (0,1))
print(max(a,-a,b,-b))
#Now, we analyse the directions in which the king
#needs to move when geting from point a to point b
while a!=0 or b!=0:
  r=''
  if a<0:
      r='R';a+=1
  if a>0:r='L';a-=1
  if b<0:r+='U';b+=1
  if b>0:r+='D';b-=1
  #And we print out the moves he makes
  print(r)

def move2(s, d):
    cdist = ord(d[0]) - ord(s[0])
    rdist = int(d[1]) - int(s[1])
    path = []

    # do diagonal
    d = min(abs(cdist), abs(rdist))
    if cdist > 0:
        cd = 'R'
        cdist -= d
    else:
        cd = 'L'
        cdist += d
    if rdist > 0:
        rd = 'U'
        rdist -= d
    else:
        rd = 'D'
        rdist += d

    dire = cd + rd
    for i in range(d):
        path.append(dire)

    if cdist != 0:
        for i in range(abs(cdist)):
            path.append(cd)
    elif rdist != 0:
        for i in range(abs(rdist)):
            path.append(rd)
    return path

soln = move2((raw_input()), (raw_input()))
print len(soln)
for l in soln:
    print l

p1, p2 = input(), input()
x1, y1 = ord(p1[0]) - ord('a') + 1, int(p1[1])
x2, y2 = ord(p2[0]) - ord('a') + 1, int(p2[1])
x = x2-x1
y = y2-y1
d1, d2 = 'L', 'D'
if x > 0:
    d1 = 'R'
if y > 0:
    d2 = 'U'
if abs(x) > abs(y):
    print(abs(x))
else:
    print(abs(y))
# import pdb
# pdb.set_trace()
if x < 0:
    x = -x
if y < 0:
    y = -y
while x or y:
    if x:
        x -= 1
        print(d1, end='')
    if y:
        y -= 1
        print(d2, end='')
    print()

s = input()
f = input()
x = ord(s[0])-ord(f[0])
y = ord(s[1])-ord(f[1])
print(max(x,y,-x,-y))
while x != 0 or y != 0:
    st = ""
    if x < 0:
      st += "R"
      x = x + 1
    if x > 0:
        st = st + "L"
        x = x - 1
    if y < 0:
        st = st + "U"
        y = y + 1
    if y > 0:
        st = st + "D"
        y = y - 1
    print(st)

from math import *

def sign(x):
	if x < 0:
		return -1
	elif x > 0:
		return 1
	return 0

s = input()
x = ord(s[0])-ord('a')
y = int(s[1])
t = input()
tx = ord(t[0])-ord('a')
ty = int(t[1])
vx = tx-x
if vx < 0:
	ansx = 'L'
else:
	ansx = 'R'
vy = ty-y
if vy < 0:
	ansy = 'D'
else:
	ansy = 'U'
print(max(abs(vx),abs(vy)))
while vx != 0 or vy != 0:
	ans = ""
	if vx != 0:
		ans += ansx
		vx -= sign(vx)
	if vy != 0:
		ans += ansy
		vy -= sign(vy)
	print(ans)

s = input()
t = input()
d1 = ord(s[0]) - ord(t[0])
d2 = ord(s[1]) - ord(t[1])
if d1 < 0:
    d3 = -d1
else:
    d3 = d1
if d2 < 0:
    d4 = -d2
else:
    d4 = d2
if d3 > d4:
    print(d3)
    r = d3
else:
    print(d4)
    r = d4
for i in range(r):
    if i < d3:
        if d1 < 0:
            print("R", end = '')
        elif d1 > 0:
            print("L", end = '')
    if i < d4:
        if d2 < 0:
            print("U")
        elif d2 > 0:
            print("D")
    else:
        print("")

origin = input()
target = input()

def char2Num(c):
  return ord(c)-ord('a')+1

def num2Char(d):
  return chr(ord('a')+d-1)

x_origin = char2Num(origin[0])
y_origin = int(origin[1])

x_target = char2Num(target[0])
y_target = int(target[1])

x = x_origin
y = y_origin
steps = []

while x < x_target and y < y_target: # keep RU until x reaches x_target or y reaches y_target
  steps.append('RU')
  x += 1
  y += 1
while x<x_target and y > y_target:
  steps.append('RD')
  x += 1
  y -= 1
while x > x_target and y < y_target:
  steps.append('LU')
  x -= 1
  y += 1
while x>x_target and y > y_target:
  steps.append('LD')
  x -= 1
  y -= 1
while x < x_target:
  steps.append('R')
  x += 1
while x > x_target:
  steps.append('L')
  x -= 1
while y < y_target:
  steps.append('U')
  y += 1
while y > y_target:
  steps.append('D')
  y -= 1
print(len(steps))
for step in steps:
  print(step)

mov = {-1:'RU',1:'LD'}
s,t = input(),input()
x,y,x1,y1 = ord(s[0])-96,int(s[1]),ord(t[0])-96,int(t[1])
v,h = abs(x-x1),abs(y-y1)
if x==x1 or y==y1:
    temp = (x-x1)//abs(x-x1) if x-x1 else (y-y1)//abs(y-y1) if y-y1 else 0
    if temp == 0: print(0); exit()
    jmp = max(abs(x-x1),abs(y-y1))
    p0 = [mov[temp][0]]*jmp if y-y1 == 0 else [mov[temp][1]]*jmp
    print(len(p0)); print(*p0)
else:
    pos = mov[(x-x1)//v][0] + mov[(y-y1)//h][1]
    j1,j2 = v-h if v-h > -1 else abs(v-h)+v, h-v if h-v > -1 else abs(h-v)+h
    p1,p2 = [pos[0]]*j1+[pos]*h,[pos[1]]*j2+[pos]*v
    if len(p1) < len(p2): print(len(p1)); print(*p1)
    else: print(len(p2)); print(*p2)

dict={'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}

c=list(input())
d=list(input())
c[0]=dict[c[0]]
d[0]=dict[d[0]]
c[1]=int(c[1])
d[1]=int(d[1])
hor=[]
if c[0]>=d[0]:
    hor.extend(list("L"*(c[0]-d[0])))
else:
    hor.extend(list("R"*abs(c[0]-d[0])))

ver=[]
if c[1]>=d[1]:
    ver.extend(list("D"*(c[1]-d[1])))
else:
    ver.extend(list("U"*abs(c[1]-d[1])))
print(max(len(ver),len(hor)))
#print(hor,ver)
for i in range(min(len(ver),len(hor))):
    print(hor[i],end='')
    print(ver[i])
if len(ver)>len(hor):
    if  len(hor)!=0:
        print('\n'.join(ver[(len(hor)):]))
    else:
        print('\n'.join(ver))
elif len(ver)<len(hor):
    if  len(ver)!=0:
        print('\n'.join(hor[abs(len(ver)):]))
    else:
        print('\n'.join(hor))

starting = list(input().lower())
end_up = list(input())
# print(starting)
string_output = []
count = 0
letter_dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}

starting[1] = int(starting[1])
end_up[1] = int(end_up[1])
starting[0] = letter_dict[starting[0]]
end_up[0] = letter_dict[end_up[0]]

while starting[0] != end_up[0] and starting[1] != end_up[1]:
    if starting[0] > end_up[0]:
        starting[0] -= 1
        if starting[1] > end_up[1]:
            starting[1] -= 1
            string_output.append('LD')
        else:
            starting[1] += 1
            string_output.append('LU')
    else:
        starting[0] += 1
        if starting[1] > end_up[1]:
            starting[1] -= 1
            string_output.append('RD')
        else:
            starting[1] += 1
            string_output.append('RU')
    count += 1

while starting[0] != end_up[0] or starting[1] != end_up[1]:
    if starting[1] == end_up[1]:
        if starting[0] > end_up[0]:
            starting[0] -= 1
            string_output.append('L')

        else:
            starting[0] += 1
            string_output.append('R')

    else:
        if starting[1] > end_up[1]:
            starting[1] -= 1
            string_output.append('D')
        else:
            starting[1] += 1
            string_output.append('U')

    count += 1

print(count)
for i in string_output:
    print(i)

start = raw_input()
end = raw_input()
x = ord(end[0])-ord(start[0])
y = int(end[1])-int(start[1])
a = min(abs(x),abs(y))
print max(abs(x),abs(y))
if x>=0 and y>=0:
    for _ in xrange(a):
        print 'RU'
    for _ in xrange(abs(x)-a):
        print 'R'
    for _ in xrange(abs(y)-a):
        print 'U'

if x>=0 and y<0:
    for _ in xrange(a):
        print 'RD'
    for _ in xrange(abs(x)-a):
        print 'R'
    for _ in xrange(abs(y)-a):
        print 'D'

if x<0 and y>=0:
    for _ in xrange(a):
        print 'LU'
    for _ in xrange(abs(x)-a):
        print 'L'
    for _ in xrange(abs(y)-a):
        print 'U'

if x<0 and y<0:
    for _ in xrange(a):
        print 'LD'
    for _ in xrange(abs(x)-a):
        print 'L'
    for _ in xrange(abs(y)-a):
        print 'D'

import time

def calculateCoords(c):
    return (8 - int(c[1]), ord(c[0]) - 97)

def run():
    start = calculateCoords(input())
    end = calculateCoords(input())

    seen = [[False for x in range(8)] for y in range(8)]
    seen[start[0]][start[1]] = True
    toCheck = []
    toCheck.append((start, []))

    while True:
        temp = []
        for (position, l) in toCheck:
            r = position[0]
            c = position[1]
            seen[r][c] = True
            if r == end[0] and c == end[1]:
                print(len(l))
                for ch in l:
                    print(ch)
                return
            if r > 0:
                if c > 0 and not seen[r - 1][c - 1]:
                    newl1 = [x for x in l]
                    newl1.append("LU")
                    temp.append(((r - 1, c - 1), newl1))
                if c < 7 and not seen[r - 1][c + 1]:
                    newl2 = [x for x in l]
                    newl2.append("RU")
                    temp.append(((r - 1, c + 1), newl2))
                newl3 = [x for x in l]
                newl3.append("U")
                temp.append(((r - 1, c), newl3))
            if r < 7:
                if c > 0 and not seen[r + 1][c - 1]:
                    newl4 = [x for x in l]
                    newl4.append("LD")
                    temp.append(((r + 1, c - 1), newl4))
                if c < 7 and not seen[r + 1][c + 1]:
                    newl5 = [x for x in l]
                    newl5.append("RD")
                    temp.append(((r + 1, c + 1), newl5))
                newl6 = [x for x in l]
                newl6.append("D")
                temp.append(((r + 1, c), newl6))
            if c > 0:
                newl7 = [x for x in l]
                newl7.append("L")
                temp.append(((r, c - 1), newl7))
            if c < 7:
                newl8 = [x for x in l]
                newl8.append("R")
                temp.append(((r, c + 1), newl8))
        toCheck = []
        toCheck.extend(temp)

run()

s = input()
t = input()

delta_col = ord(t[0]) - ord(s[0])
delta_row = int(t[1]) - int(s[1])

num_moves = min(abs(delta_col), abs(delta_row))

if delta_col > 0:
    delta_col -= num_moves
    if delta_row > 0:
        moves_list = ['RU' for __ in range(num_moves)]
        delta_row -= num_moves
    else:
        moves_list = ['RD' for __ in range(num_moves)]
        delta_row += num_moves

else:
    delta_col += num_moves
    if delta_row > 0:
        moves_list = ['LU' for __ in range(num_moves)]
        delta_row -= num_moves

    else:
        moves_list = ['LD' for __ in range(num_moves)]
        delta_row += num_moves

num_rem_moves = max(abs(delta_col), abs(delta_row))
num_moves += num_rem_moves

if delta_col > 0:
    moves_list += ['R' for __ in range(num_rem_moves)]
elif delta_col < 0:
    moves_list += ['L' for __ in range(num_rem_moves)]
elif delta_row > 0:
    moves_list += ['U' for __ in range(num_rem_moves)]
elif delta_row < 0:
    moves_list += ['D' for __ in range(num_rem_moves)]

print(num_moves)
print(*moves_list, sep='\n')

__author__ = 'liraim'

def read_input():
    start = input()
    target = input()
    return {'start': parse_position(start), 'target': parse_position(target)}

def parse_position(chess_position):
    column = ord(chess_position[0]) - ord('a')
    row = int(chess_position[1]) - 1
    return column, row

def solve(input_data):
    start = input_data['start']
    target = input_data['target']
    diagonal_move_count = min(abs(start[0] - target[0]), abs(start[1] - target[1]))
    move_count = diagonal_move_count + \
                 (abs(start[0] - target[0]) - diagonal_move_count) + \
                 (abs(start[1] - target[1]) - diagonal_move_count)
    diagonal_direction = ('R' if target[0] - start[0] > 0 else 'L') + ('D' if target[1] - start[1] < 0 else 'U')
    answer = [diagonal_direction] * diagonal_move_count
    answer += ['D' if target[1] - start[1] > 0 else 'U'] * (abs(start[1] - target[1]) - diagonal_move_count) + \
              ['R' if target[0] - start[0] > 0 else 'L'] * (abs(start[0] - target[0]) - diagonal_move_count)
    return {'count': move_count, 'moves': answer}

def output_answer(answer):
    print(answer['count'])
    for move in answer['moves']:
        print(move)

output_answer(solve(read_input()))

s1 = input()
s2 = input()

start = (8 - (ord(s1[1]) -ord('0')), ord(s1[0]) - ord('a'))
end = (8 - (ord(s2[1]) - ord('0')), ord(s2[0]) - ord('a'))

x = end[0] - start[0]
y = end[1] - start[1]
step = max(abs(x), abs(y))
print(step)
a = min(abs(x), abs(y))
if x >= 0 and y >= 0:
    for i in range(0, a):
        print("RD")
elif x >= 0 and y <= 0:
    for i in range(0, a):
        print("LD")
elif x <= 0 and y <= 0:
    for i in range(0, a):
        print("RU")
elif x <= 0 and y <= 0:
    for i in range(0, a):
        print("LU")

if abs(x) != a:
    b = abs(x) - a
    if x >= 0:
        for i in range(0, b):
            print("R")
    else:
        for i in range(0, b):
            print("L")
else:
    b = abs(y) - a
    if y >= 0:
        for i in range(0, b):
            print("R")
    else:
        for i in range(0, b):
            print("L")

# print(start, end)

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import timeit
import time
import sys
import io
import re
import math
start = time.clock()
cnt=0
rot=[]
s=list(raw_input())
s=[int(ord(s[0]))-96,int(s[1])]
g=list(raw_input())
g=[int(ord(g[0]))-96,int(g[1])]
#naname
while g[0]<>s[0] and g[1]<>s[1]:
    if g[0]>s[0] and g[1]>s[1]:
        s[0]+=1
        s[1]+=1
        cnt+=1
        rot.append('RU')
    elif g[0]<s[0] and g[1]<s[0]:
        s[0]-=1
        s[1]-=1
        cnt+=1
        rot.append('LD')
    elif g[0]>s[0] and g[1]<s[1]:
        s[0]+=1
        s[1]-=1
        cnt+=1
        rot.append('RD')
    else:
        s[0]-=1
        s[1]+=1
        cnt+=1
        rot.append('LU')
while g[0]<>s[0] or g[1]<>s[1]:
    if g[0]>s[0]:
        s[0]+=1
        cnt+=1
        rot.append('R')
    elif g[0]<s[0]:
        s[0]-=1
        cnt+=1
        rot.append('L')
    elif g[1]>s[1]:
        s[1]+=1
        cnt+=1
        rot.append('U')
    else:
        s[1]-=1
        cnt+=1
        rot.append('D')
print cnt
for i in rot:
    print i

#!/usr/bin/python
src = raw_input()
dst = raw_input()

myD = { 'a': 1, 'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8 }

src_c = myD[src[0]]
src_r = int(src[1])
dst_c = myD[dst[0]]
dst_r = int(dst[1])

#print src_r, src_c, dst_r, dst_c
move_cnt = 0
moves = ""

while (src_r != dst_r and src_c != dst_c):
    move_cnt += 1

    if(src_r < dst_r and src_c < dst_c):
        src_r += 1; src_c += 1; moves += "RU\n"

    elif(src_r > dst_r and src_c > dst_c):
        src_r -= 1; src_c -= 1; moves += "LD\n"

    elif(src_r > dst_r and src_c < dst_c):
        src_r -= 1; src_c += 1; moves += "RD\n"

    elif(src_r < dst_r and src_c > dst_c):
        src_r += 1; src_c -= 1; moves += "LU\n"

    elif(src_r == dst_r and src_c > dst_c):
        src_c -= 1; moves += "L\n"

    elif(src_r == dst_r and src_c < dst_c):
        src_c += 1; moves += "R\n"

    elif(src_r > dst_r and src_c == dst_c):
        src_r -= 1; moves += "D\n"

    elif(src_r < dst_r and src_c == dst_c):
        src_r += 1; moves += "U\n"

moves = moves.strip('\n')
print move_cnt
print moves

s1,s2 = raw_input(),raw_input()
x1,x2 = '0abcdefgh'.index(s1[0]),'0abcdefgh'.index(s2[0])
y1,y2 = int(s1[1]),int(s2[1])

ans = ['R']*max(0,x2-x1) + ['L']*max(0,x1-x2) + ['U']*max(0,y2-y1) + ['D']*max(0,y1-y2)
if ( len(set(ans)) == 1):
	print len(ans)
	for i in ans : print i
elif ( len(set(ans)) == 2):
	print max( abs(x1-x2),abs(y1-y2))
	while len(set(ans)) == 2:
		print ans.pop(0)+ans.pop(-1)

	while len(ans)>0:
		print ans.pop()

s=list(input())
t=list(input())
n=ord(t[0])-ord(s[0])
m=int(t[1])-int(s[1])
a=min(abs(m),abs(n))
b=max(abs(m),abs(n))-a
steps=[]
if m>=0 and n>=0:
    steps.append("RU")
    steps=steps*a
    if m>=n:
        steps_s=[]
        steps_s.append("U")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("R")
        steps_s=steps_s*b
    steps=steps+steps_s
elif m>=0 and n<=0:
    steps.append("LU")
    steps=steps*a
    if m>n:
        steps_s=[]
        steps_s.append("U")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("L")
        steps_s=steps_s*b
    steps=steps+steps_s
elif m<=0 and n>=0:
    steps.append("RD")
    steps=steps*a
    if m>n:
        steps_s=[]
        steps_s.append("D")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("R")
        steps_s=steps_s*b
    steps=steps+steps_s
elif m<=0 and n<=0:
    steps.append("LD")
    steps=steps*a
    if m>n:
        steps_s=[]
        steps_s.append("D")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("L")
        steps_s=steps_s*b
    steps=steps+steps_s
print(a+b)
for i in steps:
    print(i)

import string
first_position = str(input())
second_position = str(input())
letter_list = list(string.ascii_lowercase[0:8])
number_list = list(range(1, 9))
d = dict(zip(letter_list, number_list))
t1 = d[first_position[0]]
t2 = d[second_position[0]]
position_list = [(t1, int(first_position[1])), (t2, int(second_position[1]))]
tt_1 = position_list[0][1]
h_1_1 = abs(position_list[0][0]-position_list[1][0])
h_1_2 = abs(position_list[0][1]-position_list[1][1])
h_1 = min(h_1_1, h_1_2)
h_2 = max(h_1_1, h_1_2) - min(h_1_1, h_1_2)
h = h_1 + h_2
print (h)

delta = 0
for i in range(h_1):
    if (t1 < t2) and (int(first_position[1]) < int(second_position[1])):
        print ('RU')
        delta += 1
    if (t1 < t2) and (int(first_position[1]) > int(second_position[1])):
        print ('RD')
        delta += 1
    if (t1 > t2) and (int(first_position[1]) < int(second_position[1])):
        print ('LU')
        delta -= 1
    if (t1 > t2) and (int(first_position[1]) > int(second_position[1])):
        print ('LD')
        delta -= 1

if h_1_1 < h_1_2:
    t1 = t1 + delta
if h_1_2 < h_1_1 and (int(first_position[1]) <= int(second_position[1])):
    tt_1 = tt_1 + delta
if  h_1_2 < h_1_1 and (int(first_position[1]) > int(second_position[1])):
    tt_1 = tt_1 - delta

for j in range(h_2):
    if t1 == t2 and int(first_position[1]) < int(second_position[1]):
        print ('U')
    if t1 == t2 and int(first_position[1]) > int(second_position[1]):
        print ('D')
    if tt_1 == int(second_position[1]) and d[first_position[0]] < d[second_position[0]]:
        print ('R')
    if tt_1 == int(second_position[1]) and d[first_position[0]] > d[second_position[0]]:
        print ('L')

def p(a):
    c = 'zabcdefgh'.index(a[0])
    r = int(a[1])
    return c, r

def move2(s, d, p):
    cdist = d[0] - s[0]
    rdist = d[1] - s[1]
    path = []

    # do diagonal
    d = min(abs(cdist), abs(rdist))
    cd = 'R' if cdist > 0 else 'L'
    rd = 'U' if rdist > 0 else 'D'
    dire = cd + rd
    if d:
        path += [dire * d]
    if cdist > 0:
        cdist -= d
    else:
        cdist += d
    if rdist > 0:
        rdist -= d
    else:
        rdist += d

    if cdist != 0:
        cd = 'R' if cdist > 0 else 'L'
        path += [cd * abs(cdist)]
    else:
        rd = 'U' if rdist > 0 else 'D'
        path += [rd * abs(rdist)]
    return path

def move(s, d, p):
    if s == d:  # reached
        return p
    if s[0] == d[0]: # same c
        dist = d[1] - s[1]
        di = 'U' if dist > 0 else 'D'
        return p + ([di] * abs(dist))
    if s[1] == d[1]:  # same r
        dist = d[0] - s[0]
        di = 'R' if dist > 0 else 'L'
        return p + ([di] * abs(dist))
    else:
        if s[0] < d[0] and s[1] < d[1]:
            return move((s[0]+1, s[1]+1 ), d, p + ['RU'])
        if s[0] < d[0] and s[1] > d[1]:
            return move((s[0]+1, s[1]-1 ), d, p + ['RD'])
        if s[0] > d[0] and s[1] < d[1]:
            return move((s[0]-1, s[1]+1 ), d, p + ['LU'])
        if s[0] > d[0] and s[1] > d[1]:
            return move((s[0]-1, s[1]-1 ), d, p + ['LD'])

soln = move2(p(raw_input()), p(raw_input()), [])
print len(soln)
for l in soln:
    print l

#!/usr/bin/python

def c2ij(s):
    i, j = s
    i = ord(i) - ord('a') + 1
    j = int(j)
    return i, j

def dmov(di, dj):
    if   di>0 and dj>0: c='RU'; dx, dy =  1,  1
    elif di>0 and dj<0: c='RD'; dx, dy =  1, -1
    elif di<0 and dj>0: c='LU'; dx, dy = -1,  1
    else              : c='LD'; dx, dy = -1, -1

    n = min(abs(di), abs(dj))

    return c, n, dx, dy

def hmove(di, dj):
    if   di>0: c='R'
    elif di<0: c='L'
    elif dj>0: c='U'
    else     : c='D'

    n = max(abs(di), abs(dj))
    return c, n

f = raw_input()
t = raw_input()

i0, j0 = c2ij(f)
i1, j1 = c2ij(t)

# diagonal move
di = i1 - i0
dj = j1 - j0

dc, dn, ddx, ddy = dmov(di, dj)

for i in range(dn):
    i0 += ddx
    j0 += ddy
    print dc

di = i1 - i0
dj = j1 - j0
hc, hn = hmove(di, dj)

for i in range(hn):
    print hc

#!/usr/bin/python
s1= raw_input()
s2 =raw_input()

#if ord(s2[0])-ord(s1[0])<0 :
#    print 'ss',ord(s2[0])-ord(s1[0])
if ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1])<0 :
    ss = 'LD'
elif  ord(s2[0])-ord(s1[0])>0 and ord(s2[1])-ord(s1[1]) <0 :
    ss='RD'
elif  ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1]) >0 :
    ss='LU'
else:
    ss='RU'

if ord(s2[0])-ord(s1[0])<0:
    ss1 = 'U'
else :
    ss1 = 'D'

if ord(s2[1])-ord(s1[1])<0:
    ss2 = 'R'
else :
    ss2 = 'L'

big = abs(ord(s2[0])-ord(s1[0]))
small = abs(ord(s2[1])-ord(s1[1]))

if big < small :
    temp =big;
    big=small;
    small=temp;
    ss1=ss2;

print big

for i in range (0,small):
    print ss

for i in range (0,big-small):
    print ss1

s=list(input())
t=list(input())
n=ord(t[0])-ord(s[0])
m=int(s[1])-int(t[1])
a=min(abs(m),abs(n))
b=max(abs(m),abs(n))-a
steps=[]
if m>=0 and n>=0:
    steps.append("RD")
    steps=steps*a
    if m>=n:
        steps_s=[]
        steps_s.append("D")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("R")
        steps_s=steps_s*b
    steps=steps+steps_s
elif m>=0 and n<=0:
    steps.append("RU")
    steps=steps*a
    if m>n:
        steps_s=[]
        steps_s.append("U")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("R")
        steps_s=steps_s*b
    steps=steps+steps_s
elif m<=0 and n>=0:
    steps.append("LD")
    steps=steps*a
    if m>n:
        steps_s=[]
        steps_s.append("D")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("L")
        steps_s=steps_s*b
    steps=steps+steps_s
elif m<=0 and n<=0:
    steps.append("LU")
    steps=steps*a
    if m>n:
        steps_s=[]
        steps_s.append("U")
        steps_s=steps_s*b
    else:
        steps_s=[]
        steps_s.append("L")
        steps_s=steps_s*b
    steps=steps+steps_s
print(a+b)
for i in steps:
    print(i)

l=lambda:map(ord, raw_input())
(s,S),(t,T)=l(),l()
r=t-s
u=T-S
R=abs(r)
U=abs(u)
for i in range(max(R, U)):
    o = ""
    o += "R" if R>0 and r>0 else ""
    o += "L" if R>0 and r<0 else ""
    o += "U" if U>0 and u>0 else ""
    o += "D" if U>0 and u<0 else ""
    R-=1
    U-=1
    print o

a=list(input());b=list(input());x,y,_x,_y=ord(a[0])-97,int(a[1])-1,ord(b[0])-97,int(b[1])-1
print(max(abs(x-_x),abs(y-_y)))
for i in range(min(abs(x-_x),abs(y-_y))):
    if(x<_x):print('R',end='')
    else:print('L',end='')
    if(y>_y):print('D',end='')
    else:print('U',end='')
    print('')
if(abs(x-_x)==abs(y-_y)):
    x=_x;y=_y
elif(abs(x-_x)<abs(y-_y)):x=_x
else:y=_y
for i in range(abs(x-_x)+abs(y-_y)):
    if(y>_y):print('D',end='')
    elif(y<_y):print('U',end='')
    if(x<_x):print('R',end='')
    elif(x>_x):print('L',end='')
    print('')

#!/usr/bin/python
s1= raw_input()
s2 =raw_input()

#if ord(s2[0])-ord(s1[0])<0 :
#    print 'ss',ord(s2[0])-ord(s1[0])
if ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1])<0 :
    ss = 'LD'
elif  ord(s2[0])-ord(s1[0])>0 and ord(s2[1])-ord(s1[1]) <0 :
    ss='RD'
elif  ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1]) >0 :
    ss='LU'
else:
    ss='RU'

if ord(s2[0])-ord(s1[0])<0:
    ss1 = 'L'
else :
    ss1 = 'R'

if ord(s2[1])-ord(s1[1])<0:
    ss2 = 'D'
else :
    ss2 = 'U'

big = abs(ord(s2[0])-ord(s1[0]))
small = abs(ord(s2[1])-ord(s1[1]))
if big < small :
    temp =big;
    big=small;
    small=big;
    ss1=ss2;

print big

for i in range (0,small):
    print ss

for i in range (0,big-small):
    print ss1

s = raw_input()
t = raw_input()
if s[0] == t[0]: # same column
	if int(s[1]) == int(t[1]):
		print 0
	elif int(s[1]) > int(t[1]):
		print int(s[1]) - int(t[1])
		for i in xrange(int(s[1]) - int(t[1])):
			print "D"
	else:
		print int(t[1]) - int(s[1])
		for i in xrange(int(t[1]) - int(s[1])):
			print "U"
elif s[1] == t[1]: # same row
	if s[0] == t[0]:
		print 0
	elif s[0] > t[0]:
		print ord(s[0]) - ord(t[0])
		for i in xrange(ord(s[0]) - ord(t[0])):
			print "L"
	else:
		print ord(t[0]) - ord(s[0])
		for i in xrange(ord(t[0]) - ord(s[0])):
			print "R"
elif ord(t[0]) > ord(s[0]): # right
	if int(t[1]) > int(s[1]): #top right
		if int(t[1]) - int(s[1]) == (ord(t[0]) - ord(s[0])):
			print int(t[1]) - int(s[1])
			for i in xrange(int(t[1]) - int(s[1])):
				print "RU"
		elif int(t[1]) - int(s[1]) > (ord(t[0]) - ord(s[0])):
			print (ord(t[0]) - ord(s[0])) + (int(t[1]) - int(s[1])-(ord(t[0]) - ord(s[0])))
			for i in xrange((ord(t[0]) - ord(s[0]))):
				print "RU"
			for i in xrange(int(t[1]) - int(s[1])-(ord(t[0]) - ord(s[0]))):
				print "U"
		else:
			#print (ord(t[0]) - ord(s[0])) + (int(t[1]) - int(s[1])-(ord(t[0]) - ord(s[0])))
			print (int(t[1]) - int(s[1])) + ((ord(t[0]) - ord(s[0]))-(int(t[1]) - int(s[1])))
			for i in xrange(int(t[1]) - int(s[1])):
				print "RU"
			for i in xrange((ord(t[0]) - ord(s[0]))-(int(t[1]) - int(s[1]))):
				print "R"
	else: # bottom right
		if int(s[1]) - int(t[1]) == (ord(t[0]) - ord(s[0])):
			print int(s[1]) - int(t[1])
			for i in xrange(int(s[1]) - int(t[1])):
				print "RD"
		elif int(s[1]) - int(t[1]) > (ord(t[0]) - ord(s[0])):
			print (ord(t[0]) - ord(s[0])) + (int(s[1]) - int(t[1])-(ord(t[0]) - ord(s[0])))
			for i in xrange((ord(t[0]) - ord(s[0]))):
				print "RD"
			for i in xrange(int(s[1]) - int(t[1])-(ord(t[0]) - ord(s[0]))):
				print "D"
		else:
			#print (ord(t[0]) - ord(s[0])) + (int(s[1]) - int(t[1])-(ord(t[0]) - ord(s[0])))
			print (int(s[1]) - int(t[1])) + ((ord(t[0]) - ord(s[0]))-(int(s[1]) - int(t[1])))
			for i in xrange(int(s[1]) - int(t[1])):
				print "RD"
			for i in xrange((ord(t[0]) - ord(s[0]))-(int(s[1]) - int(t[1]))):
				print "R"

elif ord(t[0]) < ord(s[0]): # left
	if int(t[1]) > int(s[1]): #top left
		#print "up"
		if int(t[1]) - int(s[1]) == (ord(s[0]) - ord(t[0])):
			print int(t[1]) - int(s[1])
			for i in xrange(int(t[1]) - int(s[1])):
				print "LU"
		elif int(t[1]) - int(s[1]) > (ord(s[0]) - ord(t[0])):
			print (ord(s[0]) - ord(t[0])) + (int(t[1]) - int(s[1])-(ord(s[0]) - ord(t[0])))
			for i in xrange((ord(s[0]) - ord(t[0]))):
				print "LU"
			for i in xrange(int(t[1]) - int(s[1])-(ord(t[0]) - ord(s[0]))):
				print "U"
		else:
			#print (ord(s[0]) - ord(t[0])) + (int(t[1]) - int(s[1])-(ord(s[0]) - ord(t[0])))
			print (int(t[1]) - int(s[1])) + ((ord(s[0]) - ord(t[0]))-(int(t[1]) - int(s[1])))
			for i in xrange(int(t[1]) - int(s[1])):
				print "LU"
			for i in xrange((ord(s[0]) - ord(t[0]))-(int(t[1]) - int(s[1]))):
				print "L"
	else: # bottom left
		if int(s[1]) - int(t[1]) == (ord(s[0]) - ord(t[0])):
			print int(s[1]) - int(t[1])
			for i in xrange(int(s[1]) - int(t[1])):
				print "LD"
		elif int(s[1]) - int(t[1]) > (ord(s[0]) - ord(t[0])):
			print (ord(s[0]) - ord(t[0])) + (int(s[1]) - int(t[1])-(ord(s[0]) - ord(t[0])))
			for i in xrange((ord(s[0]) - ord(t[0]))):
				print "LD"
			for i in xrange(int(s[1]) - int(t[1])-(ord(s[0]) - ord(t[0]))):
				print "D"
		else:
			#print (ord(s[0]) - ord(t[0])) + (int(s[1]) - int(t[1])-(ord(s[0]) - ord(t[0])))
			print (int(s[1]) - int(t[1])) + ((ord(s[0]) - ord(t[0]))-(int(s[1]) - int(t[1])))
			for i in xrange(int(s[1]) - int(t[1])):
				print "LD"
			for i in xrange((ord(s[0]) - ord(t[0]))-(int(s[1]) - int(t[1]))):
				print "L"

import math, collections, sys
input = sys.stdin.readline
s = input()
t = input()
v = ord(t[0]) - ord(s[0])
h = int(t[1]) - int(s[1])
if v < 0:
    vd = 'U'
elif v > 0:
    vd = 'D'
if h < 0:
    hd = 'R'
elif h > 0:
    hd = 'L'
dia = min(abs(v), abs(h))
ans = []
for i in range(dia):
    ans.append(hd+vd)
for i in range(abs(v)-dia):
    ans.append(vd)
for i in range(abs(h)-dia):
    ans.append(hd)
print(len(ans))
for i in ans:
    print(i)

s=raw_input()
d=raw_input()
a=[0]
m={}
for i in range(8):
	for j in range(1,9):
		m[chr(ord('a')+i)+str(9-j)]=i*8+j-1

ss=m[s]
dd=m[d]
r=dd/8-ss/8
c=dd%8-ss%8

print((abs(r)-abs(c))+min(abs(r),abs(c)))

def lu(r):
	r=abs(r)
	for i in range(abs(r)):
		print("LU")
def ru(r):
	r=abs(r)
	for i in range(abs(r)):
		print("RU")
def ld(r):
	r=abs(r)
	for i in range(abs(r)):
		print("LD")

def rd(r):
	r=abs(r)
	for i in range(abs(r)):
		print("RD")

def dd(r):
	r=abs(r)
	for i in range(abs(r)):
		print("D")

def ll(r):
	r=abs(r)
	for i in range(abs(r)):
		print("L")

def uu(r):
	r=abs(r)
	for i in range(abs(r)):
		print("U")

def rr(r):
	r=abs(r)
	for i in range(abs(r)):
		print("R")

if(abs(r)>abs(c)):
	if r>0 and c>0:
		dd(r-c)
		rd(c)
	if r>0 and c<0:
		dd(r-abs(c))
		ld(c)
	if r<0 and c>0:
		uu(abs(r)-c)
		ru(c)
	if r<0 and c<0:
		uu(abs(r)-abs(c))
		lu(c)

if(abs(r)<abs(c)):
	if r>0 and c>0:
		rr(c-r)
		rd(r)
	if r>0 and c<0:
		ll(c-abs(r))
		ld(r)
	if r<0 and c>0:
		rr(abs(c)-abc(r))
		ru(r)
	if r<0 and c<0:
		ll(abs(c)-abs(r))
		lu(r)

if abs(r)==abs(c):
	if r>0 and c>0:
		rd(r)
	if r>0 and c<0:
		ld(r)
	if r<0 and c>0:
		ru(c)
	if r<0 and c<0:
		lu(c)

#шахматная доска
import math
#входые данные
#точка старта
x=list(input())
x[0]=ord(x[0])-96
x[1]=ord(x[1])
y=list(input())
y[0]=ord(y[0])-96
y[1]=ord(y[1])
#максимум ходов
if x[0]!=y[0]:
    dist= x[0] - y[0]
elif x[0]==y[0]:
    dist= x[1] - y[1]
dist=int(math.fabs(dist))
print('\n')
print(dist)

#направление
#Если они на одной горизонтали/верикали
arr=[]
arr1=[]
while x[0]!=y[0]:
    if x[0]>y[0]:
        arr.append('U')
        x[0]-=1
    elif x[0]<y[0]:
        arr.append('D')
        x[0]+=1

while x[1]!=y[1]:
    if x[1]>y[1]:
        arr1.append('L')
        x[1]-=1
    elif x[1]<y[1]:
        arr1.append('R')
        x[1]+=1

n=len(arr)-len(arr1)
m=len(arr1)-len(arr)
if len(arr)<len(arr1):
    for i in range(len(arr)):
        print(arr1[i]+arr[i])
    for j in range(m):
        print(arr1[j])
else:
    for i in range(len(arr1)):
        print(arr1[i]+arr[i])
    for j in range(n):
        print(arr[j])

s = input()
f = input()
x = ord(s[0])-ord(f[0])
y = ord(s[1])-ord(f[1])
print(max(x,y))
while x != 0 or y != 0:
    st = ""
    if x < 0:
      st += "R"
      x = x + 1
    if x > 0:
        st = st + "L"
        x = x - 1
    if y < 0:
        st = st + "U"
        y = y + 1
    if y > 0:
        st = st + "D"
        y = y - 1
    print(st)

s=str(input())
t=str(input())
if s[0]==t[0]:
    print(abs(int(s[1])-int(t[1])))
    for i in range(abs(int(s[1])-int(t[1]))):
        if int(s[1])-int(t[1])>0:
            print("D")
        else:
            print("U")
elif s[1]==t[1]:
    print(abs(ord(s[0])-ord(t[0])))
    for i in range(abs(ord(s[0])-ord(t[0]))):
        if ord(s[0])-ord(t[0]):
            print("R")
        else:
            print("L")
else:
    print(max(abs((int(s[1])-int(t[1]))),abs(ord(s[0])-ord(t[0]))))
    for i in range(min(abs(ord(s[0])-ord(t[0])),abs(int(s[1])-int(t[1])))):
        if int(s[1])-int(t[1])>0 and ord(s[0])-ord(t[0])<0:
            print("RD")
        elif int(s[1])-int(t[1])<0 and ord(s[0])-ord(t[0])>0:
            print("LU")
        elif int(s[1])-int(t[1])>0 and ord(s[0])-ord(t[0])>0:
            print("LD")
        else:
            print("RU")
    for i in range(max(abs((int(s[1])-int(t[1]))),abs(ord(s[0])-ord(t[0])))-min(abs(ord(s[0])-ord(t[0])),abs(int(s[1])-int(t[1])))):
        if abs(int(s[1])-int(t[1]))>=abs(ord(s[0])-ord(t[0])):
            if int(s[1])>int(t[1]):
                print("D")
            else:
                print("U")
        else:
            if s[0]>t[0]:
                print("L")
            else:
                print("R")

x1, y1 = input()
x2, y2 = input()

y1, y2 = map(int, [y1, y2])
x1, x2 = map(ord, [x1, x2])

x = abs(x1 - x2)
y = abs(y1 - y2)
path = max([x, y])
print(path)

for i in range(path):
	x0 = x1 - x2
	y0 = y1 - y2
	if x0 != 0 and y0 != 0:
		if x0 < 0 and y0 < 0:
			print("RU")
			x1 += 1
			y1 += 1
		elif x0 < 0 and y0 > 0:
			print("RD")
			x1 += 1
			y1 -= 1
		elif x0 > 0 and y0 < 0:
			print("LD")
			y1 += 1
			x1 -= 1
		elif x0 > 0 and y0 > 0:
			print("LU")
			y1 -= 1
			x1 -= 1
	elif x0 == 0 or y0 == 0:
		if x0 > 0:
			print("L")
			x1 -= 1
		elif x0 < 0:
			print("R")
			x1 += 1
		elif y0 > 0:
			print("D")
			y1 -= 1
		elif y0 < 0:
			print("U")
			y1 += 1
	else:
		print("No need for more")

s = str(input())
t = str(input())

def calculateMoves(s,t):
    # Input parsing
    cols = {'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}
    sx = cols[s[0]]
    sy = int(s[1])
    tx = cols[t[0]]
    ty = int(t[1])

    # Calculating moves
    moves = []
    while True:
        xflag = 0
        yflag = 0
        xmove = ''
        ymove = ''
        move = ''
        if sx != tx:
            xflag = 1
            if sx < tx:
                xmove = 'L'
                sx = sx + 1
            else:
                xmove = 'R'
                sx = sx - 1
        if sy != ty:
            yflag = 1
            if sy < ty:
                ymove = 'D'
                sy = sy + 1
            else:
                ymove = 'U'
                sy = sy - 1
        if xflag: move = move + xmove
        if yflag: move = move + ymove
        if (not xflag and not yflag):
            break
        else:
            moves.append(move)

    # Output Parsing
    print(len(moves))
    for i in moves:
        print(i)
    return

calculateMoves(s,t)

#!/usr/bin/env python
from __future__ import division, print_function

import io
import os
import sys
import operator as op

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from cStringIO import StringIO
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from io import BytesIO as StringIO

sys.stdout, stream = io.IOBase(), StringIO()
sys.stdout.flush = lambda: os.write(1, stream.getvalue()) and not stream.truncate(0) and stream.seek(0)
sys.stdout.write = stream.write if sys.version_info[0] < 3 else lambda s: stream.write(s.encode())

input, flush = sys.stdin.readline, sys.stdout.flush
input = StringIO(os.read(0, os.fstat(0).st_size)).readline

def main():
    f = lambda s: (ord(s[0]) - ord('a'), int(s[1]) - 1)

    s = f(input())
    t = f(input())

    x, y = map(op.sub, t, s)

    d = ''
    if (0 < x) and (0 < y):
        d = 'RU'
    elif (0 < x) and (0 > y):
        d = 'RD'
    elif (0 > x) and (0 < y):
        d = 'LU'
    elif (0 > x) and (0 > y):
        d = 'LD'

    t = min(abs(x), abs(y))
    sol = [d] * t

    x += -t if x > 0 else t
    y += -t if y > 0 else t

    d = 'R' if x > 0 else 'L'
    sol.extend([d] * abs(x))

    d = 'U' if x > 0 else 'D'
    sol.extend([d] * abs(y))

    print(len(sol))
    print('\n'.join(sol))

if __name__ == '__main__':
    main()

import time

def calculateCoords(c):
    return (8 - int(c[1]), ord(c[0]) - 97)

def run():
    start = calculateCoords(input())
    end = calculateCoords(input())

    seen = [[False for x in range(8)] for y in range(8)]
    seen[start[0]][start[1]] = True
    toCheck = []
    toCheck.append((start, []))

    while True:
        temp = []
        for (position, l) in toCheck:
            r = position[0]
            c = position[1]
            if r == end[0] and c == end[1]:
                print(len(l))
                for ch in l:
                    print(ch)
                return
            if r > 0:
                if c > 0 and not seen[r - 1][c - 1]:
                    newl1 = [x for x in l]
                    newl1.append("LU")
                    temp.append(((r - 1, c - 1), newl1))
                if c < 7 and not seen[r - 1][c + 1]:
                    newl2 = [x for x in l]
                    newl2.append("RU")
                    temp.append(((r - 1, c + 1), newl2))
                newl3 = [x for x in l]
                newl3.append("U")
                temp.append(((r - 1, c), newl3))
            if r < 7:
                if c > 0 and not seen[r + 1][c - 1]:
                    newl4 = [x for x in l]
                    newl4.append("LD")
                    temp.append(((r + 1, c - 1), newl4))
                if c < 7 and not seen[r + 1][c + 1]:
                    newl5 = [x for x in l]
                    newl5.append("RD")
                    temp.append(((r + 1, c + 1), newl5))
                newl6 = [x for x in l]
                newl6.append("U")
                temp.append(((r + 1, c), newl6))
            if c > 0:
                newl7 = [x for x in l]
                newl7.append("L")
                temp.append(((r, c - 1), newl7))
            if c < 7:
                newl8 = [x for x in l]
                newl8.append("R")
                temp.append(((r, c + 1), newl8))
        toCheck = []
        toCheck.extend(temp)

run()

from collections import deque

directions = {
    'D': (1, 0),
    'U': (1, 0),
    'R': (0, 1),
    'L': (0, -1),
    'RD': (1, 1),
    'RU': (-1, 1),
    'LD': (1, -1),
    'LU': (-1, -1)
}

def code(i, j):
    return i * 8 + j

def decode(x):
    return (x // 8, x % 8)

def code_input():
    coord = input();
    j = ord(coord[0]) - ord('a')
    i = 8 - int(coord[1])
    return code(i, j)

def move(x, d):
    (i, j) = decode(x)
    (di, dj) = directions[d]
    i += di
    j += dj
    if i >= 0 and i < 8 and j >= 0 and j < 8:
        return code(i,j)
    else:
        return -1

s = code_input()
t = code_input();

q = deque([])
q.append(s)
visited = set([s])
last_dir = {}
prev_field = {}
dist = {s: 0}

while len(q) > 0 and t not in visited:
    field = q.popleft()
    for d in directions:
        neighbor = move(field, d)
        if neighbor != -1 and neighbor not in visited:
            visited.add(neighbor)
            q.append(neighbor)
            dist[neighbor] = dist[field] + 1
            last_dir[neighbor] = d
            prev_field[neighbor] = field
print(dist[t])

field = t
path = deque([])
while field in prev_field:
    path.appendleft(last_dir[field])
    field = prev_field[field]
for mv in path:
    print(mv)

s=input()
n=input()
m=['','a','b','c','d','e','f','g','h']
for i in range(1,len(m)):
    if s[0]==m[i]:
        x=i
    if n[0]==m[i]:
        x2=i
y=int(s[1])
y2=int(n[1])
M=[]
b=''
xod=0
while True:
    if x>x2:
        x-=1
        b+='L'

    if x<x2:
        x+=1
        b+='R'
    if y>y2:
        y-=1
        b+='D'
    if y<y2:
        y+=1
        b+='U'
    xod+=1
    M.append(b)
    b=''
    if x==x2 and y==y2:
        break
print(xod)
for i in range(len(M)):
    print(M[i])

origin = input()
target = input()

def char2Num(c):
  return ord(c)-ord('a')+1

def num2Char(d):
  return chr(ord('a')+d-1)

x_origin = char2Num(origin[0])
y_origin = int(origin[1])

x_target = char2Num(target[0])
y_target = int(target[1])

x = x_origin
y = y_origin
steps = []

while x < x_target and y < y_target: # keep RU until x reaches x_target or y reaches y_target
  steps.append('RU')
  x += 1
  y += 1
while x<x_target and y > y_target:
  steps.append('RD')
  x += 1
  y -= 1
while x > x_target and y < y_target: # keep RU until x reaches x_target or y reaches y_target
  steps.append('LU')
  x += 1
  y += 1
while x>x_target and y > y_target:
  steps.append('LD')
  x += 1
  y -= 1
while x < x_target:
  steps.append('R')
  x += 1
while x < x_target:
  steps.append('L')
  x -= 1
while y < y_target:
  steps.append('U')
  y += 1
while y > y_target:
  steps.append('D')
  y -= 1
print(len(steps))
for step in steps:
  print(step)

x,y=map(lambda x:ord(x[1])-ord(x[0]), zip(raw_input(),raw_input()))
a,b=abs(x),abs(y)
m,d=max(a,b),abs(a-b)
print m
print '\n'.join(map(lambda x:x[0]+x[1], zip('LR'[x>=0]*a+''*d,'DU'[y>=0]*b+''*d)))

a = input()
b = input()
satr = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}
sotoon = [8]
n = 0
if (a[0] == b[0]):
    n = int(b[1]) - int(a[1])
    if (n < 0):
        n = n * -1
        print(n)
        for _ in range(n):
            print("D")
    else:
        print(n)
        for _ in range(n):
            print("U")
elif (a[1] == b[1]):
    n = satr[b[0]] - satr[a[0]]
    if (n < 0):
        n = n * -1
        print(n)
        for _ in range(n):
            print("L")
    else:
        print(n)
        for _ in range(n):
            print("R")

else:
    i = satr[b[0]] - satr[a[0]]
    j = int(b[1]) - int(a[1])
    if (abs(i) > abs(j)):
        print(abs(i))
    else:
        print(abs(j))
    if (i > 0):
        if (j > 0):
            for _ in range(i):
                print("RU")
            for _ in range(abs(j - i)):
                print("U")
        else:
            for _ in range(abs(j)):
                print("RD")
            for _ in range(abs(i + j)):
                print("R")
    else:
        if (j > 0):
            for _ in range(j):
                print("LU")
            for _ in range(abs(i + j)):
                print("L")
        else:
            for _ in range(abs(j)):
                print("LD")
            for _ in range(abs(i - j)):
                print("D")

#! /usr/bin/env python

s = raw_input();
t = raw_input();

#dir_x = ['U', 'D'];
#dir_y = ['L', 'R'];

column = ord(s[0]) - ord(t[0]);
row = int(s[1]) - int(t[1]);

#print row, column;
next_x = next_y = 'hehe';
if column < 0 :
	next_y = 'R';
elif column > 0:
	next_y = 'L';
if row < 0 :
	next_x = 'U';
elif row > 0:
	next_x = 'D';

row = abs(row);
column = abs(column);
ans = list();

while row > 0 or column > 0:
	if column > 0 and row > 0:
		print ("%c%c" % (next_y, next_x));
		column -= 1;
		row -= 1;
	elif row > 0:
		print next_x;
		row -= 1;
	elif column > 0:
		print next_y;
		column -= 1;

p1 = raw_input()
p2 = raw_input()

start = [ord(p1[0]), ord(p1[1])]
end = [ord(p2[0]), ord(p2[1])]

s_edge = min(abs(start[0]-end[0]), abs(start[1]-end[1]))
l_edge = max(abs(start[0]-end[0]), abs(start[1]-end[1]))

diff = l_edge - s_edge

if abs(start[0]-end[0]) < abs(start[1]-end[1]):
    h = 0
else :
    h = 1

if start[0] <= end[0] and start[1] <= end[1]:
    for i in range(s_edge):
        print 'RU'
    if h == 1:
        for i in range(diff):
            print 'R'
    else:
        for i in range (diff):
            print 'U'
elif start[0] <= end[0] and start[1] >= end[1]:
    for i in range(s_edge):
        print 'RD'
    if h == 1:
        for i in range(diff):
            print 'R'
    else:
        for i in range(diff):
            print 'D'
elif start[1] >= end[1] and start[0] >= end[0]:
    for i in range(s_edge):
        print 'LD'
    if h == 1:
        for i in range(diff):
            print 'L'
    else :
        for i in range(diff):
            print 'D'
else:
    for i in range(s_edge):
        print 'LU'
    if h == 1:
        for i in range(diff):
            print 'L'
    else :
        for i in range(diff):
            print 'U'

p1, p2 = input(), input()
x1, y1 = ord(p1[0]) - ord('a') + 1, int(p1[1])
x2, y2 = ord(p2[0]) - ord('a') + 1, int(p2[1])
x = x2-x1
y = y2-y1
d1, d2 = 'L', 'D'
if x > 0:
    d1 = 'R'
if y > 0:
    d2 = 'U'
if x > y:
    print(x)
else:
    print(y)
# import pdb
# pdb.set_trace()
if x < 0:
    x = -x
if y < 0:
    y = -y
while x or y:
    if x:
        x -= 1
        print(d1, end='')
    if y:
        y -= 1
        print(d2, end='')
    print()

st = input()
end = input()

for i in st:
    if i.isalpha():
        col1 = ord(i) - 97
    else:
        row1 = 8 - int(i)
for i in end:
    if i.isalpha():
        col2 = ord(i) - 97
    else:
        row2 = 8 - int(i)

if(col1>col2 and row1>row2):
    cond1=1
elif(col1<col2 and row1>row2 ):
    cond2=1
elif(col1>col2 and row1<row2):
    cond3=1
else:
    cond1=4

diff1 = abs(col2-col1)
diff2 = abs(row2-row1)

min = min(diff1,diff2)
max = max(diff1,diff2)

print(max)
for i in range(min):
    if cond1:
        print('RD')
    elif cond2:
        print('LD')
    elif cond3:
        print('RU')
    else:
        print('LU')

diff = diff1-diff2

if diff>0:
    for i in range(diff):
        if cond1 or cond3:
            print('R')
        else:
            print('L')
else:
    for i in range(abs(diff)):
        if cond1 or cond3:
            print('D')
        else:
            print('U')

"""

A. Shortest path of the king

time limit per test
1 second

memory limit per test
64 megabytes

input
standard input

output
standard output

The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting his time, he wants to get from his current position s to square t in the least number of moves. Help him to do this.

In one move the king can get to the square that has a common side or a common vertex with the square the king is currently in (generally there are 8 different squares he can move to).

Input

The first line contains the chessboard coordinates of square s, the second line — of square t.

Chessboard coordinates consist of two characters, the first one is a lowercase Latin letter (from a to h), the second one is a digit from 1 to 8.

Output

In the first line print n — minimum number of the king's moves. Then in n lines print the moves themselves. Each move is described with one of the 8: L, R, U, D, LU, LD, RU or RD.

L, R, U, D stand respectively for moves left, right, up and down (according to the picture), and 2-letter combinations stand for diagonal moves. If the answer is not unique, print any of them.

Examples

Input

a8
h1

Output

7
RD
RD
RD
RD
RD
RD
RD

A. Shortest path of the king
time limit per test1 second
memory limit per test64 megabytes
inputstandard input
outputstandard output
The king is left alone on the chessboard. In spite of this loneliness, h
e doesn't lose heart, because he has business of national importance. Fo
r example, he has to pay an official visit to square t. As the king is n
ot in habit of wasting his time, he wants to get from his current positi
on s to square t in the least number of moves. Help him to do this.

In one move the king can get to the square that has a common side or a c
ommon vertex with the square the king is currently in (generally there a
re 8 different squares he can move to).

Input
The first line contains the chessboard coordinates of square s, the seco
nd line — of square t.

Chessboard coordinates consist of two characters, the first one is a low
ercase Latin letter (from a to h), the second one is a digit from 1 to 8
.

Output
In the first line print n — minimum number of the king's moves. Then in
n lines print the moves themselves. Each move is described with one of t
he 8: L, R, U, D, LU, LD, RU or RD.

L, R, U, D stand respectively for moves left, right, up and down (accord
ing to the picture), and 2-letter combinations stand for diagonal moves.
 If the answer is not unique, print any of them.

Examples
input
a8
h1
output
7
RD
RD
RD
RD
RD
RD
RD
"""

from sys import stdin, stdout

a1 = zip(raw_input(), raw_input())
b1, b2 = map(lambda i1: abs(ord(i1[1]) - ord(i1[0])), a1)
c1, c2 = 'LR'[b1>=0], 'DU'[b2>=0]
d1, d2 = max(b1,b2), min(b1,b2)

print d1, '\n', \
      (c1 + c2 + '\n') * d2 + \
      (c1 + '\n') * (b1 - d2) + \
      (c2 + '\n') * (b2 - d2)

a = input()
b = input()
satr = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}
sotoon = [8]
n = 0
if (a[0] == b[0]):
    n = int(b[1]) - int(a[1])
    if (n < 0):
        n = n * -1
        print(n)
        for _ in range(n):
            print("D")
    else:
        print(n)
        for _ in range(n):
            print("U")
elif (a[1] == b[1]):
    n = satr[b[0]] - satr[a[0]]
    if (n < 0):
        n = n * -1
        print(n)
        for _ in range(n):
            print("L")
    else:
        print(n)
        for _ in range(n):
            print("R")

else:
    i = satr[b[0]] - satr[a[0]]
    j = int(b[1]) - int(a[1])
    if (abs(i) > abs(j)):
        print(abs(i))
    else:
        print(abs(j))
    if (i > 0):
        if (j > 0):
            if(abs(j)>=abs(i)):
                for _ in range(i):
                    print("RU")
                for _ in range(abs(j - i)):
                    print("U")
            else :
                for _ in range(j):
                    print("RU")
                for _ in range(abs(i-j)):
                    print("R")
        else:
            if(abs(i)>=abs(j)):
                for _ in range(abs(j)):
                    print("RD")
                for _ in range(abs(i + j)):
                    print("R")
            else :
                for _ in range(abs(i)):
                    print("RD")
                for _ in range(abs(i + j)):
                    print("D")
    else:
        if (j > 0):
            if(abs(i)>=abs(j)):
                for _ in range(j):
                    print("LU")
                for _ in range(abs(i + j)+1):
                    print("L")
            else :
                for _ in range(abs(i)):
                    print("LU")
                for _ in range(abs(i + j)):
                    print("U")
        else:
            if(abs(i)>=abs(j)):
                for _ in range(abs(j)):
                    print("LD")
                for _ in range(abs(i - j)):
                    print("L")
            else :
                for _ in range(abs(i)):
                    print("LD")
                for _ in range(abs(i - j)):
                    print("D")

row = {'a':0 ,'b':1 ,'c':2 ,'d':3 ,'e':4 ,'f':5 ,'g':6 ,'h':7}
column = list(i for i in range(8))

init = str(input())

init_x = row[init[0]]
init_y = int(init[1]) - 1

end = str(input())

end_x = row[end[0]]
end_y = int(end[1])

moves = list()

while (True):
    flag_x = 0
    flag_y = 0
    res = ""
    if (init_x < end_x):
        init_x = init_x + 1
        res = res + "R"
    if (init_x > end_x):
        init_x = init_x - 1
        res = res + "L"
    if (init_x == end_x):
        flag_x = 1
    if (init_y < end_y):
        init_y = init_y + 1
        res = res + "U"
    if (init_y > end_y):
        init_y = init_y - 1
        res = res + "D"
    if (init_y == end_y):
        flag_y = 1
    moves.append(res)
    if( flag_x == 1 & flag_y == 1):
        break

print(len(moves))
for i in moves:
    print(i)

s = str(input())
t = str(input())

def calculateMoves(s,t):
    # Input parsing
    cols = {'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}
    sx = cols[s[0]]
    sy = int(s[1])
    tx = cols[t[0]]
    ty = int(t[1])

    # Calculating moves
    moves = []
    while True:
        xflag = 0
        yflag = 0
        xmove = ''
        ymove = ''
        move = ''
        if sx != tx:
            xflag = 1
            if sx < tx:
                xmove = 'D'
                sx = sx + 1
            else:
                xmove = 'U'
                sx = sx - 1
        if sy != ty:
            yflag = 1
            if sy < ty:
                ymove = 'L'
                sy = sy + 1
            else:
                ymove = 'R'
                sy = sy - 1
        if yflag: move = move + ymove
        if xflag: move = move + xmove
        if (not xflag and not yflag):
            break
        else:
            moves.append(move)

    # Output Parsing
    print(len(moves))
    for i in moves:
        print(i)
    return

calculateMoves(s,t)

starting = list(input().lower())
end_up = list(input())
print(starting)
string_output = []
count = 0
letter_dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}

starting[1] = int(starting[1])
end_up[1] = int(end_up[1])
starting[0] = letter_dict[starting[0]]
end_up[0] = letter_dict[end_up[0]]

while starting[0] != end_up[0] or starting[1] != end_up[1]:
    if starting[0] > end_up[0]:
        starting[0] -= 1
        if starting[1] > end_up[1]:
            starting[1] -= 1
            string_output.append('LD')
        else:
            starting[1] += 1
            string_output.append('LU')
    else:
        starting[0] += 1
        if starting[1] > end_up[1]:
            starting[1] -= 1
            string_output.append('RD')
        else:
            starting[1] += 1
            string_output.append('RU')
    count += 1

while starting[0] != end_up[0] or starting[1] != end_up[1]:
    if starting[1] == end_up[1]:
        if starting[0] > end_up[0]:
            starting[0] -= 1
            string_output.append('L')

        else:
            starting[0] += 1
            string_output.append('R')

    else:
        if starting[1] > end_up[1]:
            starting[1] -= 1
            string_output.append('D')
        else:
            starting[1] += 1
            string_output.append('U')

    count += 1

print(count)
for i in string_output:
    print(i)

dict={'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}

c=list(input())
d=list(input())
c[0]=dict[c[0]]
d[0]=dict[d[0]]
c[1]=int(c[1])
d[1]=int(d[1])
hor=[]
if c[0]>=d[0]:
    hor.extend(list("L"*(c[0]-d[0])))
else:
    hor.extend(list("R"*abs(c[0]-d[0])))

ver=[]
if c[1]>=d[1]:
    ver.extend(list("D"*(c[1]-d[1])))
else:
    ver.extend(list("U"*abs(c[1]-d[1])))

#print(hor,ver)
for i in range(min(len(ver),len(hor))):
    print(hor[i],end='')
    print(ver[i])
if len(ver)>=len(hor):
    print('\n'.join(ver[(len(ver)-len(hor)-1):]))
else:
    print('\n'.join(hor[abs(len(ver)-len(hor)-1):]))

s = str(input())
t = str(input())

def calculateMoves(s,t):
    # Input parsing
    cols = {'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}
    sx = cols[s[0]]
    sy = int(s[1])
    tx = cols[t[0]]
    ty = int(t[1])

    # Calculating moves
    moves = []
    while True:
        xflag = 0
        yflag = 0
        xmove = ''
        ymove = ''
        move = ''
        if sx != tx:
            xflag = 1
            if sx < tx:
                xmove = 'R'
                sx = sx + 1
            else:
                xmove = 'L'
                sx = sx - 1
        if sy != ty:
            yflag = 1
            if sy < ty:
                ymove = 'U'
                sy = sy + 1
            else:
                ymove = 'D'
                sy = sy - 1
        if yflag: move = move + ymove
        if xflag: move = move + xmove
        if (not xflag and not yflag):
            break
        else:
            moves.append(move)

    # Output Parsing
    print(len(moves))
    for i in moves:
        print(i)
    return

calculateMoves(s,t)

def dig(s):return [ord(s[0])-96,int(s[1])]
a,b=dig(input())
c,d=dig(input())
l=max(abs(a-c),abs(b-d))
print(l)
e=['']*l
for i in range(abs(b-d)):
    if b>d:e[i]='L'
    else:e[i]='R'
for i in range(abs(a-c)):
    if a>c:e[i]=e[i]+'D'
    else:e[i]=e[i]+'U'
print('\n'.join(e))

bla="abcdefgh"
b1=raw_input()
b2=raw_input()
x1=bla.index(b1[0])
x2=bla.index(b2[0])
y1=int(b1[1])
y2=int(b2[1])

spacesup=y2-y1
spacesright=x2-x1

while spacesup!=0 and spacesright!=0:
    if spacesup>0 and spacesright>0:
        print "RU"
        spacesup-=1
        spacesright-=1
    if spacesup<0 and spacesright>0:
        print "RD"
        spacesup+=1
        spacesright-=1
    if spacesup>0 and spacesright<0:
        print "LU"
        spacesup-=1
        spacesright+=1
    if spacesup<0 and spacesright<0:
        print "LD"
        spacesup+=1
        spacesright+=1

if spacesup!=0:
    if spacesup>0:
        for i in range(spacesup):
            print "D"
    else:
        for i in range(-spacesup):
            print "U"
if spacesright!=0:
    if spacesright>0:
        for i in range(spacesright):
            print "L"
    else:
        for i in range(-spacesright):
            print "R"

s = raw_input()
t = raw_input()
start = [ord(s[0])-96 ,int(s[1])]
terminal = [ord(t[0])-96 ,int(t[1])]
print start
print terminal
route = []
while start != terminal:
    if terminal[0]>start[0] and terminal[1]>start[1]:
        route.append('RU')
        start[0]+= 1
        start[1]+= 1
    elif terminal[0]>start[0] and terminal[1]<start[1]:
        route.append('RD')
        start[0]+= 1
        start[1]-= 1
    elif terminal[0]<start[0] and terminal[1]>start[1]:
        route.append('LU')
        start[0]-= 1
        start[1]+= 1
    elif terminal[0]<start[0] and terminal[1]<start[1]:
        route.append('LD')
        start[0]-= 1
        start[1]-= 1
    elif terminal[0]>start[0]:
        route.append('R')
        start[0]+= 1
    elif terminal[0]<start[0]:
        route.append('L')
        start[0]-= 1
    elif terminal[1]>start[1]:
        route.append('U')
        start[1]+= 1
    elif terminal[1]<start[1]:
        route.append('D')
        start[1]-= 1
    print start
    print terminal
print len(route)
for item in route:
    print item

dict={'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}

c=list(input())
d=list(input())
c[0]=dict[c[0]]
d[0]=dict[d[0]]
c[1]=int(c[1])
d[1]=int(d[1])
hor=[]
if c[0]>=d[0]:
    hor.extend(list("L"*(c[0]-d[0])))
else:
    hor.extend(list("R"*abs(c[0]-d[0])))

ver=[]
if c[1]>=d[1]:
    ver.extend(list("D"*(c[1]-d[1])))
else:
    ver.extend(list("U"*abs(c[1]-d[1])))

#print(hor,ver)
for i in range(min(len(ver),len(hor))):
    print(hor[i],end='')
    print(ver[i])
if len(ver)>len(hor):
    print('\n'.join(ver[(len(ver)-len(hor)-1):]))
elif len(ver)<len(hor):
    print('\n'.join(hor[abs(len(ver)-len(hor)-1):]))

from  __future__ import print_function
def main():
    s = raw_input()
    d = raw_input()

    left_2_right = ord(d[0]) - ord(s[0])
    top_2_bottom = int(s[1]) - int(d[1])

    if left_2_right > 0:
        step = 'R'
    elif left_2_right < 0:
        step = 'L'
    else:
        step = ''

    if top_2_bottom > 0:
        step_next = 'D'
    elif top_2_bottom < 0:
        step_next = 'U'
    else:
        step = ''

    max_iter = max( left_2_right, top_2_bottom )
    print(max_iter)
    for itr in xrange(1, max_iter + 1):
        if itr <= left_2_right:
            print(step,end='')
        if itr <= top_2_bottom:
            print(step_next)

if __name__ == '__main__':
    main()

__author__ = 'Ragnar'
import string
first_position = str(input())
second_position = str(input())
letter_list = list(string.ascii_lowercase[0:8])
number_list = list(range(1, 9))
d = dict(zip(letter_list, number_list))
t1 = d[first_position[0]]
t2 = d[second_position[0]]
position_list = [(t1, int(first_position[1])), (t2, int(second_position[1]))]
tt_1 = position_list[0][1]
h_1_1 = abs(position_list[0][0]-position_list[1][0])
h_1_2 = abs(position_list[0][1]-position_list[1][1])
h_1 = min(h_1_1, h_1_2)
h_2 = max(h_1_1, h_1_2) - min(h_1_1, h_1_2)
h = h_1 + h_2
print (h)

delta = 0
for i in range(h_1):
    if (t1 < t2) and (int(first_position[1]) < int(second_position[1])):
        print ('RU')
        delta += 1
    if (t1 < t2) and (int(first_position[1]) > int(second_position[1])):
        print ('RD')
        delta += 1
    if (t1 > t2) and (int(first_position[1]) < int(second_position[1])):
        print ('LU')
        delta -= 1
    if (t1 > t2) and (int(first_position[1]) > int(second_position[1])):
        print ('LD')
        delta -= 1

if h_1_1 < h_1_2:
    t1 = t1 + delta
if h_1_2 < h_1_1:
    tt_1 = tt_1 + delta

for j in range(h_2):
    if t1 == t2 and int(first_position[1]) < int(second_position[1]):
        print ('U')
    if t1 == t2 and int(first_position[1]) > int(second_position[1]):
        print ('D')
    if tt_1 == int(second_position[1]) and d[first_position[0]] < d[second_position[0]]:
        print ('R')
    if tt_1 == int(second_position[1]) and d[first_position[0]] > d[second_position[0]]:
        print ('L')

def main():
	s = input()
	t = input()
	solver(s, t)

def solver(s, t):
	ls = ord(s[0])
	lt = ord(t[0])
	ns = int(s[1])
	nt = int(t[1])
	n = max(abs(lt - ls), abs(nt - ns))
	#print(ls, lt, ns, nt)
	while ls != lt or ns != nt:
		out = ""
		if ls < lt:
			out += "R"
			ls += 1
		elif ls > lt:
			out += "L"
			ls -= 1
		if ns < nt:
			out += "U"
			ns += 1
		elif ns > nt:
			out += "D"
			ns -= 1
		print(out)

def shortestPath():
       kingPosition = input()
       destination = input()
       boardSize = 8
       chessBoard = [[-1 for x in range(boardSize)] for y in range(boardSize)]
       kingRow = int(kingPosition[1])-1
       kingColumn = ord(kingPosition[0])-ord('a')
       chessBoard[kingRow][kingColumn] = 0
       chessBoard[int(destination[1])-1][ord(destination[0])-ord('a')] = -2
       newNeighbors = []
       fillChessBoard(kingRow,kingColumn,chessBoard,newNeighbors)
       while len(newNeighbors) > 0:
              fillChessBoard(newNeighbors[0][0], newNeighbors[0][1],chessBoard,newNeighbors)
              newNeighbors.remove(newNeighbors[0])

       path=[[int(destination[1])-1,ord(destination[0])-ord('a')] ]
       path.append(findSmallestNeighbor([int(destination[1])-1,ord(destination[0])-ord('a')],chessBoard))
       while chessBoard[path[len(path)-1][0]][path[len(path)-1][1]] != 0:
              path.append(findSmallestNeighbor(path[len(path)-1],chessBoard))
       allNeighbors = [[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1],[0,1]]
       i = len(path)-1

       print(len(path)-1)
       while i >= 0:
              for neighbor in allNeighbors:
                     if path[i][0] + neighbor[0] == path[i-1][0] and path[i][1] + neighbor[1] == path[i-1][1]:
                            if neighbor == [1,1]:
                                   print('RU')
                            elif neighbor == [1,0]:
                                   print('U')
                            elif neighbor == [1,-1]:
                                   print('LU')
                            elif neighbor == [0,-1]:
                                   print('L')
                            elif neighbor == [-1,-1]:
                                   print('LD')
                            elif neighbor == [-1,0]:
                                   print('D')
                            elif neighbor == [-1,1]:
                                   print('RD')
                            elif neighbor == [0,1]:
                                   print('R')

              i -= 1

def fillChessBoard(startRow, startColumn, chessBoard, newNeighbors):
       allNeighbors = [[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1],[0,1]]
       for neighbor in allNeighbors:

              if startRow + neighbor[0] < len(chessBoard) and startColumn + neighbor[1] < len(chessBoard) and startRow + neighbor[0] >= 0 and startColumn + neighbor[1] >= 0 and chessBoard[startRow + neighbor[0]][startColumn + neighbor[1]] == -1:
                     chessBoard[startRow + neighbor[0]][startColumn + neighbor[1]] = chessBoard[startRow][startColumn] + 1
                     newNeighbors.append([startRow + neighbor[0],startColumn + neighbor[1]])

def findSmallestNeighbor(current,chessBoard):
       allNeighbors = [[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1],[0,1]]
       minValue = 8

       for neighbor in allNeighbors:
              if current[0] + neighbor[0] < len(chessBoard) and current[1] + neighbor[1] < len(chessBoard) and current[0] + neighbor[0] >= 0 and current[1] + neighbor[1] >= 0 and chessBoard[current[0]+neighbor[0]][current[1]+neighbor[1]] < minValue and chessBoard[current[0]+neighbor[0]][current[1]+neighbor[1]] != -2:
                     minValue =  chessBoard[current[0]+neighbor[0]][current[1]+neighbor[1]]
                     minNeighbor = [current[0]+neighbor[0],current[1]+neighbor[1]]
       return minNeighbor

shortestPath()

import string

start_location = raw_input()
end_location = raw_input()

letterdict=dict()
lowercase=string.ascii_lowercase

for i in xrange(8):
    letterdict[lowercase[i]]=i

start_lr = letterdict[start_location[0]]
start_ud = int(start_location[1])
end_lr = letterdict[end_location[0]]
end_ud = int(end_location[1])

vx = end_lr-start_lr
vy = end_ud-start_ud
numberofsteps = max(abs(vx),abs(vy))
diagonaldistance = min(abs(vx),abs(vy))
boringdistance = numberofsteps-diagonaldistance
print numberofsteps

if vx >= 0 and vy >=0:
    quadrant = "RU"
elif vx <=0 and vy >=0:
    quadrant = "LU"
elif vx <=0 and vy <=0:
    quadrant = "LD"
else:
    quadrant = "RD"
for i in xrange(diagonaldistance):
    print quadrant
if vy>=vx:
    for i in xrange(boringdistance):
        print quadrant[1]
else:
    for i in xrange(boringdistance):
        print quadrant[0]

raw = (raw_input(),
       raw_input())
((x1,y1),(x2,y2)) = ((int(ord(raw[0][0])-ord('a'))+1,int(raw[0][1])),
                     (int(ord(raw[1][0])-ord('a'))+1,int(raw[1][1])))
map = [[max(abs(i-x1),abs(j-y1)) for i in range(10)] for j in range(10)]
print map[y2][x2]
path = []
while map[y2][x2]:
    if map[y2][x2-1] < map[y2][x2]:
        x2 -= 1
        path.append('R')
    elif map[y2][x2+1] < map[y2][x2]:
        x2 += 1
        path.append('L')
    if map[y2-1][x2] < map[y2][x2]:
        y2 -= 1
        path.append('U')
    elif map[y2+1][x2] < map[y2][x2]:
        y2 += 1
        path.append('D')
    if map[y2-1][x2-1] < map[y2][x2]:
        x2 -= 1
        y2 -= 1
        path.append('RU')
    elif map[y2+1][x2+1] < map[y2][x2]:
        x2 += 1
        y2 += 1
        path.append('LU')
    if map[y2-1][x2+1] < map[y2][x2]:
        x2 += 1
        y2 -= 1
        path.append('LD')
    else:
        x2 -= 1
        y2 += 1
        path.append('RD')
path.reverse()
for i in path:
    print i

letter = {'a':0, 'b':1, 'c':2, 'd':3, 'e':4, 'f':5, 'g':6, 'h':7}
number = {'1':0, '2':1, '3':2, '4':3, '5':4, '6':5, '7':6, '8':7}
play = {'L':(0, -1), 'R':(0, 1), 'U':(1, 0), 'D':(0, -1), 'LU':(1, -1), 'LD':(-1, -1), 'RU':(1, 1), 'RD':(-1, 1)}
prnt = {(0, -1):'L', (0, 1):'R', (1, 0):'U', (0, -1):'D', (1, -1):'LU', (-1, -1):'LD', (1, 1):'RU', (-1, 1):'RD'}

s = raw_input()
posini = letter[s[0]], number[s[1]]
s = raw_input()
posfim = letter[s[0]], number[s[1]]

to_run = posini[0] - posfim[0], posini[1] - posfim[1]

if to_run[0] > 0 and to_run[1] > 0:
    if to_run[0] > to_run[1]:
        for i in range(to_run[1]):
            print prnt[1, 1]
        to_run = to_run[0] - to_run[1], 0
    else:
        for i in range(to_run[0]):
            print prnt[1, 1]
        to_run = 0, to_run[1] - to_run[0]
elif to_run[0] > 0 and to_run[1] < 0:
    if to_run[0] > -to_run[1]:
        for i in range(-to_run[1]):
            print prnt[1, -1]
        to_run = to_run[0] + to_run[1], 0
    else:
        for i in range(to_run[0]):
            print prnt[1, -1]
        to_run = 0, to_run[0] + to_run[1]
elif to_run[0] < 0 and to_run[1] > 0:
    if -to_run[0] > to_run[1]:
        for i in range(to_run[1]):
            print prnt[-1, 1]
        to_run = to_run[0] + to_run[1], 0
    else:
        for i in range(-to_run[0]):
            print prnt[-1, 1]
        to_run = 0, to_run[0] + to_run[1]
elif to_run[0] < 0 and to_run[1] < 0:
    if -to_run[0] > -to_run[1]:
        for i in range(-to_run[1]):
            print prnt[-1, -1]
        to_run = to_run[0] - to_run[1], 0
    else:
        for i in range(-to_run[0]):
            print prnt[-1, -1]
        to_run = 0, to_run[0] - to_run[1]

if to_run[0] == 0 and to_run[1] > 0:
    for i in range(to_run[1]):
        print prnt[0, 1]
elif to_run[0] == 0 and to_run[1] < 0:
    for i in range(-to_run[1]):
        print prnt[0, -1]
elif to_run[0] > 0 and to_run[1] == 0:
    for i in range(to_run[0]):
        print prnt[1, 0]
elif to_run[0] < 0 and to_run[1] == 0:
    for i in range(-to_run[0]):
        print prnt[-1, 0]

from collections import deque

directions = {
    'D': (1, 0),
    'U': (1, 0),
    'R': (0, 1),
    'L': (0, -1),
    'RD': (1, 1),
    'RU': (-1, 1),
    'LD': (1, -1),
    'LU': (-1, -1)
}

def code(i, j):
    return i * 8 + j

def decode(x):
    return (x // 8, x % 8)

def code_input():
    coord = input();
    i = ord(coord[0]) - ord('a')
    j = 8 - int(coord[1])
    return code(i, j)

def move(x, d):
    (i, j) = decode(x)
    (di, dj) = directions[d]
    i += di
    j += dj
    if i >= 0 and i < 8 and j >= 0 and j < 8:
        return code(i,j)
    else:
        return -1

s = code_input()
t = code_input();

q = deque([])
q.append(s)
visited = set([s])
last_dir = {}
prev_field = {}
dist = {s: 0}

while len(q) > 0 and t not in visited:
    field = q.popleft()
    for d in directions:
        neighbor = move(field, d)
        if neighbor != -1 and neighbor not in visited:
            visited.add(neighbor)
            q.append(neighbor)
            dist[neighbor] = dist[field] + 1
            last_dir[neighbor] = d
            prev_field[neighbor] = field
print(dist[t])

field = t
path = deque([])
while field in prev_field:
    path.appendleft(last_dir[field])
    field = prev_field[field]
for mv in path:
    print(mv)

#!/usr/bin/python
s1= raw_input()
s2 =raw_input()

#if ord(s2[0])-ord(s1[0])<0 :
#    print 'ss',ord(s2[0])-ord(s1[0])
if ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1])<0 :
    ss = 'LD'
elif  ord(s2[0])-ord(s1[0])>0 and ord(s2[1])-ord(s1[1]) <0 :
    ss='RD'
elif  ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1]) >0 :
    ss='LU'
else:
    ss='RU'

if ord(s2[0])-ord(s1[0])<0:
    ss1 = 'U'
else :
    ss1 = 'D'

if ord(s2[1])-ord(s1[1])<0:
    ss2 = 'R'
else :
    ss2 = 'L'

big = abs(ord(s2[0])-ord(s1[0]))
small = abs(ord(s2[1])-ord(s1[1]))

if big < small :
    temp =big;
    big=small;
    small=temp;
    ss1=ss2;

print big

for i in range (0,small):
    print ss

for i in range (0,big-small):
    print ss1

a = list(input())
b = list(input())
x1 = a[0]
y1 = a[1]
x2 = b[0]
y2 = b[1]
(x1, y1, x2, y2) = map(ord, (x1, y1, x2, y2))

d = max(abs(x1 - x2), abs(y1 - y2))
e = min(abs(x1 - x2), abs(y1 - y2))
print(d)

mx = ''
my = ''
if x1 < x2:
    mx = 'R'
else:
    mx = 'L'
if y1 < y2:
    my = 'U'
else:
    my = 'D'
for i in range(0, e):
    print(mx + my)
p = mx
if abs(x1 - y1) < abs(x2 - y2):
    p = my
for i in range(0, d - e):
    print(p)

line=['a','b','c','d','e','f','g','h']
a=str(input())
b=str(input())
x=line.index(list(a)[0])-line.index(list(b)[0])
y=int(a[1])-int(b[1])
i=0
j=0
k=0
if abs(x)<abs(y):
    k=1
print(max(abs(x),abs(y)))
while i<min(abs(x),abs(y)):
    if x>0 and y>0:
        print('LD')
    if x<0 and y>0:
        print('RD')
    if x>0 and y<0:
        print('LU')
    if x<0 and y<0:
        print('RU')
    i=i+1
while j<abs(abs(x)-abs(y)):
    if k==1 and y<0:
        print('U')
    if k==1 and y>0:
        print('D')
    if k==0 and x<0:
        print('R')
    if k==1 and x>0:
        print('L')
    j=j+1

s = input()
t = input()

moves = []

def move(x, y):
	if (x1 < x):
		if (y1 < y):
			moves.append('LU')
			x -= 1
			y -= 1
			return x, y, 2
		elif (y1 == y):
			x -= 1
			moves.append('L')
			return x, y, 1
		elif (y1 > y):
			x -= 1
			y += 1
			moves.append('LD')
			return x, y, 2
	elif (x1 == x):
		if (y1 < y):
			y -= 1
			moves.append('U')
			return x, y, 1
		elif (y1 == y):
			return x, y, 0
		elif (y1 > y):
			y += 1
			moves.append('D')
			return x, y, 1
	elif (x1 > x):
		if (y1 < y):
			x += 1
			y -= 1
			moves.append('RU')
			return x, y, 2
		elif (y1 == y):
			x += 1
			moves.append('R')
			return x, y, 1
		elif (y1 > y):
			x += 1
			y += 1
			moves.append('RD')
			return x, y, 2

row_names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']

x0 = int(row_names.index(s[0]))
y0 = 8 - int(s[1])

x1 = int(row_names.index(t[0]))
y1 = 8 - int(t[1])

price = x1 - x0 + y1 - y0
n = 0
x = x0
y = y0
while (price > 0):
	x, y, p = move(x, y);
	price -= p
	n += 1

print (n)
list(map(print, moves))

from collections import defaultdict

s = raw_input()
d = raw_input()
char_map = {'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}

x1, y1 = int(char_map[s[0]]), int(s[1])
x2, y2 = int(char_map[d[0]]), int(d[1])

count = 0
directions = list()

def distance(x1,y1,x2,y2):
    dist = (x1-x2)**2 + (y1-y2)**2
    return dist

def left(x1,y1,x2,y2):
    Lx,Ly = x1-1,y1
    L_dist = distance(Lx,Ly,x2,y2)
    return Lx,Ly,L_dist

def leftUp(x1,y1,x2,y2):
    LUx,LUy = x1-1,y1+1
    LU_dist = distance(LUx,LUy,x2,y2)
    return LUx,LUy,LU_dist

def up(x1,y1,x2,y2):
    Ux,Uy = x1,y1+1
    U_dist = distance(Ux,Uy,x2,y2)
    return Ux,Uy,U_dist

def rightUp(x1,y1,x2,y2):
    RUx,RUy = x1+1,y1+1
    RU_dist = distance(RUx,RUy,x2,y2)
    return RUx,RUy,RU_dist

def right(x1,y1,x2,y2):
    Rx,Ry = x1+1,y1
    R_dist = distance(Rx,Ry,x2,y2)
    return Rx,Ry,R_dist

def rightDown(x1,y1,x2,y2):
    RDx,RDy = x1+1,y1-1
    RD_dist = distance(RDx,RDy,x2,y2)
    return RDx,RDy,RD_dist

def down(x1,y1,x2,y2):
    Dx,Dy = x1,y1-1
    D_dist = distance(Dx,Dy,x2,y2)
    return Dx,Dy,D_dist

def leftDown(x1,y1,x2,y2):
    LDx,LDy = x1-1,y1-1
    LD_dist = distance(LDx,LDy,x2,y2)
    return LDx,LDy,LD_dist

while True:
    if (x1 == 1 and (y1 > 1 and y1 < 8)):#left edge
        d = defaultdict()
        Ux,Uy,U_dist = up(x1,y1,x2,y2)
        d["U_dist"] = U_dist

        Rx,Ry,R_dist = right(x1,y1,x2,y2)
        d["R_dist"] = R_dist

        Dx,Dy,D_dist = down(x1,y1,x2,y2)
        d["D_dist"] = D_dist

        RUx,RUy,RU_dist = rightUp(x1,y1,x2,y2)
        d["RU_dist"] = RU_dist

        RDx,RDy,RD_dist = rightDown(x1,y2,x2,y2)
        d["RD_dist"] = RD_dist

        min_dir = min(d, key=d.get)
        if min_dir == "U_dist":
            directions.append("U")
            x1,y1 = Ux,Uy
            count += 1
        if min_dir == "R_dist":
            directions.append("R")
            x1,y1 = Rx,Ry
            count += 1
        if min_dir == "D_dist":
            directions.append("D")
            x1,y1 = Dx,Dy
            count += 1
        if min_dir == "RU_dist":
            directions.append("RU")
            x1,y1 = RUx, RUy
            count += 1
        if min_dir == "RD_dist":
            directions.append("RD")
            x1,y1 = RDx,RDy
            count += 1
    elif (x1 > 1 and x1 < 8) and y1 == 1: #bottom edge
        d = defaultdict()
        Lx,Ly,L_dist = left(x1,y1,x2,y2)
        d["L_dist"] = L_dist

        LUx,LUy,LU_dist = leftUp(x1,y1,x2,y2)
        d["LU_dist"] = LU_dist

        Ux,Uy,U_dist = up(x1,y1,x2,y2)
        d["U_dist"] = U_dist

        RUx,RUy,RU_dist = rightUp(x1,y1,x2,y2)
        d["RU_dist"] = RU_dist

        Rx,Ry,R_dist = right(x1,y1,x2,y2)
        d["R_dist"] = R_dist

        min_dir = min(d,key=d.get)
        if min_dir == "L_dist":
            directions.append("L")
            x1,y1 = Lx,Ly
            count += 1
        if min_dir == "LU_dist":
            directions.append("LU")
            x1,y1 = LUx,LUy
            count += 1
        if min_dir == "U_dist":
            directions.append("U")
            x1,y1 = Ux,Uy
            count += 1
        if min_dir == "RU_dist":
            directions.append("RU")
            x1,y1 = RUx,RUy
            count+= 1
        if min_dir == "R_dist":
            directions.append("R")
            x1,y1 = Rx,Ry
            count += 1
    elif x1 == 8 and (y1 > 1 and y1 < 8):#right edge
        d = defaultdict()
        Ux,Uy,U_dist = up(x1,y1,x2,y2)
        d["U_dist"] = U_dist

        LUx,LUy,LU_dist = leftUp(x1,y1,x2,y2)
        d["LU_dist"] = LU_dist

        Lx,Ly,L_dist = left(x1,y1,x2,y2)
        d["L_dist"] = L_dist

        LDx,LDy,LD_dist = leftDown(x1,y1,x2,y2)
        d["LD_dist"] = LD_dist

        Dx,Dy,D_dist = down(x1,y1,x2,y2)
        d["D_dist"] = D_dist

        min_dir = min(d,key=d.get)
        if min_dir == "U_dist":
            directions.append("U")
            x1,y1 = Ux,Uy
            count += 1
        if min_dir == "LU_dist":
            directions.append("LU")
            x1,y1 = LUx,LUy
            count += 1
        if min_dir == "L_dist":
            directions.append("L")
            x1,y1 = Lx,Ly
            count += 1
        if min_dir == "LD_dist":
            directions.append("LD")
            x1,y1 = LDx,LDy
            count += 1
        if min_dir == "D_dist":
            directions.append("D")
            x1,y1 = Dx,Dy
            count += 1
    elif (x1 > 1 and x1 < 8) and y1 == 8:#top edge
        d = defaultdict()
        Lx,Ly,L_dist = left(x1,y1,x2,y2)
        d["L_dist"] = L_dist

        LDx,LDy,LD_dist = leftDown(x1,y1,x2,y2)
        d["LD_dist"] = LD_dist

        Dx,Dy,D_dist = down(x1,y1,x2,y2)
        d["D_dist"] = D_dist

        RDx,RDy,RD_dist = rightDown(x1,y1,x2,y2)
        d["RD_dist"] = RD_dist

        Rx,Ry,R_dist = right(x1,y1,x2,y2)
        d["R_dist"] = R_dist

        min_dir = min(d,key=d.get)
        if min_dir == "L_dist":
            directions.append("L")
            x1,y1 = Lx,Ly
            count += 1
        if min_dir == "LD_dist":
            directions.append("LD")
            x1,y1 = LDx,LDy
            count += 1
        if min_dir == "D_dist":
            directions.append("D")
            x1,y1 = Dx,Dy
            count += 1
        if min_dir == "RD_dist":
            directions.append("RD")
            x1,y1 = RDx,RDy
            count += 1
        if min_dir == "R_dist":
            directions.append("R")
            x1,y1 = Rx,Ry
            count += 1
    elif x1 == 1 and y1 == 8:#top left corner
        d = defaultdict()
        Rx,Ry,R_dist = right(x1,y1,x2,y2)
        d["R_dist"] = R_dist

        RDx,RDy,RD_dist = rightDown(x1,y1,x2,y2)
        d["RD_dist"] = RD_dist

        Dx,Dy,D_dist = down(x1,y1,x2,y2)
        d["D_dist"] = D_dist

        min_dir = min(d,key=d.get)
        if min_dir == "R_dist":
            directions.append("R")
            x1,y1 = Rx,Ry
            count += 1
        if min_dir == "RD_dist":
            directions.append("RD")
            x1,y1 = RDx,RDy
            count += 1
        if min_dir == "D_dist":
            directions.append("D")
            x1,y1 = Dx,Dy
            count += 1
    elif x1 == 8 and y1 == 8:#top right corner
        d = defaultdict()
        Lx,Ly,L_dist = left(x1,y1,x2,y2)
        d["L_dist"] = L_dist

        LDx,LDy,LD_dist = leftDown(x1,y1,x2,y2)
        d["LD_dist"] = LD_dist

        Dx,Dy,D_dist = down(x1,y1,x2,y2)
        d["D_dist"] = D_dist

        min_dir = min(d,key=d.get)
        if min_dir == "L_dist":
            directions.append("L")
            x1,y1 = Lx,Ly
            count += 1
        if min_dir == "LD_dist":
            directions.append("LD")
            x1,y1 = LDx,LDy
            count += 1
        if min_dir == "D_dist":
            directions.append("D")
            x1,y1 = Dx,Dy
            count += 1
    elif x1 == 8 and y1 == 1:#bottom right corner
        d = defaultdict()
        Ux,Uy,U_dist = up(x1,y1,x2,y2)
        d["U_dist"] = U_dist

        LUx,LUy,LU_dist = leftUp(x1,y1,x2,y2)
        d["LU_dist"] = LU_dist

        Lx,Ly,L_dist = left(x1,y1,x2,y2)
        d["L_dist"] = L_dist

        min_dir = min(d,key=d.get)
        if min_dir == "U_dist":
            directions.append("U")
            x1,y1 = Ux,Uy
            count += 1
        if min_dir == "LU_dist":
            directions.append("LU")
            x1,y1 = LUx,LUy
            count += 1
        if min_dir == "L_dist":
            directions.append("L")
            x1,y1 = Lx,Ly
            count += 1
    elif x1 == 1 and y1 == 1:#bottom left corner
        d = defaultdict()
        Ux,Uy,U_dist = up(x1,y1,x2,y2)
        d["U_dist"] = U_dist

        RUx,RUy,RU_dist = rightUp(x1,y1,x2,y2)
        d["RU_dist"] = RU_dist

        Rx,Ry,R_dist = right(x1,y1,x2,y2)
        d["R_dist"] = R_dist

        min_dir = min(d,key=d.get)
        if min_dir == "U_dist":
            directions.append("U")
            x1,y1 = Ux,Uy
            count += 1
        if min_dir == "RU_dist":
            directions.append("RU")
            x1,y1 = RUx,RUy
            count += 1
        if min_dir == "R_dist":
            directions.append("R")
            x1,y1 = Rx,Ry
            count += 1
    else:
        d = defaultdict()
        LUx,LUy,LU_dist = leftUp(x1,y1,x2,y2)
        d["LU_dist"] = LU_dist

        Ux,Uy,U_dist = up(x1,y1,x2,y2)
        d["U_dist"] = U_dist

        RUx,RUy,RU_dist = rightUp(x1,y1,x2,y2)
        d["RU_dist"] = RU_dist

        Rx,Ry,R_dist = right(x1,y1,x2,y2)
        d["R_dist"] = R_dist

        RDx,RDy,RD_dist = rightDown(x1,y1,x2,y2)
        d["RD_dist"] = RD_dist

        Dx,Dy,D_dist = down(x1,y1,x2,y2)
        d["D_dist"] = D_dist

        LDx,LDy,LD_dist = leftDown(x1,y1,x2,y2)
        d["LD_dist"] = LD_dist

        Lx,Ly,L_dist = left(x1,y1,x2,y2)
        d["L_dist"] = L_dist

        min_dir = min(d,key=d.get)
        if min_dir == "LU_dist":
            directions.append("LU")
            x1,y1 = LUx,LUy
            count += 1
        if min_dir == "U_dist":
            directions.append("U")
            x1,y1 = Ux,Uy
            count += 1
        if min_dir == "RU_dist":
            directions.append("RU")
            x1,y1 = RUx,RUy
            count += 1
        if min_dir == "R_dist":
            directions.append("R")
            x1,y1 = Rx,Ry
            count += 1
        if min_dir == "RD_dist":
            directions.append("RD")
            x1,y1 = RDx,RDy
            count += 1
        if min_dir == "D_dist":
            directions.append("D")
            x1,y1 = Dx,Dy
            count += 1
        if min_dir == "LD_dist":
            directions.append("LD")
            x1,y1 = LDx,LDy
            count += 1
        if min_dir == "L_dist":
            directions.append("L")
            x1,y1 = Lx,Ly
            count += 1
    if x1 == x2 and y1 == y2:
        break

print count
for i in directions:
    print i

s = input()
t = input()
x0 = ord(s[0])
y0 = int(s[1])
x = ord(t[0])
y = int(t[1])
move = ""
while True:
    if (x == x0) and (y == y0):
        break
    if x > x0:
        move += "R"
        x0 += 1
    elif x < x0:
        move += "L"
        x0 -= 1
    if y > y0:
        move += "D"
        y0 += 1
    elif y < y0:
        move += "U"
        y0 -= 1
    move += "\n"
    #print(x, y)
print(move)

s = input() #a8
t = input() #h1

steps= 0
row_dist = int(t[1]) - int(s[1])
col_dist = ord(t[0]) - ord(s[0])

while(row_dist != 0 and col_dist != 0):

    if abs(row_dist) > abs(col_dist):
        if row_dist > 0:
            print("U")
            row_dist -= 1
        elif row_dist < 0:
            print("D")
            row_dist += 1
        else:
            break

    elif abs(row_dist) < abs(col_dist):
        if col_dist > 0:
            print("R")
            col_dist -= 1
        elif col_dist < 0:
            print("L")
            col_dist += 1
        else:
            break

    elif abs(row_dist) == abs(col_dist):
        for i in range(abs(col_dist)):
            if col_dist > 0 and row_dist > 0:
                print("RU")
                col_dist -= 1
                row_dist -= 1
            elif col_dist > 0 and row_dist < 0:
                print("RD")
                col_dist -= 1
                row_dist += 1
            elif col_dist < 0 and row_dist > 0:
                print("LU")
                col_dist += 1
                row_dist -= 1
            elif col_dist < 0 and row_dist < 0:
                print("LD")
                col_dist += 1
                row_dist += 1

import sys

s = raw_input()
t = raw_input()

horiz = dict({'a':0, 'b':1, 'c':2, 'd':3, 'e':4, 'f':5, 'g':6, 'h':7})

sh = horiz[s[0]]
sv = int(s[1])

th = horiz[t[0]]
tv = int(t[1])

moves = dict({'U':0, 'D':0, 'R':0, 'L':0})

if th > sh:
    moves['R'] += th - sh
if th < sh:
    moves['L'] += sh - th
if tv > sv:
    moves['U'] += tv - sv
if tv < sv:
    moves['D'] += sv - tv

total = max(moves.values())

print total
for i in range(0, total):
    for d in moves.keys():
        if moves[d] > i:
            sys.stdout.write(d)
    print ''

s=raw_input()
d=raw_input()
a=[0]
m={}

for i in range(8):
	for j in range(8):
		m[chr(ord('a')+j)+str(8-i)]=i*8+j

ss=m[s]
dd=m[d]
r=dd/8-ss/8
c=dd%8-ss%8

print(r,c)

print(abs(abs(r)-abs(c))+min(abs(r),abs(c)))

def lu(r):
	r=abs(r)
	for i in range(abs(r)):
		print("LU")
def ru(r):
	r=abs(r)
	for i in range(abs(r)):
		print("RU")
def ld(r):
	r=abs(r)
	for i in range(abs(r)):
		print("LD")

def rd(r):
	r=abs(r)
	for i in range(abs(r)):
		print("RD")

def dd(r):
	r=abs(r)
	for i in range(abs(r)):
		print("D")

def ll(r):
	r=abs(r)
	for i in range(abs(r)):
		print("L")

def uu(r):
	r=abs(r)
	for i in range(abs(r)):
		print("U")

def rr(r):
	r=abs(r)
	for i in range(abs(r)):
		print("R")

if(abs(r)>abs(c)):
	if r>=0 and c>=0:
		dd(r-c)
		rd(c)
	elif r>=0 and c<=0:
		dd(r-abs(c))
		ld(c)
	elif r<=0 and c>=0:
		uu(abs(r)-abs(c))
		ru(c)
	elif r<=0 and c<=0:
		uu(abs(r)-abs(c))
		lu(c)

if(abs(r)<abs(c)):
	if r>=0 and c>=0:
		rr(c-r)
		rd(r)
	elif r>=0 and c<=0:
		ll(abs(c)-abs(r))
		ld(r)
	elif r<=0 and c>=0:
		rr(abs(c)-abc(r))
		ru(r)
	elif r<=0 and c<=0:
		ll(abs(c)-abs(r))
		lu(r)

if abs(r)==abs(c):
	if r>=0 and c>=0:
		rd(r)
	elif r>=0 and c<=0:
		ld(r)
	elif r<=0 and c>=0:
		ru(c)
	elif r<=0 and c<=0:
		lu(c)

import pdb
import sys
import hashlib

file = sys.stdin
#file = open("test", "r")

moves = [(-1, -1), (1, 1), (1, -1), (-1, 1), (1, 0), (-1, 0), (0, 1), (0, -1)]
names = ["LD"    , "RU"  , "RD"   , "LU"   , "R"   , "L"    , "U"   , "D"]

sx_s, sy_s = map(str, list(file.readline().rstrip()))
ex_s, ey_s = map(str, list(file.readline().rstrip()))

sx = ord(sx_s) - ord("a")
sy = int(sy_s) - 1
ex = ord(ex_s) - ord("a")
ey = int(ey_s) - 1

output = []
while sx != ex and sy != ey:
    for move, name in zip(moves, names):
        ori_dis = abs(ex - sx) + abs(ey -sy)
        new_dis = abs(ex - (sx + move[0])) + abs(ey - (sy + move[1]))
        if new_dis < ori_dis:
            output.append(name)
            sx += move[0]
            sy += move[1]
            break

print len(output)
for name in output:
    print name

d={'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8}
start=input()
des=input()
l=[]
x,y=int(start[1]),d[start[0]]
x1,y1=int(des[1]),d[des[0]]
while(x!=x1 and y!=y1):
    if(x==x1):
        if(y<y1):
            l.append('R')
            y+=1
        else:
            l.append('L')
            y-=1
    elif(y==y1):
        if(x<x1):
             l.append('U')
             x+=1
        else:
            l.append('D')
            x-=1
    elif(x>x1 and y<y1):
        l.append('RD')
        x-=1
        y+=1
    elif(x>x1 and y>y1):
        l.append('LD')
        x-=1
        y-=1
    elif(x<x1 and y>y1):
        l.append('LU')
        x+=1
        y-=1
    elif(x<x1 and y<y1):
        l.append('RU')
        x+=1
        y+=1
print(len(l))
for i in l:
    print(i)

s=input()
t=input()
r=[]
a=ord(s[0])-96
c=ord(t[0])-96
b=int(s[1])
d=int(t[1])
e=0
if a<c:
    if b<d:
        while b!=d and a!=c:
            a=a+1
            b=b+1
            r.append("RU")
            e=e+1
        if b==d:
            while(a!=c):
                a=a+1
                e=e+1
                r.append("R")
        else:
            while(b!=d):
                b=b+1
                e=e+1
                r.append("U")
    elif b==d:
        while(a!=c):
            a=a+1
            e=e+1
            r.append("R")
    else:
        while b!=d and a!=c:
            a=a+1
            b=b-1
            r.append("RD")
            e=e+1
        if b==d:
            while(a!=c):
                a=a+1
                e=e+1
                r.append("R")
        else:
            while(b!=d):
                b=b-1
                e=e+1
                r.append("U")
else:
    if b<d:
        while b!=d and a!=c:
            a=a-1
            b=b+1
            r.append("LU")
            e=e+1
        if b==d:
            while(a!=c):
                a=a-1
                e=e+1
                r.append("L")
        else:
            while(b!=d):
                b=b+1
                e=e+1
                r.append("U")
    elif b==d:
        while(a!=c):
            a=a-1
            e=e+1
            r.append("L")
    else:
        while b!=d and a!=c:
            a=a-1
            b=b-1
            r.append("LD")
            e=e+1
        if b==d:
            while(a!=c):
                a=a-1
                e=e+1
                r.append("L")
        else:
            while(b!=d):
                b=b-1
                e=e+1
                r.append("D")
print(e)
for i in r:
    print(i)

n=input()
s=input()
a=ord(n[0])-ord(s[0])
b=int(n[1])-int(s[1])
if a>0 and b>0:
    print(max(a,b))
if a>0 and b<=0:
    print(a)
if b>0 and a<=0:
    print(b)
if a<=0 and b<=0:
    print(min(a,b))
while a!=0 or b!=0:
    ans=''
    if a>0:
        ans+="L"
        a-=1
    if a<0:
        ans+="R"
        a+=1
    if b>0:
        ans+="D"
        b-=1
    if b<0:
        ans+='U'
        b+=1
    print(ans)

import string

if __name__ == '__main__':
    s = raw_input()
    t = raw_input()

    letter2loc = dict(zip('abcdefgh', range(1, 9)))

    loc = [letter2loc[s[0]], int(s[1])]
    target = [letter2loc[t[0]], int(t[1])]

    vertical_dict = {True: 'U', False: 'D'}
    horizontal_dict = {True: 'R', False: 'L'}

    move_dict = {'U': 1, 'D': -1, 'L': -1, 'R': 1}

    horiz, vert = target[0]-loc[0], target[1]-loc[1]
    diag_dist = min(abs(horiz), abs(vert))
    print max(abs(horiz)-diag_dist, abs(vert)-diag_dist) + diag_dist
    while (not horiz == 0) and (not vert == 0):
        horiz_move = horizontal_dict[horiz > 0]
        vert_move = vertical_dict[vert > 0]

        print horiz_move + vert_move

        loc[0] += move_dict[horiz_move]
        loc[1] += move_dict[vert_move]

        horiz, vert = target[0]-loc[0], target[1]-loc[1]

    if not vert == 0:
        while vert > 0:
            vert_move = vertical_dict[vert > 0]
            print vert_move
            loc[1] += move_dict[vert_move]
            vert = target[1]-loc[1]
    elif not horiz == 0:
        while horiz > 0:
            horiz_move = horizontal_dict[horiz > 0]
            print horiz_move
            loc[0] += move_dict[horiz_move]
            horiz = target[1]-loc[1]

letter = {'a':0, 'b':1, 'c':2, 'd':3, 'e':4, 'f':5, 'g':6, 'h':7}
number = {'1':0, '2':1, '3':2, '4':3, '5':4, '6':5, '7':6, '8':7}
play = {'L':(0, -1), 'R':(0, 1), 'U':(1, 0), 'D':(0, -1), 'LU':(1, -1), 'LD':(-1, -1), 'RU':(1, 1), 'RD':(-1, 1)}
prnt = {(0, -1):'L', (0, 1):'R', (1, 0):'U', (0, -1):'D', (1, -1):'LU', (-1, -1):'LD', (1, 1):'RU', (-1, 1):'RD'}

s = raw_input()
posini = letter[s[0]], number[s[1]]
s = raw_input()
posfim = letter[s[0]], number[s[1]]

to_run = posini[0] - posfim[0], posini[1] - posfim[1]

if abs(to_run[0]) > abs(to_run[1]):
    print abs(to_run[0])
else:
    print abs(to_run[1])

if to_run[0] > 0 and to_run[1] > 0:
    if to_run[0] > to_run[1]:
        for i in range(to_run[1]):
            print prnt[1, 1]
        to_run = to_run[0] - to_run[1], 0
    else:
        for i in range(to_run[0]):
            print prnt[1, 1]
        to_run = 0, to_run[1] - to_run[0]
elif to_run[0] > 0 and to_run[1] < 0:
    if to_run[0] > -to_run[1]:
        for i in range(-to_run[1]):
            print prnt[1, -1]
        to_run = to_run[0] + to_run[1], 0
    else:
        for i in range(to_run[0]):
            print prnt[1, -1]
        to_run = 0, to_run[0] + to_run[1]
elif to_run[0] < 0 and to_run[1] > 0:
    if -to_run[0] > to_run[1]:
        for i in range(to_run[1]):
            print prnt[-1, 1]
        to_run = to_run[0] + to_run[1], 0
    else:
        for i in range(-to_run[0]):
            print prnt[-1, 1]
        to_run = 0, to_run[0] + to_run[1]
elif to_run[0] < 0 and to_run[1] < 0:
    if -to_run[0] > -to_run[1]:
        for i in range(-to_run[1]):
            print prnt[-1, -1]
        to_run = to_run[0] - to_run[1], 0
    else:
        for i in range(-to_run[0]):
            print prnt[-1, -1]
        to_run = 0, to_run[0] - to_run[1]

if to_run[0] == 0 and to_run[1] > 0:
    for i in range(to_run[1]):
        print prnt[0, 1]
elif to_run[0] == 0 and to_run[1] < 0:
    for i in range(-to_run[1]):
        print prnt[0, -1]
elif to_run[0] > 0 and to_run[1] == 0:
    for i in range(to_run[0]):
        print prnt[1, 0]
elif to_run[0] < 0 and to_run[1] == 0:
    for i in range(-to_run[0]):
        print prnt[-1, 0]

#!/usr/bin/python
s1= raw_input()
s2 =raw_input()

#if ord(s2[0])-ord(s1[0])<0 :
#    print 'ss',ord(s2[0])-ord(s1[0])
if ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1])<0 :
    ss = 'LD'
elif  ord(s2[0])-ord(s1[0])>0 and ord(s2[1])-ord(s1[1]) <0 :
    ss='RD'
elif  ord(s2[0])-ord(s1[0])<0 and ord(s2[1])-ord(s1[1]) >0 :
    ss='LU'
else:
    ss='RU'

if ord(s2[0])-ord(s1[0])<0:
    ss1 = 'U'
else :
    ss1 = 'D'

if ord(s2[1])-ord(s1[1])<0:
    ss2 = 'R'
else :
    ss2 = 'L'

big = abs(ord(s2[0])-ord(s1[0]))
small = abs(ord(s2[1])-ord(s1[1]))

if big < small :
    temp =big;
    big=small;
    small=temp;
    ss1=ss2;

print big

for i in range (0,small):
    print ss

for i in range (0,big-small):
    print ss1

s=input()
n=input()
m=['','a','b','c','d','e','f','g','h']
for i in range(1,len(m)):
    if s[0]==m[i]:
        x=i
    if n[0]==m[i]:
        x2=i
y=int(s[1])
y2=int(n[1])
M=[]
b=''
xod=0
while True:
    if x>x2:
        x-=1
        b+='L'

    if x<x2:
        x+=1
        b+='R'
    if y>y2:
        y-=1
        b+='D'
    if y<y2:
        y+=1
        b+='U'
    xod+=1
    M.append(b)
    b=''
    if x==x2 and y==y2:
        break
print(xod)
for i in range(len(M)):
    print(M[i])