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.

<image>

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

Source: codeforces | Difficulty: EASY
Tags: Greedy algorithms

Shortest paths


Solutions:
xi = tuple(input())
xf = tuple(input())
row = [1, 2, 3, 4, 5, 6, 7, 8]
col = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
movelist = []
row_in = int(xi[1])
col_in = xi[0]
row_fin = int(xf[1])
col_fin = xf[0]
index_ri = row.index(row_in)
index_rf = row.index(row_fin)
index_ci = col.index(col_in)
index_cf = col.index(col_fin)

def d():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ri > 0:
		index_ri -= 1
	movelist += ['D']

def u():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ri < 7:
		index_ri += 1
	movelist += ['U']

def l():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ci > 0:
		index_ci -= 1
	movelist += ['L']

def r():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ci < 7:
		index_ci += 1
	movelist += ['R']

def dl():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ri > 0 and index_ci > 0:
		index_ri -= 1
		index_ci -= 1
	movelist += ['LD']

def dr():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ri > 0 and index_ci < 7:
		index_ri -= 1
		index_ci += 1
	movelist += ['RD']

def ul():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ri < 7 and index_ci > 0:
		index_ri += 1
		index_ci -= 1
	movelist += ['LU']

def ur():
	global index_ri, index_rf, index_ci, index_cf, movelist
	if index_ri < 7 and index_ci < 7:
		index_ri += 1
		index_ci += 1
	movelist += ['RU']
steps = 0
while index_ri != index_rf or index_ci != index_cf:
	if index_ri == index_rf:
		if index_ci < index_cf:
			while index_ci != index_cf:
				r()
				steps += 1
		if index_ci > index_cf:
			while index_ci != index_cf:
				l()
				steps += 1
	if index_ci == index_cf:
		if index_ri < index_rf:
			while index_ri != index_rf:
				u()
				steps += 1
		if index_ri > index_rf:
			while index_ri != index_rf:
				d()
				steps += 1
	if index_ri > index_rf:
		if index_ci < index_cf:
			while index_ci != index_cf and index_ri != index_rf:
				dr()
				steps += 1
		if index_ci > index_cf:
			while index_ci != index_cf and index_ri != index_rf:
				dl()
				steps += 1
	if index_ri < index_rf:
		if index_ci < index_cf:
			while index_ci != index_cf and index_ri != index_rf:
				ur()
				steps += 1
		if index_ci > index_cf:
			while index_ci != index_cf and index_ri != index_rf:
				ul()
				steps += 1
print(steps)
for el in movelist:
	print(el)


s = input()
t = input()
steps = []
countermanigga = 0
while s[0] != t[0] or s[1] != t[1]:
	a = ''
	if s[0] < t[0]:
		a = 'R'
		s = chr(ord(s[0]) + 1) + s[1]
	elif s[0] > t[0]:
		a = 'L'
		s = chr(ord(s[0]) - 1) + s[1]
	else:
		pass
	if s[1] < t[1]:
		a += 'U'
		s = s[0] + chr(ord(s[1]) + 1)
	elif s[1] > t[1]:
		a += 'D'
		s = s[0] + chr(ord(s[1]) - 1)
	else:
		pass
	steps.append(a)
	countermanigga += 1
print(countermanigga)
for i in steps:
	print(i)


s = input().strip()
t = input().strip()
s = [ord(s[0]), int(s[1])]
t = [ord(t[0]), int(t[1])]
steps = {'R': 0, 'L': 0, 'U': 0, 'D': 0}
while t[0] > s[0]:
	s[0] += 1
	steps['R'] += 1
while t[0] < s[0]:
	s[0] -= 1
	steps['L'] += 1
while t[1] > s[1]:
	s[1] += 1
	steps['U'] += 1
while t[1] < s[1]:
	s[1] -= 1
	steps['D'] += 1
result = []
while steps['R'] > 0 and steps['U'] > 0:
	result.append('RU')
	steps['R'] -= 1
	steps['U'] -= 1
while steps['R'] > 0 and steps['D'] > 0:
	result.append('RD')
	steps['R'] -= 1
	steps['D'] -= 1
while steps['L'] > 0 and steps['U'] > 0:
	result.append('LU')
	steps['L'] -= 1
	steps['U'] -= 1
while steps['L'] > 0 and steps['D'] > 0:
	result.append('LD')
	steps['L'] -= 1
	steps['D'] -= 1
for d in steps:
	while steps[d] > 0:
		result.append(d)
		steps[d] -= 1
print(len(result))
for x in result:
	print(x)


p1 = input()
p2 = input()
y1 = int(p1[1])
x1 = ord(p1[0]) - ord('a')
y2 = int(p2[1])
x2 = ord(p2[0]) - ord('a')
lr = 'R' if x2 > x1 else 'L'
ud = 'U' if y2 > y1 else 'D'
r = max(abs(x2 - x1), abs(y2 - y1))
print(r)
for i in range(r):
	if i >= abs(x2 - x1):
		lr = ''
	if i >= abs(y2 - y1):
		ud = ''
	print(lr + ud)


(start_x, start_y) = map(str, input())
(end_x, end_y) = map(str, input())
d = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
moves = ['', '', '', '', '', '', '', '']
if d[end_x] > d[start_x]:
	for i in range(d[end_x] - d[start_x]):
		moves[i] = moves[i] + 'R'
elif d[end_x] < d[start_x]:
	for i in range(d[start_x] - d[end_x]):
		moves[i] = moves[i] + 'L'
else:
	pass
if int(end_y) > int(start_y):
	for i in range(int(end_y) - int(start_y)):
		moves[i] = moves[i] + 'U'
elif int(end_y) < int(start_y):
	for i in range(int(start_y) - int(end_y)):
		moves[i] = moves[i] + 'D'
else:
	pass
i = 0
while i in range(len(moves)):
	if moves[i] == '':
		moves.pop(i)
		i -= 1
	i += 1
print(len(moves))
print('\n'.join(moves))


movList = []

def coordtotuple(s):
	ss = s[0]
	if ss == 'a':
		xxx = 1
	elif ss == 'b':
		xxx = 2
	elif ss == 'c':
		xxx = 3
	elif ss == 'd':
		xxx = 4
	elif ss == 'e':
		xxx = 5
	elif ss == 'f':
		xxx = 6
	elif ss == 'g':
		xxx = 7
	elif ss == 'h':
		xxx = 8
	return [xxx, int(s[1])]

def move():
	if x == xx:
		if y < yy:
			movList.append('U')
			return [0, 1]
		elif y > yy:
			movList.append('D')
			return [0, -1]
	elif y == yy:
		if x < xx:
			movList.append('R')
			return [1, 0]
		elif x > xx:
			movList.append('L')
			return [-1, 0]
	elif x < xx and y < yy:
		movList.append('RU')
		return [1, 1]
	elif x < xx and y > yy:
		movList.append('RD')
		return [1, -1]
	elif x > xx and y < yy:
		movList.append('LU')
		return [-1, 1]
	elif x > xx and y > yy:
		movList.append('LD')
		return [-1, -1]

def printres():
	print(len(movList))
	for i in movList:
		print(i)
inn = input()
x = coordtotuple(inn)[0]
y = coordtotuple(inn)[1]
inn = input()
xx = coordtotuple(inn)[0]
yy = coordtotuple(inn)[1]
while x != xx or y != yy:
	p = move()
	x += p[0]
	y += p[1]
printres()


(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 move(i, j, x, y):
	ans = []
	if x == i and y == j:
		return []
	while i != x or j != y:
		ch = ''
		if i < x:
			ch += 'R'
			i += 1
		elif i > x:
			ch += 'L'
			i -= 1
		if j < y:
			ch += 'U'
			j += 1
		elif j > y:
			ch += 'D'
			j -= 1
		ans.append(ch)
	return ans

def check():
	p1 = input()
	(i, j) = (ord(p1[0]) - ord('a') + 1, ord(p1[1]) - ord('0'))
	p2 = input()
	(x, y) = (ord(p2[0]) - ord('a') + 1, ord(p2[1]) - ord('0'))
	ans = move(i, j, x, y)
	print(len(ans))
	for s in ans:
		print(s)
check()


def solve():
	s = input()
	t = input()
	x_count = ord(t[0]) - ord(s[0])
	y_count = ord(t[1]) - ord(s[1])
	cnt = 0
	result = ''
	while x_count != 0 or y_count != 0:
		if x_count > 0:
			result += 'R'
			x_count -= 1
		elif x_count < 0:
			result += 'L'
			x_count += 1
		if y_count > 0:
			result += 'U'
			y_count -= 1
		elif y_count < 0:
			result += 'D'
			y_count += 1
		result += '\n'
		cnt += 1
	print(cnt)
	print(result)
solve()


s = list(input())
t = list(input())
(s0, s1) = (s[0], int(s[1]))
(t0, t1) = (t[0], int(t[1]))
num_s0 = ord(s0) - 96
num_t0 = ord(t0) - 96
x_axis = abs(num_s0 - num_t0)
y_axis = abs(s1 - t1)
max_moves = max(abs(num_s0 - num_t0), abs(s1 - t1))
min_diagonal = min(abs(num_s0 - num_t0), abs(s1 - t1))
if max_moves <= 7:
	print(max_moves)
	if s0 < t0:
		if s1 < t1:
			while max_moves > 0:
				if min_diagonal > 0:
					print('RU', end='\n')
					max_moves -= 1
					min_diagonal -= 1
				elif x_axis > y_axis:
					print('R', end='\n')
					max_moves -= 1
				else:
					print('U', end='\n')
					max_moves -= 1
		elif s1 == t1:
			while max_moves > 0:
				print('R', end='\n')
				max_moves -= 1
		else:
			while max_moves > 0:
				if min_diagonal > 0:
					print('RD', end='\n')
					max_moves -= 1
					min_diagonal -= 1
				elif x_axis > y_axis:
					print('R', end='\n')
					max_moves -= 1
				else:
					print('D', end='\n')
					max_moves -= 1
	elif s0 == t0:
		if s1 < t1:
			while max_moves > 0:
				print('U', end='\n')
				max_moves -= 1
		else:
			while max_moves > 0:
				print('D', end='\n')
				max_moves -= 1
	elif s1 < t1:
		while max_moves > 0:
			if min_diagonal > 0:
				print('LU', end='\n')
				max_moves -= 1
				min_diagonal -= 1
			elif x_axis > y_axis:
				print('L', end='\n')
				max_moves -= 1
			else:
				print('U', end='\n')
				max_moves -= 1
	elif s1 == t1:
		while max_moves > 0:
			print('L', end='\n')
			max_moves -= 1
	else:
		while max_moves > 0:
			if min_diagonal > 0:
				print('LD', end='\n')
				max_moves -= 1
				min_diagonal -= 1
			elif x_axis > y_axis:
				print('L', end='\n')
				max_moves -= 1
			else:
				print('D', end='\n')
				max_moves -= 1


def bfs(s, t):
	(visited, q) = (set(), [])
	q.append((s, 0, ''))
	visited.add(s)
	while q:
		(front, dist, path) = q.pop(0)
		if front == t:
			return (dist, path)
		for v in board[front[0]][front[1]]:
			if (v[0], v[1]) not in visited:
				visited.add((v[0], v[1]))
				q.append(((v[0], v[1]), dist + 1, '{0},{1}'.format(path, v[2])))
board = [[[] for j in range(8)] for i in range(8)]
for i in range(8):
	for j in range(8):
		if i + 1 < 8:
			board[i][j].append((i + 1, j, 'U'))
			if j + 1 < 8:
				board[i][j].append((i + 1, j + 1, 'RU'))
			if j - 1 >= 0:
				board[i][j].append((i + 1, j - 1, 'LU'))
		if i - 1 >= 0:
			board[i][j].append((i - 1, j, 'D'))
			if j + 1 < 8:
				board[i][j].append((i - 1, j + 1, 'RD'))
			if j - 1 >= 0:
				board[i][j].append((i - 1, j - 1, 'LD'))
		if j + 1 < 8:
			board[i][j].append((i, j + 1, 'R'))
		if j - 1 >= 0:
			board[i][j].append((i, j - 1, 'L'))
col_map = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}
s = input()
s = (int(s[1]) - 1, col_map[s[0]])
t = input()
t = (int(t[1]) - 1, col_map[t[0]])
(dist, path) = bfs(s, t)
print(dist)
for (i, j) in enumerate(path.split(',')):
	if i == 0:
		continue
	print(j)


i = input()
s = (ord(i[0]) - 96, int(i[1]))
j = input()
t = (ord(j[0]) - 96, int(j[1]))
d = [t[0] - s[0], t[1] - s[1]]
if d[0] > 0:
	x = 'R'
else:
	x = 'L'
	d[0] = -d[0]
if d[1] > 0:
	y = 'U'
else:
	y = 'D'
	d[1] = -d[1]
path = []
diag = min(d)
path.extend([x + y] * diag)
d = [d[0] - diag, d[1] - diag]
if d[0] > 0:
	path.extend([x] * d[0])
if d[1] > 0:
	path.extend([y] * d[1])
print(len(path))
for step in path:
	print(step)


s = input()
t = input()
(sc, sr) = (ord(s[0]) - 65, int(s[1]))
(tc, tr) = (ord(t[0]) - 65, int(t[1]))
trail = []
while sc < tc and sr < tr:
	trail.append('RU')
	sc += 1
	sr += 1
while sc < tc and sr > tr:
	trail.append('RD')
	sc += 1
	sr -= 1
while sc > tc and sr < tr:
	trail.append('LU')
	sc -= 1
	sr += 1
while sc > tc and sr > tr:
	trail.append('LD')
	sc -= 1
	sr -= 1
while sc < tc:
	trail.append('R')
	sc += 1
while sc > tc:
	trail.append('L')
	sc -= 1
while sr < tr:
	trail.append('U')
	sr += 1
while sr > tr:
	trail.append('D')
	sr -= 1
print(len(trail))
for step in trail:
	print(step)


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


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


a = input()
b = input()
x = ord(a[0]) - ord(b[0])
y = ord(a[1]) - ord(b[1])
print(max(x, -x, y, -y))
while x != 0 or y != 0:
	r = ''
	if x < 0:
		r = 'R'
		x = x + 1
	if x > 0:
		r = 'L'
		x = x - 1
	if y < 0:
		r = r + 'U'
		y = y + 1
	if y > 0:
		r = r + 'D'
		y = y - 1
	print(r)


def convert_point(point):
	return (ord(point[0]) - ord('a') + 1, int(point[1]))

def move(src, dest):
	x = src[0]
	y = src[1]
	move = ''
	if src[0] > dest[0]:
		x -= 1
		move += 'L'
	elif src[0] < dest[0]:
		x += 1
		move += 'R'
	if src[1] > dest[1]:
		y -= 1
		move += 'D'
	elif src[1] < dest[1]:
		y += 1
		move += 'U'
	return ((x, y), move)

def go(src, dest):
	moves = []
	while not src == dest:
		(src, m) = move(src, dest)
		moves.append(m)
	print(moves.__len__())
	for step in moves:
		print(step)
go(convert_point(input()), convert_point(input()))


I = input
P = print
a = I() + I()
(a, b) = (ord(a[i]) - ord(a[i + 2]) for i in (0, 1))
P(max(a, -a, b, -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
	P(r)


import math
alph = 'abcdefghijklmnopqrstuvwxyz'
s = str(input())
t = str(input())
x1 = alph.index(s[0])
x2 = alph.index(t[0])
y1 = int(s[1])
y2 = int(t[1])
print(max(abs(x1 - x2), abs(y1 - y2)))
while x1 != x2 or y1 != y2:
	if x1 < x2:
		if y1 < y2:
			print('RU')
			x1 += 1
			y1 += 1
		elif y1 > y2:
			print('RD')
			x1 += 1
			y1 -= 1
		else:
			print('R')
			x1 += 1
	elif x1 == x2:
		if y1 < y2:
			print('U')
			y1 += 1
		else:
			print('D')
			y1 -= 1
	elif y1 < y2:
		print('LU')
		x1 -= 1
		y1 += 1
	elif y1 == y2:
		print('L')
		x1 -= 1
	else:
		print('LD')
		x1 -= 1
		y1 -= 1


a = input()
b = input()
if a == b:
	print(0)
	quit()
a1 = int(str(ord(a[0]) - 96) + a[1])
b1 = int(str(ord(b[0]) - 96) + b[1])

def ok(i, j):
	return 0 < i <= 8 and 0 < j <= 8
g = {}
for i in range(1, 9):
	for j in range(1, 9):
		g[10 * i + j] = []
for i in range(1, 9):
	for j in range(1, 9):
		for k in range(-1, 2):
			for l in range(-1, 2):
				if ok(i + k, j + l) and (not (k == 0 and l == 0)):
					g[10 * i + j].append(10 * (i + k) + j + l)
visited = [False] * 90
parent = [0] * 90
dist = [10000] * 90
s = [a1]
dist[a1] = 0
while s:
	a = s.pop()
	if not visited[a]:
		visited[a] = True
		for i in g[a]:
			s = [i] + s
			if dist[a] + 1 < dist[i]:
				parent[i] = a
				dist[i] = dist[a] + 1
chain = [b1]
while parent[chain[-1]] != a1:
	chain.append(parent[chain[-1]])
chain.append(a1)
chain.reverse()
print(dist[b1])
for i in range(len(chain) - 1):
	a = chain[i + 1] // 10 - chain[i] // 10
	b = chain[i + 1] % 10 - chain[i] % 10
	strx = ''
	strx += {-1: 'L', 0: '', 1: 'R'}[a]
	strx += {-1: 'D', 0: '', 1: 'U'}[b]
	print(strx)


s = input()
t = input()
vertical = int(s[1]) - int(t[1])
horizontal = ord(s[0]) - ord(t[0])
if vertical < 0:
	dir_ver = 'U'
else:
	dir_ver = 'D'
if horizontal < 0:
	dir_hor = 'R'
else:
	dir_hor = 'L'
c_diagonal = 0
while vertical != 0 and horizontal != 0:
	if dir_ver == 'U':
		vertical += 1
	else:
		vertical -= 1
	if dir_hor == 'R':
		horizontal += 1
	else:
		horizontal -= 1
	c_diagonal += 1
if vertical == 0 and horizontal == 0:
	print(c_diagonal)
	for i in range(c_diagonal):
		print(dir_hor, dir_ver, sep='')
elif vertical == 0:
	print(c_diagonal + abs(horizontal))
	for i in range(c_diagonal):
		print(dir_hor, dir_ver, sep='')
	for i in range(abs(horizontal)):
		if horizontal < 0:
			print('R')
		else:
			print('L')
else:
	print(c_diagonal + abs(vertical))
	for i in range(c_diagonal):
		print(dir_hor, dir_ver, sep='')
	for i in range(abs(vertical)):
		if vertical < 0:
			print('U')
		else:
			print('D')


(s,) = [str(x) for x in input().split()]
(t,) = [str(x) for x in input().split()]
trans = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
width = abs(int(s[1]) - int(t[1]))
lenght = abs(trans[s[0]] - trans[t[0]])
print(max(width, lenght))
if trans[t[0]] >= trans[s[0]] and int(t[1]) >= int(s[1]):
	for i in range(min(width, lenght)):
		print('RU')
	if width > lenght:
		for i in range(width - lenght):
			print('U')
	else:
		for i in range(lenght - width):
			print('R')
if trans[t[0]] < trans[s[0]] and int(t[1]) >= int(s[1]):
	for i in range(min(width, lenght)):
		print('LU')
	if width > lenght:
		for i in range(width - lenght):
			print('U')
	else:
		for i in range(lenght - width):
			print('L')
if trans[t[0]] >= trans[s[0]] and int(t[1]) < int(s[1]):
	for i in range(min(width, lenght)):
		print('RD')
	if width > lenght:
		for i in range(width - lenght):
			print('D')
	else:
		for i in range(lenght - width):
			print('R')
if trans[t[0]] < trans[s[0]] and int(t[1]) < int(s[1]):
	for i in range(min(width, lenght)):
		print('LD')
	if width > lenght:
		for i in range(width - lenght):
			print('D')
	else:
		for i in range(lenght - width):
			print('L')


a = [ord(i) for i in input()]
b = [ord(i) for i in input()]
d1 = {1: 'R', -1: 'L'}
d2 = {1: 'U', -1: 'D'}
d3 = ('U', 'D', 'R', 'L')
p = max(abs(a[0] - b[0]), abs(a[1] - b[1]))
p1 = min(abs(a[0] - b[0]), abs(a[1] - b[1]))
print(p)
f1 = 1 if a[0] < b[0] else -1
f2 = 1 if a[1] < b[1] else -1
for _ in range(p1):
	print(d1[f1], d2[f2], sep='')
a[0] += p1 * f1
a[1] += p1 * f2
if a[0] == b[0]:
	f = 0 if a[1] < b[1] else 1
else:
	f = 2 if a[0] < b[0] else 3
for _ in range(p - p1):
	print(d3[f])


S = input()
T = input()
R = 0
L = 0
U = 0
D = 0
RD = 0
RU = 0
LD = 0
LU = 0
M = 0
(s, t) = ([0] * 2, [0] * 2)
(s[1], t[1]) = (int(S[1]), int(T[1]))
s[0] = ord(S[0]) - 96
t[0] = ord(T[0]) - 96
for i in range(8):
	if s[0] < t[0] and s[1] < t[1]:
		RU = RU + 1
		M = M + 1
		t[0] = t[0] - 1
		t[1] = t[1] - 1
	elif s[0] < t[0] and s[1] > t[1]:
		RD = RD + 1
		M = M + 1
		t[0] = t[0] - 1
		t[1] = t[1] + 1
	elif s[0] > t[0] and s[1] < t[1]:
		LU = LU + 1
		M = M + 1
		t[0] = t[0] + 1
		t[1] = t[1] - 1
	elif s[0] > t[0] and s[1] > t[1]:
		LD = LD + 1
		M = M + 1
		t[0] = t[0] + 1
		t[1] = t[1] + 1
	elif s[0] < t[0]:
		R = R + 1
		M = M + 1
		t[0] = t[0] - 1
	elif s[0] > t[0]:
		L = L + 1
		M = M + 1
		t[0] = t[0] + 1
	elif s[1] < t[1]:
		U = U + 1
		M = M + 1
		t[1] = t[1] - 1
	elif s[1] > t[1]:
		D = D + 1
		M = M + 1
		t[1] = t[1] + 1
print(M)
for i in range(RU):
	print('RU')
for i in range(RD):
	print('RD')
for i in range(LU):
	print('LU')
for i in range(LD):
	print('LD')
for i in range(R):
	print('R')
for i in range(L):
	print('L')
for i in range(U):
	print('U')
for i in range(D):
	print('D')


import itertools
import sys

def main():
	solve()

def solve():
	data = sys.stdin.readlines()
	(start_pos, end_pos) = parse(data)
	moves = calc_moves(start_pos, end_pos)
	output = '\n'.join(moves)
	print(len(moves))
	print(output)

def parse(data):
	start_s = data[0]
	end_s = data[1]
	start_pos = (ord(start_s[0]) - ord('a'), int(start_s[1]))
	end_pos = (ord(end_s[0]) - ord('a'), int(end_s[1]))
	return (start_pos, end_pos)

def calc_moves(start_pos, end_pos):
	diff_hor = end_pos[0] - start_pos[0]
	diff_vert = end_pos[1] - start_pos[1]
	dir_vert = 'U' if diff_vert > 0 else 'D'
	dir_hor = 'R' if diff_hor > 0 else 'L'
	diff_hor = abs(diff_hor)
	diff_vert = abs(diff_vert)
	moves_hor = (dir_hor for _ in range(diff_hor))
	moves_vert = (dir_vert for _ in range(diff_vert))
	return tuple((''.join(m_tuple) for m_tuple in itertools.zip_longest(moves_hor, moves_vert, fillvalue='')))
main()


start = list(input())
end = list(input())
s = [0, 0]
s[0] = 8 - int(start[1])
s[1] = ord(start[0]) - ord('a')
e = [0, 0]
e[0] = 8 - int(end[1])
e[1] = ord(end[0]) - ord('a')
moves = []
diagonal_move = ''
diagonal_row = 0
diagonal_col = 0
if s[0] < e[0] and s[1] < e[1]:
	diagonal_move = 'RD'
	diagonal_row = 1
	diagonal_col = 1
elif s[0] > e[0] and s[1] > e[1]:
	diagonal_move = 'LU'
	diagonal_row = -1
	diagonal_col = -1
elif s[0] > e[0] and s[1] < e[1]:
	diagonal_move = 'RU'
	diagonal_row = -1
	diagonal_col = 1
elif s[0] < e[0] and s[1] > e[1]:
	diagonal_move = 'LD'
	diagonal_row = 1
	diagonal_col = -1
if diagonal_move != '':
	while s[0] != e[0] and s[1] != e[1]:
		s[0] += diagonal_row
		s[1] += diagonal_col
		moves.append(diagonal_move)
if s[0] != e[0]:
	while s[0] < e[0]:
		moves.append('D')
		s[0] += 1
	while s[0] > e[0]:
		moves.append('U')
		s[0] -= 1
elif s[1] != e[1]:
	while s[1] < e[1]:
		moves.append('R')
		s[1] += 1
	while s[1] > e[1]:
		moves.append('L')
		s[1] -= 1
print(len(moves))
for move in moves:
	print(move)


a = input()
b = input()
s = [ord(a[0]) - ord('a') + 1, int(a[1])]
t = [ord(b[0]) - ord('a') + 1, int(b[1])]
d = min(abs(s[0] - t[0]), abs(s[1] - t[1]))
n = max(abs(s[0] - t[0]), abs(s[1] - t[1]))
print(n)
dans = ''
if s[0] < t[0]:
	dans += 'R'
	s[0] += d
elif s[0] > t[0]:
	dans += 'L'
	s[0] -= d
if s[1] < t[1]:
	dans += 'U'
	s[1] += d
elif s[1] > t[1]:
	dans += 'D'
	s[1] -= d
for _ in range(0, d):
	print(dans)
if s[0] < t[0]:
	d = t[0] - s[0]
	for i in range(0, d):
		print('R')
elif s[0] > t[0]:
	d = s[0] - t[0]
	for i in range(0, d):
		print('L')
elif s[1] < t[1]:
	d = t[1] - s[1]
	for i in range(0, d):
		print('U')
elif s[1] > t[1]:
	d = s[1] - t[1]
	for i in range(0, d):
		print('D')


king_pos = input()
target_pos = input()
fields = 'abcdefgh'
kx = fields.index(king_pos[0]) + 1
ky = int(king_pos[1])
tx = fields.index(target_pos[0]) + 1
ty = int(target_pos[1])
x_diff = tx - kx
y_diff = ty - ky
lor = 'R' if x_diff > 0 else 'L'
dou = 'U' if y_diff > 0 else 'D'
x_diff = abs(x_diff)
y_diff = abs(y_diff)
num_moves = max(x_diff, y_diff)
print(num_moves)
for i in range(num_moves):
	if x_diff > 0:
		print(lor, end='')
	if y_diff > 0:
		print(dou, end='')
	print('')
	x_diff -= 1
	y_diff -= 1


p1 = list(input())
p2 = list(input())
l_m = list()
while p1[0] != p2[0] or p1[1] != p2[1]:
	s = ''
	if p1[0] < p2[0]:
		s = 'R'
		p1[0] = chr(ord(p1[0]) + 1)
	elif p1[0] > p2[0]:
		s = 'L'
		p1[0] = chr(ord(p1[0]) - 1)
	if p1[1] < p2[1]:
		s = s + 'U'
		p1[1] = str(int(p1[1]) + 1)
	elif p1[1] > p2[1]:
		s = s + 'D'
		p1[1] = str(int(p1[1]) - 1)
	l_m.append(s)
print(len(l_m))
print('\n'.join(l_m))


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


import math

def dist(arr1, arr2):
	x1 = arr1[0]
	y1 = arr1[1]
	x2 = arr2[0]
	y2 = arr2[1]
	x1x2 = math.pow(abs(x1 - x2), 2)
	y1y2 = math.pow(abs(y1 - y2), 2)
	distance = math.pow(x1x2 + y1y2, 0.5)
	return distance

def getneighbours(loc):
	x1 = loc[0]
	y1 = loc[1]
	neighbours = [[x1 + 1, y1], [x1 - 1, y1], [x1, y1 + 1], [x1, y1 - 1], [x1 + 1, y1 + 1], [x1 - 1, y1 - 1], [x1 + 1, y1 - 1], [x1 - 1, y1 + 1]]
	for i in neighbours:
		for k in i:
			if k > 8 or k < 1:
				if i in neighbours:
					neighbours.remove(i)
	return neighbours
s = input()
t = input()
key = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
kingc = 0
for i in s:
	if i in key:
		kingc = [key[i], int(s[1])]
destination = 0
for i in t:
	if i in key:
		destination = [key[i], int(t[1])]
stepstaken = []
while dist(kingc, destination) != 0:
	kingneighbours = getneighbours(kingc)
	possibledistances = []
	for i in kingneighbours:
		possibledistances += [dist(i, destination)]
	mind = possibledistances.index(min(possibledistances))
	if kingneighbours[mind][0] == kingc[0]:
		if kingneighbours[mind][1] > kingc[1]:
			stepstaken += ['U']
		else:
			stepstaken += ['D']
	if kingneighbours[mind][1] == kingc[1]:
		if kingneighbours[mind][0] > kingc[0]:
			stepstaken += ['R']
		else:
			stepstaken += ['L']
	if kingneighbours[mind][0] < kingc[0] and kingneighbours[mind][1] != kingc[1]:
		if kingneighbours[mind][1] > kingc[1]:
			stepstaken += ['LU']
		else:
			stepstaken += ['LD']
	if kingneighbours[mind][0] > kingc[0] and kingneighbours[mind][1] != kingc[1]:
		if kingneighbours[mind][1] > kingc[1]:
			stepstaken += ['RU']
		else:
			stepstaken += ['RD']
	kingc = kingneighbours[mind]
print(len(stepstaken))
for i in stepstaken:
	print(i)


s = tuple(input().strip())
t = tuple(input().strip())
f = lambda x, y: max(ord(x), ord(y)) - min(ord(x), ord(y))
ans = max(f(s[0], t[0]), f(s[1], t[1]))
print(ans)
if s[0] <= t[0] and s[1] <= t[1]:
	k = min(f(s[0], t[0]), f(s[1], t[1]))
	for i in range(k):
		print('RU')
	if f(s[0], t[0]) < f(s[1], t[1]):
		for i in range(ans - k):
			print('U')
	else:
		for i in range(ans - k):
			print('R')
elif s[0] <= t[0] and s[1] >= t[1]:
	k = min(f(s[0], t[0]), f(s[1], t[1]))
	for i in range(k):
		print('RD')
	if f(s[0], t[0]) < f(s[1], t[1]):
		for i in range(ans - k):
			print('D')
	else:
		for i in range(ans - k):
			print('R')
elif s[0] >= t[0] and s[1] <= t[1]:
	k = min(f(s[0], t[0]), f(s[1], t[1]))
	for i in range(k):
		print('LU')
	if f(s[0], t[0]) < f(s[1], t[1]):
		for i in range(ans - k):
			print('U')
	else:
		for i in range(ans - k):
			print('L')
elif s[0] >= t[0] and s[1] >= t[1]:
	k = min(f(s[0], t[0]), f(s[1], t[1]))
	for i in range(k):
		print('LD')
	if f(s[0], t[0]) < f(s[1], t[1]):
		for i in range(ans - k):
			print('D')
	else:
		for i in range(ans - k):
			print('L')


from itertools import zip_longest
begin = list(input())
end = list(input())
begin[0] = ord(begin[0]) - ord('a') + 1
begin[1] = int(begin[1])
end[0] = ord(end[0]) - ord('a') + 1
end[1] = int(end[1])
delta_x = end[0] - begin[0]
delta_y = end[1] - begin[1]
move_times = max(abs(delta_x), abs(delta_y))
print(move_times)
movemap = {(0, -1): 'D', (0, 1): 'U', (1, 0): 'R', (-1, 0): 'L', (1, -1): 'RD', (-1, -1): 'LD', (1, 1): 'RU', (-1, 1): 'LU'}
move_x = [delta_x / abs(delta_x) for _ in range(abs(delta_x))]
move_y = [delta_y / abs(delta_y) for _ in range(abs(delta_y))]
move = zip_longest(move_x, move_y, fillvalue=0)
for i in move:
	print(movemap[i])


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

def move(s1, s2, t1, t2):
	_move = ''
	if s1 < t1:
		_move = _move + 'R'
	if s1 > t1:
		_move = _move + 'L'
	if s2 < t2:
		_move = _move + 'U'
	if s2 > t2:
		_move = _move + 'D'
	return _move
(s1, s2) = list(input())
(t1, t2) = list(input())
(s1, t1) = (A.index(s1), A.index(t1))
(s2, t2) = (int(s2), int(t2))
_move = True
M = []
while _move:
	_move = move(s1, s2, t1, t2)
	if 'R' in _move:
		s1 += 1
	if 'L' in _move:
		s1 -= 1
	if 'U' in _move:
		s2 += 1
	if 'D' in _move:
		s2 -= 1
	if _move == False:
		pass
	M = M + [_move]
print(len(M) - 1)
print('%s' % '\n'.join(M))


import sys
initPos = input()
finPos = input()
initX = int(ord(initPos[0]) - 96)
initY = 9 - int(initPos[1])
finX = int(ord(finPos[0]) - 96)
finY = 9 - int(finPos[1])
if initY == finY:
	print(abs(initX - finX))
	if finX > initX:
		for r in range(0, abs(initX - finX)):
			print('R')
	else:
		for r in range(0, abs(finX - initX)):
			print('L')
elif initX == finX:
	print(abs(initY - finY))
	if finY > initY:
		for r in range(0, abs(initY - finY)):
			print('D')
	else:
		for r in range(0, abs(finY - initY)):
			print('U')
else:
	horiz = abs(initX - finX)
	vert = abs(initY - finY)
	if horiz > vert:
		if initX > finX:
			print(initX - finX)
			for i in range(0, abs(initY - finY)):
				if initY > finY:
					print('LU')
				else:
					print('LD')
			for i in range(0, initX - finX - abs(initY - finY)):
				print('L')
		else:
			print(finX - initX)
			for i in range(0, abs(initY - finY)):
				if initY > finY:
					print('RU')
				else:
					print('RD')
			for i in range(0, finX - initX - abs(initY - finY)):
				print('R')
	elif vert > horiz:
		if initY > finY:
			print(initY - finY)
			for i in range(0, abs(initX - finX)):
				if initX > finX:
					print('LU')
				else:
					print('RU')
			for i in range(0, initY - finY - abs(initX - finX)):
				print('U')
		else:
			print(finY - initY)
			for i in range(0, abs(initX - finX)):
				if initX > finX:
					print('LD')
				else:
					print('RD')
			for i in range(0, finY - initY - abs(initX - finX)):
				print('D')
	else:
		print(abs(initX - finX))
		for i in range(0, abs(initX - finX)):
			if initX > finX:
				if initY > finY:
					print('LU')
				else:
					print('LD')
			elif initY > finY:
				print('RU')
			else:
				print('RD')


alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
string = input()
c1 = alphabet.index(string[0]) + 1
r1 = int(string[1])
string = input()
c2 = alphabet.index(string[0]) + 1
r2 = int(string[1])
a = abs(c1 - c2)
b = abs(r1 - r2)

def x(text):
	print(b)
	for x in range(a):
		print(text)
	for x in range(a, b):
		print(text[1])

def y(text):
	print(a)
	for x in range(b):
		print(text)
	for x in range(b, a):
		print(text[0])

def xy(text):
	if a < b:
		x(text)
	else:
		y(text)
if c1 < c2:
	if r1 < r2:
		xy('RU')
	else:
		xy('RD')
elif r1 < r2:
	xy('LU')
else:
	xy('LD')


s = input()
t = input()
q = 'abcdefgh'

def f(x):
	return q.index(x)
s = [f(s[0]), int(s[1])]
t = [f(t[0]), int(t[1])]
x = t[0] - s[0]
y = t[1] - s[1]
k = min(abs(x), abs(y))
j = abs(abs(x) - abs(y))
print(k + j)
if (x != 0) * (y != 0):
	w = [[[1, 1], 'RU'], [[1, -1], 'RD'], [[-1, 1], 'LU'], [[-1, -1], 'LD']]
	a = [x // abs(x), y // abs(y)]
	for i in w:
		if i[0] == a:
			step = i[1] + '\n'
			print(step * k)
			break
if abs(x) - abs(y) > 0:
	nx = x // abs(x)
	if nx == 1:
		print('R\n' * j)
	else:
		print('L\n' * j)
elif abs(x) - abs(y) < 0:
	ny = y // abs(y)
	if ny == 1:
		print('U\n' * j)
	else:
		print('D\n' * j)


G = {'5F': ['5E', '5G', '6F', '4F', '4E', '6E', '4G', '6G'], '1H': ['2G', '1G', '2H'], '6C': ['6B', '6D', '7C', '5C', '5B', '7B', '5D', '7D'], '3D': ['3C', '3E', '4D', '2D', '2C', '4C', '2E', '4E'], '6F': ['6E', '6G', '7F', '5F', '5E', '7E', '5G', '7G'], '8B': ['8A', '8C', '7B', '7C', '7A'], '2H': ['1H', '3H', '2G', '1G', '3G'], '5A': ['4A', '6A', '5B', '4B', '6B'], '3C': ['3B', '3D', '4C', '2C', '2B', '4B', '2D', '4D'], '4F': ['4E', '4G', '5F', '3F', '3E', '5E', '3G', '5G'], '5C': ['5B', '5D', '6C', '4C', '4B', '6B', '4D', '6D'], '6E': ['6D', '6F', '7E', '5E', '5D', '7D', '5F', '7F'], '5D': ['5C', '5E', '6D', '4D', '4C', '6C', '4E', '6E'], '2B': ['2A', '2C', '3B', '1B', '1A', '3A', '1C', '3C'], '8E': ['8D', '8F', '7E', '7F', '7D'], '7C': ['7B', '7D', '8C', '6C', '6B', '8B', '6D', '8D'], '2G': ['2F', '2H', '3G', '1G', '1F', '3F', '1H', '3H'], '3A': ['2A', '4A', '3B', '2B', '4B'], '4D': ['4C', '4E', '5D', '3D', '3C', '5C', '3E', '5E'], '4H': ['3H', '5H', '4G', '3G', '5G'], '6B': ['6A', '6C', '7B', '5B', '5A', '7A', '5C', '7C'], '5B': ['5A', '5C', '6B', '4B', '4A', '6A', '4C', '6C'], '4A': ['3A', '5A', '4B', '3B', '5B'], '8D': ['8C', '8E', '7D', '7E', '7C'], '4B': ['4A', '4C', '5B', '3B', '3A', '5A', '3C', '5C'], '8C': ['8B', '8D', '7C', '7D', '7B'], '8G': ['8F', '8H', '7G', '7H', '7F'], '1C': ['1B', '1D', '2C', '2D', '2B'], '4G': ['4F', '4H', '5G', '3G', '3F', '5F', '3H', '5H'], '8A': ['8B', '7B', '7A'], '6A': ['5A', '7A', '6B', '5B', '7B'], '2F': ['2E', '2G', '3F', '1F', '1E', '3E', '1G', '3G'], '4C': ['4B', '4D', '5C', '3C', '3B', '5B', '3D', '5D'], '7H': ['6H', '8H', '7G', '6G', '8G'], '2E': ['2D', '2F', '3E', '1E', '1D', '3D', '1F', '3F'], '2A': ['1A', '3A', '2B', '1B', '3B'], '2C': ['2B', '2D', '3C', '1C', '1B', '3B', '1D', '3D'], '1B': ['1A', '1C', '2B', '2C', '2A'], '3E': ['3D', '3F', '4E', '2E', '2D', '4D', '2F', '4F'], '5E': ['5D', '5F', '6E', '4E', '4D', '6D', '4F', '6F'], '7D': ['7C', '7E', '8D', '6D', '6C', '8C', '6E', '8E'], '8F': ['8E', '8G', '7F', '7G', '7E'], '3H': ['2H', '4H', '3G', '2G', '4G'], '7B': ['7A', '7C', '8B', '6B', '6A', '8A', '6C', '8C'], '1A': ['1B', '2B', '2A'], '7A': ['6A', '8A', '7B', '6B', '8B'], '7G': ['7F', '7H', '8G', '6G', '6F', '8F', '6H', '8H'], '5G': ['5F', '5H', '6G', '4G', '4F', '6F', '4H', '6H'], '3B': ['3A', '3C', '4B', '2B', '2A', '4A', '2C', '4C'], '7E': ['7D', '7F', '8E', '6E', '6D', '8D', '6F', '8F'], '1G': ['1F', '1H', '2G', '2H', '2F'], '2D': ['2C', '2E', '3D', '1D', '1C', '3C', '1E', '3E'], '6G': ['6F', '6H', '7G', '5G', '5F', '7F', '5H', '7H'], '6D': ['6C', '6E', '7D', '5D', '5C', '7C', '5E', '7E'], '8H': ['7G', '8G', '7H'], '1F': ['1E', '1G', '2F', '2G', '2E'], '5H': ['4H', '6H', '5G', '4G', '6G'], '3G': ['3F', '3H', '4G', '2G', '2F', '4F', '2H', '4H'], '3F': ['3E', '3G', '4F', '2F', '2E', '4E', '2G', '4G'], '1D': ['1C', '1E', '2D', '2E', '2C'], '6H': ['5H', '7H', '6G', '5G', '7G'], '4E': ['4D', '4F', '5E', '3E', '3D', '5D', '3F', '5F'], '1E': ['1D', '1F', '2E', '2F', '2D'], '7F': ['7E', '7G', '8F', '6F', '6E', '8E', '6G', '8G']}

def BFS(G, start, end):
	visited = [start]
	queue = [start]
	level_is = {i: -1 for i in G.keys()}
	level_is[start] = 0
	while queue != []:
		top = queue.pop(0)
		if top == end:
			return level_is
		for i in G[top]:
			if i not in visited:
				if level_is[i] == -1:
					level_is[i] = level_is[top] + 1
				visited.append(i)
				queue.append(i)

def get_path(level_is, end, start):
	p = []
	while end != start:
		p.append(end)
		for i in G[end]:
			if level_is[i] == level_is[end] - 1:
				end = i
				continue
			else:
				pass
	p.append(start)
	return p[::-1]

def moves_generator(path):
	move = []
	for i in range(1, len(path)):
		a = path[i]
		b = path[i - 1]
		if a[0] == b[0]:
			if a[1] < b[1]:
				move.append('L')
			elif a[1] > b[1]:
				move.append('R')
		elif a[1] == b[1]:
			if int(a[0]) < int(b[0]):
				move.append('D')
			elif int(a[0]) > int(b[0]):
				move.append('U')
		elif int(a[0]) == int(b[0]) + 1 and ord(a[1]) == ord(b[1]) + 1:
			move.append('RU')
		elif int(a[0]) == int(b[0]) - 1 and ord(a[1]) == ord(b[1]) + 1:
			move.append('RD')
		elif int(a[0]) == int(b[0]) + 1 and ord(a[1]) == ord(b[1]) - 1:
			move.append('LU')
		elif int(a[0]) == int(b[0]) - 1 and ord(a[1]) == ord(b[1]) - 1:
			move.append('LD')
	print(len(move))
	for i in move:
		print(i)
start = input()
end = input()
start = start.capitalize()[::-1]
end = end.capitalize()[::-1]
if end in G[start]:
	moves_generator([start, end])
else:
	level_is = BFS(G, start, end)
	path = get_path(level_is, end, start)
	moves_generator(path)


import math
src = input()
st = [ord(src[0]) - ord('a'), ord(src[1]) - ord('0')]
src = input()
ed = [ord(src[0]) - ord('a'), ord(src[1]) - ord('0')]
x = ed[0] - st[0]
y = ed[1] - st[1]
step = lambda x, y: abs(x) if abs(x) > abs(y) else abs(y)
print(step(x, y))
while x != 0 or y != 0:
	res = ''
	if x != 0:
		if x > 0:
			x -= 1
			res += 'R'
		else:
			x += 1
			res += 'L'
	if y != 0:
		if y > 0:
			y -= 1
			res += 'U'
		else:
			y += 1
			res += 'D'
	print(res)


(s, t) = (input(), input())
row_diff = int(s[1]) - int(t[1])
row_move = ''
if row_diff > 0:
	row_move = 'D'
elif row_diff < 0:
	row_move = 'U'
col_diff = ord(s[0]) - ord(t[0])
col_move = ''
if col_diff > 0:
	col_move = 'L'
elif col_diff < 0:
	col_move = 'R'
print(max(abs(row_diff), abs(col_diff)))
(i, j) = (0, 0)
while i < abs(row_diff) and j < abs(col_diff):
	print(col_move + row_move)
	i += 1
	j += 1
while i < abs(row_diff):
	print(row_move)
	i += 1
while j < abs(col_diff):
	print(col_move)
	j += 1


from sys import stdin, stdout, setrecursionlimit
input = stdin.readline
flush = stdout.flush
OUT = []

def write(item, sep=' '):
	if type(item) is int:
		OUT.append(str(item))
	elif type(item) is list:
		if type(item[0]) is int:
			OUT.append(sep.join(map(str, item)))
		else:
			OUT.append(sep.join(item))
	else:
		OUT.append(item)

def PRINT():
	print('\n'.join(OUT))
GI = lambda : int(input())
GS = lambda : input()[:-1]
gi = lambda : list(map(int, input().split()))
gs = lambda : input().split()
(x, y) = GS()
x = ord(x) - 97
y = int(y) - 1
(a, b) = GS()
a = ord(a) - 97
b = int(b) - 1
arr = []
while x != a and y != b:
	if x < a and y < b:
		arr.append('RU')
		x += 1
		y += 1
	elif x < a and y > b:
		arr.append('RD')
		x += 1
		y -= 1
	elif x > a and y < b:
		arr.append('LU')
		x -= 1
		y += 1
	else:
		arr.append('LD')
		x -= 1
		y -= 1
while x != a:
	if x < a:
		arr.append('R')
		x += 1
	else:
		arr.append('L')
		x -= 1
while y != b:
	if y < b:
		arr.append('U')
		y += 1
	else:
		arr.append('D')
		y -= 1
write(len(arr))
for i in arr:
	write(i)
PRINT()


def toCoord(pair):
	col = ord(pair[0]) - ord('a')
	row = int(pair[1]) - 1
	return (row, col)

def diff(orig, dest):
	return (dest[0] - orig[0], dest[1] - orig[1])

def man_dist(df):
	return abs(df[0]) + abs(df[1])

def dist(df):
	return max(abs(df[0]), abs(df[1]))

def step(curr, move):
	return (curr[0] + move[0], curr[1] + move[1])

def valid(pos):
	return pos[0] >= 0 and pos[1] >= 0 and (pos[0] < 8) and (pos[1] < 8)
orig = toCoord(input())
dest = toCoord(input())
print(dist(diff(orig, dest)))
moves = {(1, 1): 'RU', (-1, 1): 'RD', (1, -1): 'LU', (-1, -1): 'LD', (1, 0): 'U', (0, 1): 'R', (-1, 0): 'D', (0, -1): 'L'}
while orig != dest:
	best = float('inf')
	move = ''
	answ = None
	for m in moves:
		nxt = step(orig, m)
		df = diff(nxt, dest)
		if dist(df) < best and valid(nxt):
			best = dist(df)
			move = moves[m]
			answ = nxt
	print(move)
	orig = answ


s1 = input()
s2 = input()
a1 = ord(s1[0])
a2 = int(s1[1])
b1 = ord(s2[0])
b2 = int(s2[1])
a = []
dem = 0
while a1 != b1 or a2 != b2:
	if a1 < b1 and a2 < b2:
		a1 += 1
		a2 += 1
		a.append('RU')
		dem += 1
	elif a1 < b1 and a2 > b2:
		a1 += 1
		a2 -= 1
		a.append('RD')
		dem += 1
	elif a1 > b1 and a2 < b2:
		a1 -= 1
		a2 += 1
		a.append('LU')
		dem += 1
	elif a1 > b1 and a2 > b2:
		a1 -= 1
		a2 -= 1
		a.append('LD')
		dem += 1
	elif a1 == b1 and a2 < b2:
		a2 += 1
		a.append('U')
		dem += 1
	elif a1 == b1 and a2 > b2:
		a2 -= 1
		a.append('D')
		dem += 1
	elif a1 < b1 and a2 == b2:
		a1 += 1
		a.append('R')
		dem += 1
	elif a1 > b1 and a2 == b2:
		a1 -= 1
		a.append('L')
		dem += 1
print(dem)
for i in range(len(a)):
	print(a[i])


(a, b) = (input(), input())
(m, n) = (ord(a[i]) - ord(b[i]) for i in range(0, 2))
p = max(abs(m), abs(n))
print(p)
while m != 0 or n != 0:
	r = ''
	if m < 0:
		r = 'R'
		m += 1
	elif m > 0:
		r = 'L'
		m -= 1
	if n < 0:
		r += 'U'
		n += 1
	elif n > 0:
		r += 'D'
		n -= 1
	print(r)


s1 = input()
s2 = input()
x1 = ord(s1[0]) - ord('a')
y1 = int(s1[1]) - 1
x2 = ord(s2[0]) - ord('a')
y2 = int(s2[1]) - 1
cnt = 0
d = []
while x1 != x2 or y1 != y2:
	cnt += 1
	cx = ''
	cy = ''
	if x1 > x2:
		x1 -= 1
		cx = 'L'
	elif x2 > x1:
		x1 += 1
		cx = 'R'
	if y1 > y2:
		y1 -= 1
		cy = 'D'
	elif y2 > y1:
		y1 += 1
		cy = 'U'
	d.append(cx + cy)
print(cnt)
for s in d:
	print(s)


Answer = []
(Origin, Destination) = (input(), input())
while Origin != Destination:
	if Origin[0] == Destination[0]:
		if Destination[1] > Origin[1]:
			Answer.append('U')
			Origin = Origin[0] + str(int(Origin[1]) + 1)
		else:
			Answer.append('D')
			Origin = Origin[0] + str(int(Origin[1]) - 1)
	elif Origin[1] == Destination[1]:
		if Destination[0] > Origin[0]:
			Answer.append('R')
			Origin = chr(ord(Origin[0]) + 1) + Origin[1]
		else:
			Answer.append('L')
			Origin = chr(ord(Origin[0]) - 1) + Origin[1]
	elif Destination[0] > Origin[0] and Destination[1] > Origin[1]:
		Answer.append('RU')
		Origin = chr(ord(Origin[0]) + 1) + str(int(Origin[1]) + 1)
	elif Destination[0] > Origin[0] and Destination[1] < Origin[1]:
		Answer.append('RD')
		Origin = chr(ord(Origin[0]) + 1) + str(int(Origin[1]) - 1)
	elif Destination[0] < Origin[0] and Destination[1] < Origin[1]:
		Answer.append('LD')
		Origin = chr(ord(Origin[0]) - 1) + str(int(Origin[1]) - 1)
	else:
		Answer.append('LU')
		Origin = chr(ord(Origin[0]) - 1) + str(int(Origin[1]) + 1)
print(len(Answer), *Answer, sep='\n')


s = list(map(ord, input()))
t = list(map(ord, input()))
ans = max(abs(s[0] - t[0]), abs(s[1] - t[1]))
print(ans)
while s != t:
	if s[0] - t[0] > 0 and s[1] - t[1] > 0:
		print('LD')
		(s[0], s[1]) = (s[0] - 1, s[1] - 1)
	elif s[0] - t[0] > 0 and s[1] - t[1] < 0:
		print('LU')
		(s[0], s[1]) = (s[0] - 1, s[1] + 1)
	elif s[0] - t[0] < 0 and s[1] - t[1] > 0:
		print('RD')
		(s[0], s[1]) = (s[0] + 1, s[1] - 1)
	elif s[0] - t[0] < 0 and s[1] - t[1] < 0:
		print('RU')
		(s[0], s[1]) = (s[0] + 1, s[1] + 1)
	elif s[0] - t[0] > 0:
		print('L')
		s[0] = s[0] - 1
	elif s[0] - t[0] < 0:
		print('R')
		s[0] = s[0] + 1
	elif s[1] - t[1] > 0:
		print('D')
		s[1] = s[1] - 1
	elif s[1] - t[1] < 0:
		print('U')
		s[1] = s[1] + 1


currPos = input()
targetPos = input()
step = []
currCol = currPos[0]
currRow = currPos[1]
while True:
	if ord(currCol) < ord(targetPos[0]) and ord(currRow) < ord(targetPos[1]):
		step.append('RU')
		currCol = chr(ord(currCol) + 1)
		currRow = chr(ord(currRow) + 1)
	elif ord(currCol) < ord(targetPos[0]) and ord(currRow) == ord(targetPos[1]):
		step.append('R')
		currCol = chr(ord(currCol) + 1)
	elif ord(currCol) < ord(targetPos[0]) and ord(currRow) > ord(targetPos[1]):
		step.append('RD')
		currCol = chr(ord(currCol) + 1)
		currRow = chr(ord(currRow) - 1)
	elif ord(currCol) == ord(targetPos[0]) and ord(currRow) > ord(targetPos[1]):
		step.append('D')
		currRow = chr(ord(currRow) - 1)
	elif ord(currCol) > ord(targetPos[0]) and ord(currRow) > ord(targetPos[1]):
		step.append('LD')
		currCol = chr(ord(currCol) - 1)
		currRow = chr(ord(currRow) - 1)
	elif ord(currCol) > ord(targetPos[0]) and ord(currRow) == ord(targetPos[1]):
		step.append('L')
		currCol = chr(ord(currCol) - 1)
	elif ord(currCol) > ord(targetPos[0]) and ord(currRow) < ord(targetPos[1]):
		step.append('LU')
		currCol = chr(ord(currCol) - 1)
		currRow = chr(ord(currRow) + 1)
	elif ord(currCol) == ord(targetPos[0]) and ord(currRow) < ord(targetPos[1]):
		step.append('U')
		currRow = chr(ord(currRow) + 1)
	if ord(currCol) == ord(targetPos[0]) and ord(currRow) == ord(targetPos[1]):
		break
print(len(step))
for element in step:
	print(element)


current = input()
target = input()
mx = -ord(current[0]) + ord(target[0])
my = -int(current[1]) + int(target[1])
moves_total = abs(mx) + abs(my) - min(abs(mx), abs(my))
print(moves_total)
while mx != 0 and my != 0:
	if mx > 0 and my > 0:
		print('RU')
		mx -= 1
		my -= 1
	elif mx < 0 and my < 0:
		print('LD')
		mx += 1
		my += 1
	elif mx > 0 and my < 0:
		print('RD')
		mx -= 1
		my += 1
	else:
		print('LU')
		mx += 1
		my -= 1
if mx > 0:
	while mx:
		print('R')
		mx -= 1
elif mx < 0:
	while mx:
		print('L')
		mx += 1
elif my > 0:
	while my:
		print('U')
		my -= 1
elif my < 0:
	while my:
		print('D')
		my += 1


(a, b) = (input(), input())
d = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
a = str(d[a[0]]) + a[1]
b = str(d[b[0]]) + b[1]
(r, u) = (int(b[0]) - int(a[0]), int(b[1]) - int(a[1]))
m = max(abs(r), abs(u))
print(m)
for _ in range(m):
	if r > 0:
		print('R', end='')
		r -= 1
	elif r < 0:
		print('L', end='')
		r += 1
	if u > 0:
		print('U', end='')
		u -= 1
	elif u < 0:
		print('D', end='')
		u += 1
	print()


s = input()
xs = ord(s[0]) - ord('a')
ys = int(s[1])
t = input()
xt = ord(t[0]) - ord('a')
yt = int(t[1])
ans = []
while xs < xt and ys < yt:
	ans.append('RU')
	xs += 1
	ys += 1
while xs > xt and ys < yt:
	ans.append('LU')
	xs -= 1
	ys += 1
while xs < xt and ys > yt:
	ans.append('RD')
	xs += 1
	ys -= 1
while xs > xt and ys > yt:
	ans.append('LD')
	xs -= 1
	ys -= 1
while xs < xt:
	ans.append('R')
	xs += 1
while xs > xt:
	ans.append('L')
	xs -= 1
while ys < yt:
	ans.append('U')
	ys += 1
while ys > yt:
	ans.append('D')
	ys -= 1
print(len(ans))
print(*ans, sep='\n')


s = list(input())
e = list(input())
horiz = ord(s[0]) - ord(e[0])
verti = int(s[1]) - int(e[1])
if horiz >= 0 and verti >= 0:
	if horiz >= verti:
		print(horiz)
		for i in range(verti):
			print('LD')
		for i in range(horiz - verti):
			print('L')
	else:
		print(verti)
		for i in range(horiz):
			print('LD')
		for i in range(verti - horiz):
			print('D')
elif horiz >= 0 and verti < 0:
	verti *= -1
	if horiz >= verti:
		print(horiz)
		for i in range(verti):
			print('LU')
		for i in range(horiz - verti):
			print('L')
	else:
		print(verti)
		for i in range(horiz):
			print('LU')
		for i in range(verti - horiz):
			print('U')
elif horiz < 0 and verti < 0:
	verti *= -1
	horiz *= -1
	if horiz >= verti:
		print(horiz)
		for i in range(verti):
			print('RU')
		for i in range(horiz - verti):
			print('R')
	else:
		print(verti)
		for i in range(horiz):
			print('RU')
		for i in range(verti - horiz):
			print('U')
elif horiz < 0 and verti >= 0:
	horiz *= -1
	if horiz >= verti:
		print(horiz)
		for i in range(verti):
			print('RD')
		for i in range(horiz - verti):
			print('R')
	else:
		print(verti)
		for i in range(horiz):
			print('RD')
		for i in range(verti - horiz):
			print('D')


ox = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}
inp1 = input()
inp2 = input()
(x1, x2, y1, y2) = (ox[inp1[0]], ox[inp2[0]], int(inp1[1]), int(inp2[1]))
rez = []
s = ''
while x1 != x2 and y1 != y2:
	if x1 > x2:
		s = 'L'
		x1 -= 1
	else:
		s = 'R'
		x1 += 1
	if y1 > y2:
		s += 'D'
		y1 -= 1
	else:
		s += 'U'
		y1 += 1
	rez.append(s)
	s = ''
while x1 != x2:
	if x1 > x2:
		s = 'L'
		x1 -= 1
	else:
		s = 'R'
		x1 += 1
	rez.append(s)
	s = ''
while y1 != y2:
	if y1 > y2:
		s += 'D'
		y1 -= 1
	else:
		s += 'U'
		y1 += 1
	rez.append(s)
	s = ''
print(len(rez))
[print(i) for i in rez]


import sys
import heapq
ORD_A = ord('a')
DIRECTIONS4 = {'L': (-1, 0), 'D': (0, 1), 'R': (1, 0), 'U': (0, -1)}
DIRECTIONS8 = dict(DIRECTIONS4)
DIRECTIONS8.update({'LD': (-1, 1), 'RD': (1, 1), 'RU': (1, -1), 'LU': (-1, -1)})

class Grid:

	def __init__(self, width, height, allow_diagonals=False):
		self.width = width
		self.height = height
		self.allow_diagonals = allow_diagonals

	def neighbors(self, node):
		results = []
		(x, y) = node
		directions = DIRECTIONS8 if self.allow_diagonals else DIRECTIONS4
		for (k, (dx, dy)) in directions.items():
			(nx, ny) = (x + dx, y + dy)
			if 0 <= nx < self.width and 0 <= ny < self.height:
				results.append(((nx, ny), k))
		return results

class PriorityQueue:

	def __init__(self):
		self.heap = []

	def empty(self):
		return len(self.heap) == 0

	def add(self, item, cost):
		heapq.heappush(self.heap, (cost, item))

	def pop(self):
		return heapq.heappop(self.heap)[1]

def reconstruct_path(came_from, start, goal):
	current = goal
	path = []
	moves = []
	while current != start:
		path.append(current)
		moves.append(came_from[current][1])
		current = came_from[current][0]
	path.append(start)
	path.reverse()
	moves.reverse()
	return (path, moves)

def diagonal_distance_h(goal, node, D, D2):
	dx = abs(goal[0] - node[0])
	dy = abs(goal[1] - node[1])
	return D * (dx + dy) + (D2 - 2 * D) * min(dx, dy)

def Chebyshev_distance_h(goal, node):
	return diagonal_distance_h(goal, node, 1, 1)

def greedy_best_first_search(grid, start, goal, costfn):
	frontier = PriorityQueue()
	frontier.add(start, 0)
	came_from = {}
	came_from[start] = None
	while not frontier.empty():
		current = frontier.pop()
		if current == goal:
			break
		for (child, move) in grid.neighbors(current):
			if child not in came_from:
				frontier.add(child, costfn(goal, child))
				came_from[child] = (current, move)
	return came_from

def convert_chess_coordinates(coord):
	return (ord(coord[0]) - ORD_A, 8 - int(coord[1]))

def main():
	start = convert_chess_coordinates(sys.stdin.readline().strip())
	goal = convert_chess_coordinates(sys.stdin.readline().strip())
	chess = Grid(8, 8, allow_diagonals=True)
	moves = reconstruct_path(greedy_best_first_search(chess, start, goal, Chebyshev_distance_h), start, goal)[1]
	sys.stdout.write(str(len(moves)) + '\n')
	sys.stdout.write('\n'.join(moves) + '\n')
main()


tmp = input()
(sx, sy) = (ord(tmp[0]) - 97, int(tmp[1]) - 1)
tmp = input()
(ex, ey) = (ord(tmp[0]) - 97, int(tmp[1]) - 1)
(dx, dy) = (ex - sx, ey - sy)
h = ['R' if dx > 0 else 'L'] * max(dx, -dx)
v = ['U' if dy > 0 else 'D'] * max(dy, -dy)
r = max(len(h), len(v))
print(r)
for i in range(r):
	s = ''
	if len(h) > 0:
		s += h.pop(0)
	if len(v) > 0:
		s += v.pop(0)
	print(s)


start = input()
target = input()
horizontal_movement = ord(start[0]) - ord(target[0])
vertical_movement = ord(start[1]) - ord(target[1])
print(max(horizontal_movement, -horizontal_movement, vertical_movement, -vertical_movement))
while horizontal_movement != 0 or vertical_movement != 0:
	move = ''
	if horizontal_movement > 0:
		move += 'L'
		horizontal_movement -= 1
	if horizontal_movement < 0:
		move += 'R'
		horizontal_movement += 1
	if vertical_movement > 0:
		move += 'D'
		vertical_movement -= 1
	if vertical_movement < 0:
		move += 'U'
		vertical_movement += 1
	print(move)


a = list(input())
b = list(input())
c = ['h', 'g', 'f', 'e', 'd', 'c', 'b', 'a']
a_h = c.index(a[0])
a_v = int(a[1])
b_h = c.index(b[0])
b_v = int(b[1])
p = [a_h - b_h, a_v - b_v]
d = [abs(p[0]), abs(p[1])]
total = max(d)
print(total)
while p[0] != 0 or p[1] != 0:
	if p[0] < 0 and p[1] < 0:
		print('LU')
		p[0] += 1
		p[1] += 1
	elif p[0] > 0 and p[1] < 0:
		print('RU')
		p[0] -= 1
		p[1] += 1
	elif p[0] < 0 and p[1] > 0:
		print('LD')
		p[0] += 1
		p[1] -= 1
	elif p[0] > 0 and p[1] > 0:
		print('RD')
		p[0] -= 1
		p[1] -= 1
	elif p[0] == 0 and p[1] < 0:
		print('U')
		p[1] += 1
	elif p[0] == 0 and p[1] > 0:
		print('D')
		p[1] -= 1
	elif p[0] < 0 and p[1] == 0:
		print('L')
		p[0] += 1
	elif p[0] > 0 and p[1] == 0:
		print('R')
		p[0] -= 1


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:
	if s[0] < t[0] and s[1] < t[1]:
		a.append('RU')
		s[0] += 1
		s[1] += 1
	elif s[0] < t[0] and s[1] > t[1]:
		a.append('RD')
		s[0] += 1
		s[1] -= 1
	elif s[0] > t[0] and s[1] < t[1]:
		a.append('LU')
		s[0] -= 1
		s[1] += 1
	elif s[0] > t[0] and s[1] > t[1]:
		a.append('LD')
		s[0] -= 1
		s[1] -= 1
	elif s[0] == t[0] and s[1] > t[1]:
		a.append('D')
		s[1] -= 1
	elif s[0] == t[0] and s[1] < t[1]:
		a.append('U')
		s[1] += 1
	elif s[0] > t[0] and s[1] == t[1]:
		a.append('L')
		s[0] -= 1
	elif s[0] < t[0] and s[1] == t[1]:
		a.append('R')
		s[0] += 1
print(len(a))
for s in a:
	print(s)


from collections import deque
import sys
s = sys.stdin.readline().strip()
s = [int(s[1]), ord(s[0]) - 96]
t = sys.stdin.readline().strip()
t = [int(t[1]), ord(t[0]) - 96]
moves_names = ['L', 'R', 'U', 'D', 'LU', 'LD', 'RU', 'RD']
moves = [[0, -1], [0, 1], [-1, 0], [1, 0], [-1, -1], [1, -1], [-1, 1], [1, 1]]
y_diff = s[0] - t[0]
x_diff = s[1] - t[1]
print(max(abs(y_diff), abs(x_diff)))
while y_diff != 0 or x_diff != 0:
	y_move = 0
	if y_diff > 0:
		y_move = 1
	elif y_diff < 0:
		y_move = -1
	x_move = 0
	if x_diff > 0:
		x_move = 1
	elif x_diff < 0:
		x_move = -1
	move_i = moves.index([y_move, -x_move])
	print(moves_names[move_i])
	y_diff -= y_move
	x_diff -= x_move


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

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

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

def I():
	return int(stdin.readline())
P = 1000000007

def main():
	s1 = input()
	s2 = input()
	(x, y) = (ord(s1[0]) - ord(s2[0]), int(s1[1]) - int(s2[1]))
	mx = max(x, y, -x, -y)
	print(mx)
	while x != 0 or y != 0:
		r = ''
		if x > 0:
			r = 'L'
			x -= 1
		if x < 0:
			r = 'R'
			x += 1
		if y > 0:
			r += 'D'
			y -= 1
		if y < 0:
			r += 'U'
			y += 1
		print(r)
main()


def dig(s):
	return [ord(s[0]) - 96, int(s[1])]
(b, a) = dig(input())
(d, c) = 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))


n = input()
m = input()
x0 = ord(n[0])
y0 = ord(n[1])
x1 = ord(m[0])
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


a = input()
b = input()
c = int(a[-1])
d = int(b[-1])
a = a[0]
b = b[0]
k = abs(c - d)
o = abs(ord(b) - ord(a))
mi = min(k, o)
print(k + o - mi)
if a >= b and c >= d:
	for i in range(mi):
		print('LD')
	for i in range(k - mi):
		print('D')
	for i in range(o - mi):
		print('L')
elif a >= b and c < d:
	for i in range(mi):
		print('LU')
	for i in range(k - mi):
		print('U')
	for i in range(o - mi):
		print('L')
elif a < b and c <= d:
	for i in range(mi):
		print('RU')
	for i in range(k - mi):
		print('U')
	for i in range(o - mi):
		print('R')
elif a <= b and c >= d:
	for i in range(mi):
		print('RD')
	for i in range(k - mi):
		print('D')
	for i in range(o - mi):
		print('R')


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 = str(input())
s1 = s[:1]
b = int(s[1:])
if s1 == 'h':
	a = 8
if s1 == 'g':
	a = 7
if s1 == 'f':
	a = 6
if s1 == 'e':
	a = 5
if s1 == 'd':
	a = 4
if s1 == 'c':
	a = 3
if s1 == 'b':
	a = 2
if s1 == 'a':
	a = 1
t = str(input())
t1 = t[:1]
b1 = int(t[1:])
if t1 == 'h':
	a1 = 8
if t1 == 'g':
	a1 = 7
if t1 == 'f':
	a1 = 6
if t1 == 'e':
	a1 = 5
if t1 == 'd':
	a1 = 4
if t1 == 'c':
	a1 = 3
if t1 == 'b':
	a1 = 2
if t1 == 'a':
	a1 = 1

def countthemerges(a, b, a1, b1):
	q = 0
	c = True
	while c:
		if a < a1 and b > b1:
			a = a + 1
			b = b - 1
			q += 1
		if a > a1 and b > b1:
			a = a - 1
			b = b - 1
			q += 1
		if a < a1 and b < b1:
			a = a + 1
			b = b + 1
			q += 1
		if a > a1 and b < b1:
			a = a - 1
			b = b + 1
			q += 1
		if a == a1 and b > b1:
			b = b - 1
			q += 1
		if a == a1 and b < b1:
			b = b + 1
			q += 1
		if b == b1 and a1 > a:
			a = a + 1
			q += 1
		if b == b1 and a > a1:
			a = a - 1
			q += 1
		if a == a1 and b1 == b:
			return q

def printthePosibitities(a, b, a1, b1):
	c = True
	while c:
		if a < a1 and b > b1:
			print('RD')
			a = a + 1
			b = b - 1
		if a > a1 and b > b1:
			print('LD')
			a = a - 1
			b = b - 1
		if a < a1 and b < b1:
			print('RU')
			a = a + 1
			b = b + 1
		if a > a1 and b < b1:
			print('LU')
			a = a - 1
			b = b + 1
		if a == a1 and b > b1:
			print('D')
			b = b - 1
		if a == a1 and b < b1:
			print('U')
			b = b + 1
		if b == b1 and a1 > a:
			print('R')
			a = a + 1
		if b == b1 and a > a1:
			print('L')
			a = a - 1
		if a == a1 and b1 == b:
			c = False
print(countthemerges(a, b, a1, b1))
printthePosibitities(a, b, a1, b1)


import sys
import io
import os
total = 0
failed = 0

def debug(*args):
	if 'LOCALTEST' in os.environ:
		print(*args, file=sys.stderr)

def run(test, res):
	x = io.StringIO()
	with io.StringIO(test) as sys.stdin:
		with x as sys.stdout:
			work()
			z = x.getvalue().strip()
	sys.stdout = sys.__stdout__
	print('Passed?', z == res)
	print('Expected: ', res)
	print('Actual  : ', z)
	global total, failed
	total += 1
	failed += 1 if z != res else 0

def work():
	s = input()
	t = input()
	dx = ord(s[0]) - ord(t[0])
	dy = int(s[1]) - int(t[1])
	debug(dx, dy)
	res = []
	for i in range(min(abs(dx), abs(dy))):
		res.append(('L' if dx > 0 else 'R') + ('D' if dy > 0 else 'U'))
	for i in range(abs(abs(dx) - abs(dy))):
		if abs(dx) > abs(dy):
			res.append('L' if dx > 0 else 'R')
		else:
			res.append('D' if dy > 0 else 'U')
	print(len(res))
	for i in res:
		print(i)

def test():
	run('a8\nh1', '7\nRD\nRD\nRD\nRD\nRD\nRD\nRD')
	run('a1\nh1', '7\nR\nR\nR\nR\nR\nR\nR')
if 'LOCALTEST' in os.environ:
	test()
	print('\n Result: %s (%d total, %d failed)' % ('FAILED' if failed > 0 else 'PASSED', total, failed))
else:
	work()


start = str(input())
end = str(input())
x = ord(start[0]) - ord(end[0])
y = int(start[1]) - int(end[1])
print(max(x, y, -x, -y))
while x != 0 or y != 0:
	str = ''
	if x < 0:
		str += 'R'
		x += 1
	if x > 0:
		str += 'L'
		x -= 1
	if y < 0:
		str += 'U'
		y += 1
	if y > 0:
		str += 'D'
		y -= 1
	print(str)


(start_column, start_row) = input()
(end_column, end_row) = input()
horizontal = ord(end_column) - ord(start_column)
distance_hor = abs(horizontal)
letters_horizontal = '{:<7}'.format('L' * distance_hor if horizontal < 0 else 'R' * distance_hor)
vertical = int(end_row) - int(start_row)
distance_ver = abs(vertical)
letters_vertical = '{:<7}'.format('D' * distance_ver if vertical < 0 else 'U' * distance_ver)
number_of_moves = max(distance_ver, distance_hor)
print(number_of_moves)
for index in range(number_of_moves):
	print((letters_horizontal[index] + letters_vertical[index]).strip())


def main():
	a = [input() for _ in range(2)]
	cols = [ord(a[x][0]) - ord('a') for x in range(2)]
	rows = [int(a[x][1]) for x in range(2)]
	if cols[0] < cols[1]:
		col_moves = 'R' * (cols[1] - cols[0])
	else:
		col_moves = 'L' * (cols[0] - cols[1])
	if rows[0] < rows[1]:
		row_moves = 'U' * (rows[1] - rows[0])
	else:
		row_moves = 'D' * (rows[0] - rows[1])
	a = max(len(col_moves), len(row_moves))
	print(a)
	b = min(len(col_moves), len(row_moves))
	for i in range(a):
		if i < b:
			print(col_moves[i] + row_moves[i])
		elif i < len(col_moves):
			print(col_moves[i])
		else:
			print(row_moves[i])
main()


import string
s1 = input()
s2 = input()
xdiff = string.ascii_lowercase.index(s2[0]) - string.ascii_lowercase.index(s1[0])
ydiff = int(s2[1]) - int(s1[1])
anslst = []
while xdiff != 0 or ydiff != 0:
	tmp = ''
	if xdiff > 0:
		tmp += 'R'
		xdiff -= 1
	elif xdiff < 0:
		tmp += 'L'
		xdiff += 1
	if ydiff > 0:
		tmp += 'U'
		ydiff -= 1
	elif ydiff < 0:
		tmp += 'D'
		ydiff += 1
	anslst.append(tmp)
print(len(anslst))
for a in anslst:
	print(a)


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 - x2) < abs(y1 - y2):
	p = my
for i in range(0, d - e):
	print(p)


s = input()
e = input()
m1 = m2 = u = l = st = ''
if int(s[1]) < int(e[1]):
	m2 = 'U'
else:
	m2 = 'D'
u = abs(int(s[1]) - int(e[1]))
if ord(s[0]) < ord(e[0]):
	m1 = 'R'
else:
	m1 = 'L'
l = abs(ord(s[0]) - ord(e[0]))
ul = min(u, l)
move = l + u - ul
print(move)
if ul != 0:
	for i in range(ul):
		print(m1 + m2)
	if l > u:
		for j in range(l - u):
			print(m1)
	else:
		for j in range(u - l):
			print(m2)
else:
	if l != 0:
		st = m1
	else:
		st = m2
	for i in range(max(l, u)):
		print(st)


a = input()
b = input()

def check(a, b, k=0):
	if a[0] == b[0]:
		x = abs(int(a[1]) - int(b[1]))
		if k == 0:
			print(x)
		if int(a[1]) > int(b[1]):
			for i in range(x):
				print('D')
			return
		else:
			for i in range(x):
				print('U')
			return
	elif a[1] == b[1]:
		x = abs(ord(a[0]) - ord(b[0]))
		if k == 0:
			print(x)
		if ord(a[0]) > ord(b[0]):
			for i in range(x):
				print('L')
			return
		else:
			for i in range(x):
				print('R')
			return
	else:
		(x1, y1) = (ord(a[0]) - ord(b[0]), int(a[1]) - int(b[1]))
		(x, y) = (abs(ord(a[0]) - ord(b[0])), abs(int(a[1]) - int(b[1])))
		if x1 == y1:
			if k == 0:
				print(x)
			if x1 > 0:
				for i in range(x1):
					print('LD')
			else:
				for i in range(x):
					print('RU')
			return
		elif x == y:
			if k == 0:
				print(x)
			if x1 > 0:
				for i in range(x1):
					print('LU')
			else:
				for i in range(x):
					print('RD')
				return
		else:
			print(max(x, y))
			if y < x:
				m = x - y
				if x1 < 0:
					for i in range(m):
						print('R')
					y1 = chr(ord(a[0]) + m)
					b1 = y1 + a[1]
					check(b1, b, 1)
				else:
					for i in range(m):
						print('L')
					y1 = chr(ord(a[0]) - m)
					b1 = y1 + a[1]
					check(b1, b, 1)
				return
			else:
				m = y - x
				if y1 > 0:
					for i in range(m):
						print('D')
					y1 = int(a[1]) - m
					b1 = a[0] + str(y1)
					check(b1, b, 1)
				else:
					for i in range(m):
						print('U')
					y1 = int(a[1]) + m
					b1 = a[0] + str(y1)
					check(b1, b, 1)
				return
check(a, b, 0)


import math, string, itertools, fractions, heapq, collections, re, array, bisect
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict

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

def main_input(info=0):
	(s, x) = [ord(i) for i in input()]
	(t, y) = [ord(i) for i in input()]
	m1 = abs(s - t)
	m2 = abs(x - y)
	m = min(m1, m2)
	print(max(m1, m2))
	for i in range(max(m1, m2)):
		if s > t and x > y:
			print('LD')
			s -= 1
			x -= 1
		elif s > t and x < y:
			print('LU')
			s -= 1
			x += 1
		elif s > t and x == y:
			print('L')
			s -= 1
		elif s < t and x > y:
			print('RD')
			s += 1
			x -= 1
		elif s < t and x < y:
			print('RU')
			s += 1
			x += 1
		elif s < t and x == y:
			print('R')
			s += 1
		elif s == t and x < y:
			print('U')
			x += 1
		elif s == t and x > y:
			print('D')
			x -= 1
main_input()


num1 = input()
num2 = input()
(tot1, tot2) = (ord(num1[i]) - ord(num2[i]) for i in range(0, 2))
print(max(tot1, -tot1, tot2, -tot2))
while tot1 != 0 or tot2 != 0:
	final = ''
	if tot1 < 0:
		final = 'R'
		tot1 += 1
	if tot1 > 0:
		final = 'L'
		tot1 -= 1
	if tot2 < 0:
		final += 'U'
		tot2 += 1
	if tot2 > 0:
		final += 'D'
		tot2 -= 1
	print(final)


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

def calculateMoves(s, t):
	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])
	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 xflag:
			move = move + xmove
		if yflag:
			move = move + ymove
		if not xflag and (not yflag):
			break
		else:
			moves.append(move)
	print(len(moves))
	for i in moves:
		print(i)
	return
calculateMoves(s, t)


s = input()
t = input()
end = crr = []
crr = (ord(s[0]) - 96, int(s[1]))
end = (ord(t[0]) - 96, int(t[1]))
a = crr[0] - end[0]
b = crr[1] - end[1]
print(max(a, -a, b, -b))
while a or b != 0:
	p = ''
	if a < 0:
		p = 'R'
		a += 1
	if a > 0:
		p = 'L'
		a -= 1
	if b < 0:
		p += 'U'
		b += 1
	if b > 0:
		p += 'D'
		b -= 1
	print(p)


b = ['o', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
s = input()
s1 = b.index(s[0])
s2 = int(s[1])
e = input()
e1 = b.index(e[0])
e2 = int(e[1])
m = max(abs(s1 - e1), abs(s2 - e2))
print(m)
while s1 != e1 or s2 != e2:
	ss = ''
	if s1 != e1:
		if s1 < e1:
			ss += 'R'
		else:
			ss += 'L'
		s1 -= (s1 - e1) // abs(s1 - e1)
	if s2 != e2:
		if s2 > e2:
			ss += 'D'
		else:
			ss += 'U'
		s2 -= (s2 - e2) // abs(s2 - e2)
	print(ss)


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

def tot():
	s = input()
	return (ord(s[0]) - ord('a') + 1, int(s[1]))
(x0, y0) = tot()
(x1, y1) = tot()
print(max(abs(x1 - x0), abs(y1 - y0)))
while x0 != x1 or y0 != y1:
	if x1 > x0 and y1 > y0:
		x0 += 1
		y0 += 1
		print('RU')
	elif x1 < x0 and y1 > y0:
		x0 -= 1
		y0 += 1
		print('LU')
	elif x1 < x0 and y1 < y0:
		x0 -= 1
		y0 -= 1
		print('LD')
	elif x1 > x0 and y1 < y0:
		x0 += 1
		y0 -= 1
		print('RD')
	elif x1 > x0:
		x0 += 1
		print('R')
	elif x1 < x0:
		x0 -= 1
		print('L')
	elif y1 > y0:
		y0 += 1
		print('U')
	else:
		y0 -= 1
		print('D')


import math
line1 = input()
line2 = input()
row_numeral1 = ord(line1[0])
row_numeral2 = ord(line2[0])
column_numeral1 = ord(line1[1])
column_numeral2 = ord(line2[1])
row_diff = row_numeral2 - row_numeral1
column_diff = column_numeral2 - column_numeral1
total_steps = abs(row_diff) if abs(row_diff) > abs(column_diff) else abs(column_diff)
print(total_steps)
row_print_character = 'R' if row_diff > 0 else 'L'
column_print_character = 'U' if column_diff > 0 else 'D'
row_prints = abs(row_diff)
column_prints = abs(column_diff)
for i in range(total_steps):
	if row_prints > 0:
		print(row_print_character, end='')
		row_prints -= 1
	if column_prints > 0:
		print(column_print_character, end='')
		column_prints -= 1
	print('')


def main():
	(x, y) = (ord(b) - ord(a) for (a, b) in zip(input(), input()))
	res = []
	while x or y:
		if y > 0:
			res.append('U')
			y -= 1
		elif y < 0:
			res.append('D')
			y += 1
		if x > 0:
			res.append('R')
			x -= 1
		elif x < 0:
			res.append('L')
			x += 1
		res.append('\n')
	res.append(str(res.count('\n')))
	print(''.join(reversed(res)))
main()


s = input()
d = input()
x = ord(s[0]) - ord(d[0])
y = int(s[1]) - int(d[1])
m = max(x, -x, y, -y)
l = []
while x != 0 or y != 0:
	r = ''
	if x > 0:
		r = r + 'L'
		x -= 1
	if x < 0:
		r = r + 'R'
		x += 1
	if y > 0:
		r = r + 'D'
		y -= 1
	if y < 0:
		r = r + 'U'
		y += 1
	l.append(r)
print(m)
for i in l:
	print(i)


starting = list(input().lower())
end_up = list(input())
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')
	elif 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)


def navigate(king, target, count, answer):
	if king == target:
		return count
	move = ''
	if king[0] > target[0]:
		king[0] = chr(ord(king[0]) - 1)
		move += 'L'
	elif king[0] < target[0]:
		king[0] = chr(ord(king[0]) + 1)
		move += 'R'
	if king[1] > target[1]:
		king[1] = chr(ord(king[1]) - 1)
		move += 'D'
	elif king[1] < target[1]:
		king[1] = chr(ord(king[1]) + 1)
		move += 'U'
	answer.append(move)
	return navigate(king, target, count + 1, answer)
king = [_ for _ in input()]
target = [_ for _ in input()]
count = 0
answer = []
print(navigate(king, target, count, answer))
print(*answer, sep='\n')


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


fr = input()
to = input()
fr = [ord(fr[0]) - ord('a') + 1, int(fr[1])]
to = [ord(to[0]) - ord('a') + 1, int(to[1])]
print(max(abs(fr[0] - to[0]), abs(fr[1] - to[1])))
while fr[0] > to[0] and fr[1] > to[1]:
	print('LD')
	fr[0] -= 1
	fr[1] -= 1
while fr[0] < to[0] and fr[1] > to[1]:
	print('RD')
	fr[0] += 1
	fr[1] -= 1
while fr[0] > to[0] and fr[1] < to[1]:
	print('LU')
	fr[0] -= 1
	fr[1] += 1
while fr[0] < to[0] and fr[1] < to[1]:
	print('RU')
	fr[0] += 1
	fr[1] += 1
while fr[0] > to[0] and fr[1] == to[1]:
	print('L')
	fr[0] -= 1
while fr[0] < to[0] and fr[1] == to[1]:
	print('R')
	fr[0] += 1
while fr[0] == to[0] and fr[1] < to[1]:
	print('U')
	fr[1] += 1
while fr[0] == to[0] and fr[1] > to[1]:
	print('D')
	fr[1] -= 1


s = input()
x0 = ord(s[0]) - 96
y0 = int(s[1])
t = input()
x = ord(t[0]) - 96
y = int(t[1])
n = 0
step = ['', '', '', '', '', '', '', '']
while not (x == x0 and y == y0):
	n = n + 1
	if x > x0:
		x0 = x0 + 1
		step[n] = step[n] + 'R'
	elif x < x0:
		x0 = x0 - 1
		step[n] = step[n] + 'L'
	if y > y0:
		y0 = y0 + 1
		step[n] = step[n] + 'U'
	elif y < y0:
		y0 = y0 - 1
		step[n] = step[n] + 'D'
print(n)
for i in range(1, n + 1):
	print(step[i])


def judge(s, t):
	sx = s[0]
	sy = s[1]
	tx = t[0]
	ty = t[1]
	if sx == tx and sy == ty:
		return 'end'
	if tx > sx and ty > sy:
		s[0] += 1
		s[1] += 1
		return 'RU'
	if tx > sx and ty < sy:
		s[0] += 1
		s[1] -= 1
		return 'RD'
	if tx < sx and ty > sy:
		s[0] -= 1
		s[1] += 1
		return 'LU'
	if tx < sx and ty < sy:
		s[0] -= 1
		s[1] -= 1
		return 'LD'
	if tx == sx and ty < sy:
		s[1] -= 1
		return 'D'
	if tx == sx and ty > sy:
		s[1] += 1
		return 'U'
	if tx < sx and ty == sy:
		s[0] -= 1
		return 'L'
	if tx > sx and ty == sy:
		s[0] += 1
		return 'R'
s = input()
t = input()
s = [s[0], s[1]]
t = [t[0], t[1]]
s[0] = ord(s[0]) - ord('a') + 1
s[1] = int(s[1])
t[0] = ord(t[0]) - ord('a') + 1
t[1] = int(t[1])
cnt = 0
ans = []
move = judge(s, t)
while move != 'end':
	ans.append(move)
	cnt += 1
	move = judge(s, t)
print(cnt)
for i in ans:
	print(i)


def main():
	(x, y) = (ord(b) - ord(a) for (a, b) in zip(input(), input()))
	print(max(abs(x), abs(y)))
	while x or y:
		if x > 0:
			h = 'R'
			x -= 1
		elif x < 0:
			h = 'L'
			x += 1
		else:
			h = ''
		if y > 0:
			v = 'U'
			y -= 1
		elif y < 0:
			v = 'D'
			y += 1
		else:
			v = ''
		print(''.join((h, v)))
main()


s1 = input()
s2 = input()
print(max(abs(ord(s1[0]) - ord(s2[0])), abs(int(ord(s1[1]) - ord(s2[1])))))
s1 = list(s1)
s2 = list(s2)
while s1 != s2:
	if s1[0] < s2[0]:
		print('R', end='')
		s1[0] = chr(ord(s1[0]) + 1)
	elif s1[0] > s2[0]:
		s1[0] = chr(ord(s1[0]) - 1)
		print('L', end='')
	if s1[1] > s2[1]:
		s1[1] = chr(ord(s1[1]) - 1)
		print('D', end='')
	elif s1[1] < s2[1]:
		s1[1] = chr(ord(s1[1]) + 1)
		print('U', end='')
	print('')


src = input()
dst = input()
xpos = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
xposinv = {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h'}
direction = []
count = 0
xsrc = src[0]
ysrc = src[1]
xdst = dst[0]
ydst = dst[1]
while xpos[xsrc] * 10 + int(ysrc) != xpos[xdst] * 10 + int(ydst):
	xsrc = src[0]
	ysrc = src[1]
	xdst = dst[0]
	ydst = dst[1]
	if xpos[xsrc] < xpos[xdst] and ysrc < ydst:
		direction.append('RU')
		src = xposinv[xpos[xsrc] + 1] + str(int(ysrc) + 1)
		count += 1
	elif xpos[xsrc] < xpos[xdst] and ysrc > ydst:
		direction.append('RD')
		src = xposinv[xpos[xsrc] + 1] + str(int(ysrc) - 1)
		count += 1
	elif xpos[xsrc] > xpos[xdst] and ysrc < ydst:
		direction.append('LU')
		src = xposinv[xpos[xsrc] - 1] + str(int(ysrc) + 1)
		count += 1
	elif xpos[xsrc] > xpos[xdst] and ysrc > ydst:
		direction.append('LD')
		src = xposinv[xpos[xsrc] - 1] + str(int(ysrc) - 1)
		count += 1
	elif xpos[xsrc] > xpos[xdst]:
		direction.append('L')
		src = xposinv[xpos[xsrc] - 1] + ysrc
		count += 1
	elif xpos[xsrc] < xpos[xdst]:
		direction.append('R')
		src = xposinv[xpos[xsrc] + 1] + ysrc
		count += 1
	elif ysrc < ydst:
		direction.append('U')
		src = xposinv[xpos[xsrc]] + str(int(ysrc) + 1)
		count += 1
	elif ysrc > ydst:
		direction.append('D')
		src = xposinv[xpos[xsrc]] + str(int(ysrc) - 1)
		count += 1
print(len(direction))
for tmp in direction:
	print(tmp)


sta = input()
end = input()
(scol, srow) = (ord(sta[0]), int(sta[1]))
(ecol, erow) = (ord(end[0]), int(end[1]))
dcol = ecol - scol
drow = erow - srow
n = max(abs(dcol), abs(drow))
m = min(abs(dcol), abs(drow))
print(n)

def move1():
	if dcol < 0 and drow < 0:
		return 'LD'
	if dcol < 0 and drow > 0:
		return 'LU'
	if dcol > 0 and drow < 0:
		return 'RD'
	if dcol > 0 and drow > 0:
		return 'RU'

def move2():
	if dcol <= 0 and drow <= 0:
		if n == abs(dcol):
			return 'L'
		else:
			return 'D'
	if dcol <= 0 and drow >= 0:
		if n == abs(dcol):
			return 'L'
		else:
			return 'U'
	if dcol >= 0 and drow <= 0:
		if n == abs(dcol):
			return 'R'
		else:
			return 'D'
	if dcol >= 0 and drow >= 0:
		if n == abs(dcol):
			return 'R'
		else:
			return 'U'
for i in range(m):
	print(move1())
if abs(dcol) != abs(drow):
	for i in range(n - m):
		print(move2())


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()
level = ord(t[0]) - ord(s[0])
vertical = int(t[1]) - int(s[1])
steps = max(abs(vertical), abs(level))
print(steps)
while level or vertical:
	step = ''
	if level > 0:
		level -= 1
		step += 'R'
	if level < 0:
		level += 1
		step += 'L'
	if vertical > 0:
		vertical -= 1
		step += 'U'
	if vertical < 0:
		vertical += 1
		step += 'D'
	print(step)


ax = input()
bx = input()
res = []
if ax == bx:
	print(0)
	print('')
	exit(0)
ay = int(ax[1:])
ax = ax[:1]
by = int(bx[1:])
bx = bx[:1]
dx = ord(bx) - ord(ax)
dy = by - ay
if dx <= 0 and dy <= 0:
	for i in range(min(abs(dx), abs(dy))):
		res.append('LD')
	if abs(dx) < abs(dy):
		for i in range(abs(dy) - abs(dx)):
			res.append('D')
	if abs(dy) < abs(dx):
		for i in range(abs(dx) - abs(dy)):
			res.append('L')
elif dx >= 0 and dy <= 0:
	for i in range(min(abs(dx), abs(dy))):
		res.append('RD')
	if abs(dx) < abs(dy):
		for i in range(abs(dy) - abs(dx)):
			res.append('D')
	if abs(dy) < abs(dx):
		for i in range(abs(dx) - abs(dy)):
			res.append('R')
elif dx <= 0 and dy >= 0:
	for i in range(min(abs(dx), abs(dy))):
		res.append('LU')
	if abs(dx) < abs(dy):
		for i in range(abs(dy) - abs(dx)):
			res.append('U')
	if abs(dy) < abs(dx):
		for i in range(abs(dx) - abs(dy)):
			res.append('L')
else:
	for i in range(min(abs(dx), abs(dy))):
		res.append('RU')
	if abs(dx) < abs(dy):
		for i in range(abs(dy) - abs(dx)):
			res.append('U')
	if abs(dy) < abs(dx):
		for i in range(abs(dx) - abs(dy)):
			res.append('R')
print(max(abs(dx), abs(dy)))
for i in res:
	print(i)


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


start = input()
goal = input()
x = ord(goal[0]) - ord(start[0])
y = int(goal[1]) - int(start[1])
print(max(abs(x), abs(y)))
while x != 0 or y != 0:
	direction = ''
	if x > 0:
		direction = 'R'
		x -= 1
	if x < 0:
		direction = 'L'
		x += 1
	if y > 0:
		direction += 'U'
		y -= 1
	if y < 0:
		direction += 'D'
		y += 1
	print(direction)


o = input()
o = [o[0], int(o[1])]
p = input()
p = [p[0], int(p[1])]
l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
a2 = []
k = 0
for i in range(7):
	a = abs(l.index(o[0]) - l.index(p[0]))
	b = abs(o[1] - p[1])
	if a > 0 or b > 0:
		m1 = m2 = ''
		if l.index(o[0]) > l.index(p[0]):
			m1 = 'L'
			if o[1] < p[1]:
				m2 = 'U'
				o[1] += 1
			elif o[1] > p[1]:
				m2 = 'D'
				o[1] -= 1
			o[0] = l[l.index(o[0]) - 1]
			a2.append(m1 + m2)
			k += 1
		elif l.index(o[0]) < l.index(p[0]):
			m1 = 'R'
			if o[1] < p[1]:
				m2 = 'U'
				o[1] += 1
			elif o[1] > p[1]:
				m2 = 'D'
				o[1] -= 1
			a2.append(m1 + m2)
			o[0] = l[l.index(o[0]) + 1]
			k += 1
		elif l.index(o[0]) == l.index(p[0]):
			if o[1] < p[1]:
				m2 = 'U'
				o[1] += 1
			elif o[1] > p[1]:
				m2 = 'D'
				o[1] -= 1
			a2.append(m1 + m2)
			k += 1
print(k)
for g in a2:
	print(g)


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


a = input()
b = input()
(h, v) = (ord(a[0]) - ord(b[0]), ord(a[1]) - ord(b[1]))
print(max(v, -v, h, -h))
while v != 0 or h != 0:
	r = ''
	if h > 0:
		r = 'L'
		h -= 1
	if h < 0:
		r = 'R'
		h += 1
	if v < 0:
		r += 'U'
		v += 1
	if v > 0:
		r += 'D'
		v -= 1
	print(r)


l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
n = ['1', '2', '3', '4', '5', '6', '7', '8']
m = [['LU', 'U', 'RU'], ['L', '  ', 'R'], ['LD', 'D', 'RD']]
a = input()
b = input()
a = [l.index(a[0]), n.index(a[1])]
b = [l.index(b[0]), n.index(b[1])]
k = 0
s = ''
while a != b:
	x = y = 1
	if a[0] > b[0]:
		x = 0
	elif a[0] < b[0]:
		x = 2
	if a[1] > b[1]:
		y = 0
	elif a[1] < b[1]:
		y = 2
	a[0] += x - 1
	a[1] += y - 1
	k += 1
	s += m[2 - y][x] + '\n'
print(k)
print(s)


dictionary = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
s = input()
t = input()
sx = dictionary[s[0]]
sy = int(s[1])
tx = dictionary[t[0]]
ty = int(t[1])
n = max(abs(sx - tx), abs(sy - ty))
print(n)
d = min(abs(sx - tx), abs(sy - ty))
step = ''
if sx > tx:
	step += 'L'
else:
	step += 'R'
if sy > ty:
	step += 'D'
else:
	step += 'U'
for i in range(d):
	print(step)
step = ''
if abs(sx - tx) > abs(sy - ty):
	if sx > tx:
		step += 'L'
	else:
		step += 'R'
elif sy > ty:
	step += 'D'
else:
	step += 'U'
for i in range(n - d):
	print(step)


cell1 = input()
cell2 = input()
h_dist = ord(cell2[0]) - ord(cell1[0])
v_dist = ord(cell2[1]) - ord(cell1[1])
print(max(abs(h_dist), abs(v_dist)))
diag = ('R', 'L')[h_dist < 0] + ('U', 'D')[v_dist < 0] + '\n'
if abs(h_dist) >= abs(v_dist):
	print(diag * abs(v_dist), end='')
	h = ('R', 'L')[h_dist < 0] + '\n'
	print(h * (abs(h_dist) - abs(v_dist)), end='')
else:
	print(diag * abs(h_dist), end='')
	v = ('U', 'D')[v_dist < 0] + '\n'
	print(v * (abs(v_dist) - abs(h_dist)), end='')


s = str(input())
f = str(input())
if s[0] == 'a':
	s1 = 0
elif s[0] == 'b':
	s1 = 1
elif s[0] == 'c':
	s1 = 2
elif s[0] == 'd':
	s1 = 3
elif s[0] == 'e':
	s1 = 4
elif s[0] == 'f':
	s1 = 5
elif s[0] == 'g':
	s1 = 6
elif s[0] == 'h':
	s1 = 7
s2 = int(s[1])
if f[0] == 'a':
	f1 = 0
elif f[0] == 'b':
	f1 = 1
elif f[0] == 'c':
	f1 = 2
elif f[0] == 'd':
	f1 = 3
elif f[0] == 'e':
	f1 = 4
elif f[0] == 'f':
	f1 = 5
elif f[0] == 'g':
	f1 = 6
elif f[0] == 'h':
	f1 = 7
f2 = int(f[1])
ans = 0
if abs(f1 - s1) > ans:
	ans = abs(f1 - s1)
if abs(f2 - s2) > ans:
	ans = abs(f2 - s2)
print(ans)
while abs(f1 - s1) + abs(f2 - s2) > 0:
	if f1 > s1:
		dir = 'R'
		s1 += 1
	elif f1 < s1:
		dir = 'L'
		s1 -= 1
	else:
		dir = ''
	if f2 > s2:
		dir = dir + 'U'
		s2 += 1
	elif f2 < s2:
		s2 -= 1
		dir = dir + 'D'
	print(dir)


def main():
	(m, n) = (input(), input())
	(x1, y1, x2, y2, a) = (m[0], int(m[1]), n[0], int(n[1]), [])
	if x1 == 'a':
		x1 = 1
	elif x1 == 'b':
		x1 = 2
	elif x1 == 'c':
		x1 = 3
	elif x1 == 'd':
		x1 = 4
	elif x1 == 'e':
		x1 = 5
	elif x1 == 'f':
		x1 = 6
	elif x1 == 'g':
		x1 = 7
	elif x1 == 'h':
		x1 = 8
	if x2 == 'a':
		x2 = 1
	elif x2 == 'b':
		x2 = 2
	elif x2 == 'c':
		x2 = 3
	elif x2 == 'd':
		x2 = 4
	elif x2 == 'e':
		x2 = 5
	elif x2 == 'f':
		x2 = 6
	elif x2 == 'g':
		x2 = 7
	elif x2 == 'h':
		x2 = 8
	while x2 - x1 > 0 and y2 - y1 > 0:
		x1 += 1
		y1 += 1
		a.append('RU')
	while x2 - x1 < 0 and y2 - y1 > 0:
		x1 -= 1
		y1 += 1
		a.append('LU')
	while x2 - x1 < 0 and y2 - y1 < 0:
		x1 -= 1
		y1 -= 1
		a.append('LD')
	while x2 - x1 > 0 and y2 - y1 < 0:
		x1 += 1
		y1 -= 1
		a.append('RD')
	while x2 - x1 > 0:
		x1 += 1
		a.append('R')
	while x2 - x1 < 0:
		x1 -= 1
		a.append('L')
	while y2 - y1 > 0:
		y1 += 1
		a.append('U')
	while y2 - y1 < 0:
		y1 -= 1
		a.append('D')
	print(len(a))
	for item in a:
		print(item)
main()


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

def left(x):
	for let in range(7):
		if notation[let + 1] == x:
			return notation[let]

def right(x):
	for let in range(7):
		if notation[let] == x:
			return notation[let + 1]

def u(x, y):
	return [x, y + 1]

def d(x, y):
	return [x, y - 1]

def l(x, y):
	return [left(x), y]

def r(x, y):
	return [right(x), y]

def lu(x, y):
	return [left(x), y + 1]

def ld(x, y):
	return [left(x), y - 1]

def ru(x, y):
	return [right(x), y + 1]

def rd(x, y):
	return [right(x), y - 1]

def sameColumn(a, b):
	if a[0] == b[0]:
		return True
	return False

def sameRow(a, b):
	if int(a[1]) == int(b[1]):
		return True
	return False

def lexDistance(a, b):
	(m, n) = (0, 0)
	for x in range(len(notation)):
		if notation[x] == a[0]:
			m = x
		elif notation[x] == b[0]:
			n = x
	return abs(m - n)
a = input()
b = input()
(a, b) = (' '.join(a).split(), ' '.join(b).split())
b[1] = int(b[1])
c = 0
moves = []
over = False
if a[0] == b[0] and int(a[1]) == int(b[1]):
	print(0)
elif sameColumn(a, b):
	print(abs(int(a[1]) - int(b[1])))
	if int(a[1]) < int(b[1]):
		while a != b:
			a = u(a[0], int(a[1]))
			moves.append('U')
			c += 1
			if a == b:
				for m in moves:
					print(m)
				over = True
				break
	else:
		while a != b:
			a = d(a[0], int(a[1]))
			moves.append('D')
			c += 1
			if a == b:
				for m in moves:
					print(m)
				over = True
				break
elif sameRow(a, b):
	print(lexDistance(a, b))
	if ord(a[0]) < ord(b[0]):
		while a != b:
			a = r(a[0], int(a[1]))
			moves.append('R')
			c += 1
			if a == b:
				for m in moves:
					print(m)
				over = True
				break
	else:
		while a != b:
			a = l(a[0], int(a[1]))
			moves.append('L')
			c += 1
			if a == b:
				for m in moves:
					print(m)
				over = True
				break
elif ord(a[0]) < ord(b[0]) and int(a[1]) < int(b[1]):
	while a[0] != b[0] and int(a[1]) != int(b[1]):
		a = ru(a[0], int(a[1]))
		moves.append('RU')
		c += 1
		if a == b:
			print(c)
			for m in moves:
				print(m)
			over = True
			break
	else:
		if not over:
			while int(a[1]) == int(b[1]):
				a = r(a[0], int(a[1]))
				moves.append('R')
				c += 1
				if a == b:
					print(c)
					for m in moves:
						print(m)
					over = True
					break
			else:
				if not over:
					while a[0] == b[0]:
						a = u(a[0], int(a[1]))
						moves.append('U')
						c += 1
						if a == b:
							print(c)
							for m in moves:
								print(m)
							over = True
							break
elif ord(a[0]) < ord(b[0]) and int(a[1]) > int(b[1]):
	while a[0] != b[0] and int(a[1]) != int(b[1]):
		a = rd(a[0], int(a[1]))
		moves.append('RD')
		c += 1
		if a == b:
			print(c)
			for m in moves:
				print(m)
			over = True
			break
	else:
		if not over:
			while int(a[1]) == int(b[1]):
				a = r(a[0], int(a[1]))
				moves.append('R')
				c += 1
				if a == b:
					print(c)
					for m in moves:
						print(m)
					over = True
					break
			else:
				if not over:
					while a[0] == b[0]:
						a = d(a[0], int(a[1]))
						moves.append('D')
						c += 1
						if a == b:
							print(c)
							for m in moves:
								print(m)
							over = True
							break
elif ord(a[0]) > ord(b[0]) and int(a[1]) > int(b[1]):
	while a[0] != b[0] and int(a[1]) != int(b[1]):
		a = ld(a[0], int(a[1]))
		moves.append('LD')
		c += 1
		if a == b:
			print(c)
			for m in moves:
				print(m)
			over = True
			break
	else:
		if not over:
			while int(a[1]) == int(b[1]):
				a = l(a[0], int(a[1]))
				moves.append('L')
				c += 1
				if a == b:
					print(c)
					for m in moves:
						print(m)
					over = True
					break
			else:
				if not over:
					while a[0] == b[0]:
						a = d(a[0], int(a[1]))
						moves.append('D')
						c += 1
						if a == b:
							print(c)
							for m in moves:
								print(m)
							over = True
							break
elif ord(a[0]) > ord(b[0]) and int(a[1]) < int(b[1]):
	while a[0] != b[0] and int(a[1]) != int(b[1]):
		a = lu(a[0], int(a[1]))
		moves.append('LU')
		c += 1
		if a == b:
			print(c)
			for m in moves:
				print(m)
			over = True
			break
	else:
		if not over:
			while int(a[1]) == int(b[1]):
				a = l(a[0], int(a[1]))
				moves.append('L')
				c += 1
				if a == b:
					print(c)
					for m in moves:
						print(m)
					over = True
					break
			else:
				if not over:
					while a[0] == b[0]:
						a = u(a[0], int(a[1]))
						moves.append('U')
						c += 1
						if a == b:
							print(c)
							for m in moves:
								print(m)
							over = True
							break


(p, q) = (input(), input())
n = 0
steps = []
(x1, y1, x2, y2) = (ord(p[0]), int(p[1]), ord(q[0]), int(q[1]))
while x1 != x2 or y1 != y2:
	n += 1
	s = ''
	if x1 < x2:
		s += 'R'
		x1 += 1
	if x1 > x2:
		s += 'L'
		x1 -= 1
	if y1 < y2:
		s += 'U'
		y1 += 1
	if y1 > y2:
		s += 'D'
		y1 -= 1
	steps.append(s)
print(n)
for j in steps:
	print(j)


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


def main():
	(start_c, start_r) = input()
	(end_c, end_r) = input()
	(start_r, end_r) = (int(start_r) - 1, int(end_r) - 1)
	a = ord('A')
	(start_c, end_c) = (ord(start_c) - a, ord(end_c) - a)
	(cdiff, rdiff) = (end_c - start_c, end_r - start_r)
	(cd, rd) = (abs(cdiff), abs(rdiff))
	(max_diff, min_diff) = (max(cd, rd), min(cd, rd))
	celm = 'R' if cdiff >= 0 else 'L'
	relm = 'U' if rdiff >= 0 else 'D'
	res = [celm] * max_diff if max_diff == cd else [relm] * max_diff
	for i in range(min_diff):
		res[i] = res[i] + relm if max_diff == cd else celm + res[i]
	print(len(res))
	print('\n'.join(res))
main()


s = input()
sx = ord(s[0]) - ord('a')
sy = int(s[1])
s = input()
fx = ord(s[0]) - ord('a')
fy = int(s[1])
a = []
k = 0
while sy != fy or sx != fx:
	s = ''
	if sx > fx:
		s = 'L'
		sx -= 1
	elif sx < fx:
		s = 'R'
		sx += 1
	if sy < fy:
		s += 'U'
		sy += 1
	elif sy > fy:
		s += 'D'
		sy -= 1
	a.append(s)
	k += 1
print(k)
for s in a:
	print(s)


s = input()
t = input()
c = ord(s[0])
d = ord(t[0])
f = int(s[1])
g = int(t[1])
k = []
while True:
	if c == d and f == int(t[1]):
		break
	if c > d and f > int(t[1]):
		c -= 1
		f = f - 1
		k.append('LD')
	if c < d and f < int(t[1]):
		c += 1
		f = f + 1
		k.append('RU')
	if c > d and f < int(t[1]):
		c -= 1
		f = f + 1
		k.append('LU')
	if c < d and f > int(t[1]):
		c += 1
		f = f - 1
		k.append('RD')
	if c == d and f > int(t[1]):
		f = f - 1
		k.append('D')
	if c == d and f < int(t[1]):
		f = f + 1
		k.append('U')
	if c > d and f == int(t[1]):
		c -= 1
		k.append('L')
	if c < d and f == int(t[1]):
		c += 1
		k.append('R')
print(len(k))
for i in k:
	print(i)


def shortpath(k, p):
	letters = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
	k = [int(letters[k[0]]), int(k[1])]
	p = [int(letters[p[0]]), int(p[1])]
	diff = list([abs(int(k[0]) - int(p[0])), abs(int(k[1]) - int(p[1]))])
	curr = k
	if diff[0] != diff[1]:
		n_moves = max(diff)
		print(n_moves)
		n_diag = min(diff)
		tem = n_diag
	else:
		n_moves = diff[0]
		print(n_moves)
		n_diag = diff[0]
		tem = n_diag
	if n_diag > 0:
		if p[0] > k[0]:
			if p[1] > k[1]:
				for i in range(n_diag):
					print('RU')
					curr[0] += 1
					curr[1] += 1
			if p[1] < k[1]:
				for i in range(n_diag):
					print('RD')
					curr[0] += 1
					curr[1] -= 1
		if p[0] < k[0]:
			if p[1] > k[1]:
				for i in range(n_diag):
					print('LU')
					curr[0] -= 1
					curr[1] += 1
			if p[1] < k[1]:
				for i in range(n_diag):
					print('LD')
					curr[0] -= 1
					curr[1] -= 1
	if curr[0] == p[0]:
		if p[1] > curr[1]:
			for i in range(n_moves - n_diag):
				print('U')
		if p[1] < curr[1]:
			for i in range(n_moves - n_diag):
				print('D')
	if curr[1] == p[1]:
		if p[0] > curr[0]:
			for i in range(n_moves - n_diag):
				print('R')
		if p[0] < curr[0]:
			for i in range(n_moves - n_diag):
				print('L')
k = input()
p = input()
shortpath(k, p)


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


def div(est):
	return (est[0], est[1])

def move(moveh, movev):
	mov = ''
	if moveh == 1:
		mov = mov + 'R'
	elif moveh == -1:
		mov = mov + 'L'
	if movev == 1:
		mov = mov + 'U'
	elif movev == -1:
		mov = mov + 'D'
	return mov
s = input()
t = input()
tablero = []
letras = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
num = {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h'}
actual = s
(lt, nt) = div(t)
cont = 0
moves = []
while actual != t:
	(lactual, nactual) = div(actual)
	if letras[lactual] > letras[lt]:
		moveh = -1
	elif letras[lactual] == letras[lt]:
		moveh = 0
	else:
		moveh = 1
	if nactual > nt:
		movev = -1
	elif nactual == nt:
		movev = 0
	else:
		movev = 1
	mov = move(moveh, movev)
	cont += 1
	moves.append(mov)
	actual = num[letras[lactual] + moveh]
	paso = int(nactual) + movev
	actual += str(paso)
print(cont)
for m in moves:
	print(m)


def fun(x1, y1, x2, y2):
	if abs(x2 - x1) == abs(y2 - y1):
		print(abs(x2 - x1))
	elif abs(x2 - x1) == 0 and abs(y2 - y1) > 0:
		print(abs(y2 - y1))
	elif abs(x2 - x1) > 0 and abs(y2 - y1) == 0:
		print(abs(x2 - x1))
	elif abs(x2 - x1) > 0 and abs(y2 - y1) > 0 and (abs(x2 - x1) != abs(y2 - y1)):
		print(max(abs(y2 - y1), abs(x2 - x1)))
	while x1 - x2 != 0 or y1 - y2 != 0:
		if x1 - x2 < 0 and y1 - y2 == 0:
			x1 = x1 + 1
			print('D')
		if x1 - x2 > 0 and y1 - y2 == 0:
			x1 = x1 - 1
			print('U')
		if x1 - x2 == 0 and y1 - y2 < 0:
			y1 = y1 + 1
			print('R')
		if x1 - x2 == 0 and y1 - y2 > 0:
			y1 = y1 - 1
			print('L')
		if x1 - x2 > 0 and y1 - y2 > 0:
			x1 = x1 - 1
			y1 = y1 - 1
			print('LU')
		if x1 - x2 > 0 and y1 - y2 < 0:
			x1 = x1 - 1
			y1 = y1 + 1
			print('RU')
		if x1 - x2 < 0 and y1 - y2 < 0:
			x1 = x1 + 1
			y1 = y1 + 1
			print('RD')
		if x1 - x2 < 0 and y1 - y2 > 0:
			x1 = x1 + 1
			y1 = y1 - 1
			print('LD')
	return
a = input()
b = input()
Dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
y1 = Dict.get(a[0])
x1 = 9 - int(a[1])
y2 = Dict.get(b[0])
x2 = 9 - int(b[1])
fun(x1, y1, x2, y2)


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

def j(m, n):
	if m >= n:
		return m - n
	else:
		return n - m
a = int(q[1])
b = int(w[1])
c = d.get(q[0])
h = d.get(w[0])
bushu = max(j(a, b), j(c, h))
print(bushu)
for i in range(bushu):
	if a == b and c == h:
		break
	r = ''
	if c < h:
		r += 'R'
		c += 1
	if c > h:
		r += 'L'
		c -= 1
	if a < b:
		r += 'U'
		a += 1
	if a > b:
		r += 'D'
		a -= 1
	print(r)


a = input()
b = input()
x = ord(a[0]) - ord('a')
y = int(a[1])
x1 = ord(b[0]) - ord('a')
y1 = int(b[1])
perx = x1 - x
pery = y1 - y
print(max(abs(perx), abs(pery)))
if abs(perx) >= abs(pery):
	if perx < 0:
		num = ['L' for i in range(abs(perx))]
	else:
		num = ['R' for i in range(abs(perx))]
	if pery < 0:
		for i in range(abs(pery)):
			num[i] += 'D'
	else:
		for i in range(abs(pery)):
			num[i] += 'U'
else:
	if pery < 0:
		num = ['D' for i in range(abs(pery))]
	else:
		num = ['U' for i in range(abs(pery))]
	if perx < 0:
		for i in range(abs(perx)):
			num[i] += 'L'
	else:
		for i in range(abs(perx)):
			num[i] += 'R'
for i in range(len(num)):
	if len(num[i]) == 2:
		if num[i][0] == 'D' or num[i][0] == 'U':
			num[i] = num[i][1] + num[i][0]
	print(num[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(max(len(ver), len(hor)))
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))


(a, b) = input()
a = ord(a) - 96
a = int(a)
b = int(b)
(c, d) = input()
c = ord(c) - 96
d = int(d)
ans = 0
ans = a - c + (b - d)
(x, y) = (a - c, b - d)
print(max(abs(x), abs(y)))
while x != 0 or y != 0:
	r = ''
	if x < 0:
		r = 'R'
		x += 1
	if x > 0:
		r = 'L'
		x -= 1
	if y < 0:
		r += 'U'
		y += 1
	if y > 0:
		r += 'D'
		y -= 1
	print(r)


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


chars = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
s = input()
t = input()
s = (int(chars[s[0]]), int(s[1]))
t = (int(chars[t[0]]), int(t[1]))
x = t[0] - s[0]
y = t[1] - s[1]
ans = []
ansx = ['L'] * abs(min(0, x)) + ['R'] * abs(max(0, x))
ansy = ['D'] * abs(min(0, y)) + ['U'] * abs(max(0, y))
print(max(len(ansx), len(ansy)))
while ansx and ansy:
	print(ansx[0], ansy[0], sep='')
	ansx.pop(0)
	ansy.pop(0)
if ansx:
	print(*ansx, sep='\n')
elif ansy:
	print(*ansy, sep='\n')


def read():
	tmp = input()
	x = ord(tmp[0]) - ord('A')
	y = int(tmp[1])
	return (x, y)
X = read()
Y = read()
col = X[1] - Y[1]
row = X[0] - Y[0]
Pos = []
while row > 0 and col > 0:
	Pos.append('LD')
	row -= 1
	col -= 1
while row > 0 and col < 0:
	Pos.append('LU')
	row -= 1
	col += 1
while row < 0 and col > 0:
	Pos.append('RD')
	row += 1
	col -= 1
while row < 0 and col < 0:
	Pos.append('RU')
	row += 1
	col += 1
while row < 0:
	Pos.append('R')
	row += 1
while row > 0:
	Pos.append('L')
	row -= 1
while col < 0:
	Pos.append('U')
	col += 1
while col > 0:
	Pos.append('D')
	col -= 1
print(len(Pos))
for i in Pos:
	print(i)


a = str(input())
b = str(input())
count1 = ord(a[0]) - ord(b[0])
count2 = ord(a[1]) - ord(b[1])
bigger = abs(count1) if abs(count1) > abs(count2) else abs(count2)
dis = abs(count1) - abs(count2)
ab = bigger - abs(dis)
print(bigger)
out1 = 'R' if count1 < 0 else 'L'
out2 = 'D' if count2 > 0 else 'U'
for i in range(0, ab):
	print(out1 + out2)
for i in range(0, abs(dis)):
	print(out1 if dis > 0 else out2)


s1 = input()
s2 = input()
y = ord(s2[0]) - ord(s1[0])
x = int(s2[1]) - int(s1[1])
if abs(x) > abs(y):
	side = abs(y)
	g = abs(x)
else:
	side = abs(x)
	g = abs(y)
if y >= 0 and x >= 0:
	s = 'RU'
elif y < 0 and x >= 0:
	s = 'LU'
elif y >= 0 and x < 0:
	s = 'RD'
else:
	s = 'LD'
l = [s] * side
if side == abs(x):
	if y > 0:
		for i in range(g - side):
			l.append('R')
	else:
		for i in range(g - side):
			l.append('L')
elif x > 0:
	for i in range(g - side):
		l.append('U')
else:
	for i in range(g - side):
		l.append('D')
print(str(len(l)))
for i in range(len(l)):
	print(l[i])


def sign(n):
	return 0 if n == 0 else n // abs(n)

def parse(cell):
	return (ord(cell[0]), int(cell[1]))

def part(start, end, d, x, y):
	(start_x, start_y) = parse(start)
	(end_x, end_y) = parse(end)
	moves = 0
	path = []
	sign_x = sign(end_x - start_x)
	sign_y = sign(end_y - start_y)
	while not start_x == end_x and (not start_y == end_y):
		moves += 1
		path.append(d)
		start_x += sign_x
		start_y += sign_y
	if start_x == end_x:
		while not start_y == end_y:
			moves += 1
			path.append(y)
			start_y += sign_y
	else:
		while not start_x == end_x:
			moves += 1
			path.append(x)
			start_x += sign_x
	return (moves, path)

def solver(start, end):
	if start == end:
		return (0, [])
	(start_x, start_y) = parse(start)
	(end_x, end_y) = parse(end)
	if start_x < end_x and start_y <= end_y:
		return part(start, end, 'RU', 'R', 'U')
	elif start_x <= end_x and start_y > end_y:
		return part(start, end, 'RD', 'R', 'D')
	elif start_x > end_x and start_y >= end_y:
		return part(start, end, 'LD', 'L', 'D')
	else:
		return part(start, end, 'LU', 'L', 'U')

def main():
	start = input()
	end = input()
	(moves, path) = solver(start, end)
	print(moves)
	for el in path:
		print(el)
main()


class A:

	def solve(self):
		map_dict = {}
		letters = 'abcdefgh'
		index = 1
		for l in letters:
			map_dict[l] = index
			index += 1
		[sx, sy] = list(input())
		[tx, ty] = list(input())
		sx = map_dict[sx]
		tx = map_dict[tx]
		(sy, ty) = (int(sy), int(ty))
		(diffx, diffy) = (abs(sx - tx), abs(sy - ty))
		diagonal_steps = min(diffx, diffy)
		perp_steps = max(diffx, diffy) - diagonal_steps
		print(diagonal_steps + perp_steps)
		vert_step = ''
		hor_step = ''
		if sx < tx:
			hor_step = 'R'
		else:
			hor_step = 'L'
		if sy < ty:
			vert_step = 'U'
		else:
			vert_step = 'D'
		diagonal_path = [hor_step + vert_step for x in range(diagonal_steps)]
		if diagonal_steps > 0:
			print('\n'.join(diagonal_path))
		if diagonal_steps == diffx:
			if sy < ty:
				vert_step = 'U'
			else:
				vert_step = 'D'
			if perp_steps > 0:
				print('\n'.join([vert_step for x in range(perp_steps)]))
		else:
			if sx < tx:
				hor_step = 'R'
			else:
				hor_step = 'L'
			if perp_steps > 0:
				print('\n'.join([hor_step for x in range(perp_steps)]))
A().solve()


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)


def alphToInt(c):
	d = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
	return d[c]
startpos = input()
startx = alphToInt(startpos[0])
starty = int(startpos[1])
endpos = input()
endx = alphToInt(endpos[0])
endy = int(endpos[1])
diffx = startx - endx
diffy = starty - endy
ou = []
while diffx != 0 and diffy != 0:
	str = ''
	if diffx > 0:
		str = 'L'
		diffx -= 1
	else:
		str = 'R'
		diffx += 1
	if diffy > 0:
		str += 'D'
		diffy -= 1
	else:
		str += 'U'
		diffy += 1
	ou.append(str)
while diffx != 0:
	if diffx > 0:
		ou.append('L')
		diffx -= 1
	else:
		ou.append('R')
		diffx += 1
while diffy != 0:
	if diffy > 0:
		ou.append('D')
		diffy -= 1
	else:
		ou.append('U')
		diffy += 1
print(len(ou))
for s in ou:
	print(s)


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)

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)


T = str(input())
s = []
s.append(ord(T[0]) - 96)
s.append(int(T[1]))
T = str(input())
e = []
e.append(ord(T[0]) - 96)
e.append(int(T[1]))
count = 0
z = []
while s != e:
	if s[0] == e[0]:
		if s[1] > e[1]:
			k = s[1] - e[1]
			count += k
			s[1] -= k
			for i in range(k):
				z.append('D')
		elif s[1] < e[1]:
			k = e[1] - s[1]
			count += k
			s[1] += k
			for i in range(k):
				z.append('U')
	elif s[1] == e[1]:
		if s[0] > e[0]:
			k = s[0] - e[0]
			count += k
			s[0] -= k
			for i in range(k):
				z.append('L')
		elif s[0] < e[0]:
			k = e[0] - s[0]
			count += k
			s[0] += k
			for i in range(k):
				z.append('R')
	elif e[0] - s[0] > 0:
		if e[1] - s[1] > 0:
			count += 1
			s[1] += 1
			s[0] += 1
			z.append('RU')
		else:
			count += 1
			s[0] += 1
			s[1] -= 1
			z.append('RD')
	elif e[0] - s[0] < 0:
		if e[1] - s[1] > 0:
			count += 1
			s[1] += 1
			s[0] -= 1
			z.append('LU')
		else:
			count += 1
			s[0] -= 1
			s[1] -= 1
			z.append('LD')
print(count)
for i in z:
	print(i)


(s, t) = (input(), input())
(x1, y1) = (ord(s[0]) - ord('a') + 1, int(s[1]))
(x2, y2) = (ord(t[0]) - ord('a') + 1, int(t[1]))
ans = []
while (x1, y1) != (x2, y2):
	res = ''
	if x2 > x1:
		res += 'R'
		x1 += 1
	elif x2 < x1:
		res += 'L'
		x1 -= 1
	if y2 > y1:
		res += 'U'
		y1 += 1
	elif y2 < y1:
		res += 'D'
		y1 -= 1
	ans.append(res)
print(len(ans))
print('\n'.join(ans))


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


x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
y = [1, 2, 3, 4, 5, 6, 7, 8]
n = input()
m = input()
xm = x.index(m[0]) - x.index(n[0])
ym = y.index(int(m[1])) - y.index(int(n[1]))
g = max(abs(x.index(m[0]) - x.index(n[0])), abs(y.index(int(m[1])) - y.index(int(n[1]))))
print(g)
for i in range(g):
	if xm < 0:
		print('L', end='')
		xm = xm + 1
	if xm > 0:
		print('R', end='')
		xm = xm - 1
	if ym < 0:
		print('D', end='')
		ym = ym + 1
	if ym > 0:
		print('U', end='')
		ym = ym - 1
	print('')


ch1 = str(input())
ch2 = str(input())
pos1 = (ord(ch1[0]) - ord('a'), int(ch1[1]))
pos2 = (ord(ch2[0]) - ord('a'), int(ch2[1]))
L = list()
(a, b, c, d) = (pos1[0], pos1[1], pos2[0], pos2[1])
(a1, b1, c1, d1) = (a, b, c, d)
if a < c and b > d:
	(a1, b1, c1, d1) = (a, b, c, d)
	while a1 < c1 and b1 > d1:
		a1 += 1
		b1 -= 1
		L.append('RD')
if a > c and b < d:
	(a1, b1, c1, d1) = (a, b, c, d)
	while a1 > c1 and b1 < d1:
		a1 -= 1
		b1 += 1
		L.append('LU')
if a < c and b < d:
	(a1, b1, c1, d1) = (a, b, c, d)
	while a1 < c1 and b1 < d1:
		a1 += 1
		b1 += 1
		L.append('RU')
if a > c and b > d:
	(a1, b1, c1, d1) = (a, b, c, d)
	while a1 > c1 and b1 > d1:
		a1 -= 1
		b1 -= 1
		L.append('LD')
(a, b, c, d) = (a1, b1, c1, d1)
if a == c and b == d:
	if L == []:
		print(0)
	else:
		print(len(L))
		for h in L:
			print(h)
elif a == c and b != d:
	if b < d:
		(a1, b1, c1, d1) = (a, b, c, d)
		while b1 < d1:
			b1 += 1
			L.append('U')
	else:
		(a1, b1, c1, d1) = (a, b, c, d)
		while b1 > d1:
			b1 -= 1
			L.append('D')
	print(len(L))
	for h in L:
		print(h)
elif a != c and b == d:
	if a < c:
		(a1, b1, c1, d1) = (a, b, c, d)
		while a1 < c1:
			a1 += 1
			L.append('R')
	else:
		(a1, b1, c1, d1) = (a, b, c, d)
		while a1 > c1:
			a1 -= 1
			L.append('L')
	print(len(L))
	for h in L:
		print(h)


s = input()
t = input()
l = []
i = 0
while True:
	if s[0] > t[0]:
		if s[1] > t[1]:
			c = chr(ord(s[1]) - 1)
			s = chr(ord(s[0]) - 1) + c
			l.append('LD')
			i = i + 1
		elif s[1] < t[1]:
			c = chr(ord(s[1]) + 1)
			s = chr(ord(s[0]) - 1) + c
			l.append('LU')
			i = i + 1
		else:
			s = chr(ord(s[0]) - 1) + s[1]
			l.append('L')
			i = i + 1
	elif s[0] < t[0]:
		if s[1] > t[1]:
			c = chr(ord(s[1]) - 1)
			s = chr(ord(s[0]) + 1) + c
			l.append('RD')
			i = i + 1
		elif s[1] < t[1]:
			c = chr(ord(s[1]) + 1)
			s = chr(ord(s[0]) + 1) + c
			l.append('RU')
			i = i + 1
		else:
			s = chr(ord(s[0]) + 1) + s[1]
			l.append('R')
			i += 1
	elif s[1] > t[1]:
		c = chr(ord(s[1]) - 1)
		s = s[0] + c
		l.append('D')
		i += 1
	elif s[1] < t[1]:
		c = chr(ord(s[1]) + 1)
		s = s[0] + c
		l.append('U')
		i += 1
	if s == t:
		break
print(i)
for x in l:
	print(x)


def main():
	begin_point = input()
	end_point = input()
	(b_x, b_y) = (ord(begin_point[0]), int(begin_point[1]))
	(e_x, e_y) = (ord(end_point[0]), int(end_point[1]))
	step = max(abs(b_x - e_x), abs(b_y - e_y))
	print(step)
	while b_x != e_x or b_y != e_y:
		if b_x < e_x:
			print('R', end='')
			b_x += 1
		elif b_x > e_x:
			print('L', end='')
			b_x -= 1
		if b_y < e_y:
			print('U', end='')
			b_y += 1
		elif b_y > e_y:
			print('D', end='')
			b_y -= 1
		print('')
main()


def get_num_pos(pos):
	cols = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
	rows = ['1', '2', '3', '4', '5', '6', '7', '8']
	(col, row) = (pos[0], pos[1])
	return [cols.index(col), rows.index(row)]
slanting_mv = {(1, 1): 'RU', (-1, 1): 'LU', (1, -1): 'RD', (-1, -1): 'LD'}
parallel_mv = {(1, 0): 'R', (0, 1): 'U', (-1, 0): 'L', (0, -1): 'D'}
start_npos = get_num_pos(input())
dest_npos = get_num_pos(input())
diff_npos = [dest_npos[i] - start_npos[i] for i in range(len(dest_npos))]
(x, y) = diff_npos
slanting_mv_num = min(abs(x), abs(y))
parallel_mv_num = max(abs(x), abs(y)) - slanting_mv_num
sloss_cmd = []
sloss_val = []
for (smv, cmd) in slanting_mv.items():
	sloss_cmd.append(smv)
	sloss_val.append(abs(x - smv[0] * slanting_mv_num) + abs(y - smv[1] * slanting_mv_num))
min_sloss_val = min(sloss_val)
min_sloss_cmd = sloss_cmd[sloss_val.index(min_sloss_val)]
cmd_list = [slanting_mv[min_sloss_cmd] for i in range(slanting_mv_num)]
x -= min_sloss_cmd[0] * slanting_mv_num
y -= min_sloss_cmd[1] * slanting_mv_num
ploss_cmd = []
ploss_val = []
for (pmv, cmd) in parallel_mv.items():
	ploss_cmd.append(pmv)
	ploss_val.append(abs(x - pmv[0] * parallel_mv_num) + abs(y - pmv[1] * parallel_mv_num))
min_ploss_val = min(ploss_val)
min_ploss_cmd = ploss_cmd[ploss_val.index(min_ploss_val)]
cmd_list += [parallel_mv[min_ploss_cmd] for i in range(parallel_mv_num)]
print(slanting_mv_num + parallel_mv_num)
print('\n'.join(cmd_list))


k = input()
p = input()
x = ord(k[0]) - ord(p[0])
y = int(k[1]) - int(p[1])
m = max(abs(x), abs(y))
s = ['', '']
print(m)
if x <= m:
	if x < 0:
		s[0] = 'R'
	elif x > 0:
		s[0] = 'L'
if y <= m:
	if y < 0:
		s[1] = 'U'
	elif y > 0:
		s[1] = 'D'
for i in range(m):
	if abs(x) > i:
		print(s[0], end='')
	if abs(y) > i:
		print(s[1], end='')
	print()


def ter(n, sn, sz, sp):
	return sn if n < 0 else sz if n == 0 else sp

def sign(n):
	return ter(n, -1, 0, 1)
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)


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


a = input()
b = input()
x1 = ord(a[0]) - ord('a') + 1
y1 = int(a[1])
x2 = ord(b[0]) - ord('a') + 1
y2 = int(b[1])
z = []
l = 0
print(max(abs(x1 - x2), abs(y1 - y2)))
while x1 != x2 or y1 != y2:
	f = ''
	if x1 < x2:
		f += 'R'
		x1 += 1
	elif x1 > x2:
		f += 'L'
		x1 -= 1
	if y1 < y2:
		f += 'U'
		y1 += 1
	elif y1 > y2:
		f += 'D'
		y1 -= 1
	print(f)


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

def Move(s1, s2, t1, t2):
	move = ''
	if s1 < t1:
		move += 'R'
	if s1 > t1:
		move += 'L'
	if s2 < t2:
		move += 'U'
	if s2 > t2:
		move += 'D'
	return move
(s1, s2) = list(input())
(t1, t2) = list(input())
(s2, t2) = (int(s2), int(t2))
s1 = A.index(s1)
t1 = A.index(t1)
moves = []
while True:
	move = Move(s1, s2, t1, t2)
	if 'R' in move:
		s1 += 1
	if 'L' in move:
		s1 -= 1
	if 'U' in move:
		s2 += 1
	if 'D' in move:
		s2 -= 1
	if move == '':
		break
	moves.append(move)
print(len(moves))
for i in moves:
	print(i)


a = input()
b = input()
(y1, x1) = (int(a[1]), ord(a[0]) - ord('a'))
(y2, x2) = (int(b[1]), ord(b[0]) - ord('a'))
print(max(abs(x1 - x2), abs(y1 - y2)))
h = ''
v = ''
if x1 - x2 < 0:
	h = 'R'
elif x1 - x2 > 0:
	h = 'L'
if y1 - y2 < 0:
	v = 'U'
elif y1 > y2:
	v = 'D'
hor = [h] * abs(x1 - x2)
ver = [v] * abs(y1 - y2)
while len(hor) > 0 and len(ver) > 0:
	print(hor.pop(0) + ver.pop(0))
while len(hor) > 0:
	print(hor.pop(0))
while len(ver) > 0:
	print(ver.pop(0))


a = list(input())
b = list(input())
a[0] = ord(a[0]) - 96
b[0] = ord(b[0]) - 96
a[1] = int(a[1])
b[1] = int(b[1])
c = 0
d = []
if a[0] < b[0] and a[1] < b[1]:
	while not (a[0] == b[0] or a[1] == b[1]):
		a[0] += 1
		a[1] += 1
		c += 1
		d.append('RU')
if a[0] > b[0] and a[1] < b[1]:
	while not (a[0] == b[0] or a[1] == b[1]):
		a[0] -= 1
		a[1] += 1
		c += 1
		d.append('LU')
if a[0] < b[0] and a[1] > b[1]:
	while not (a[0] == b[0] or a[1] == b[1]):
		a[0] += 1
		a[1] -= 1
		c += 1
		d.append('RD')
if a[0] > b[0] and a[1] > b[1]:
	while not (a[0] == b[0] or a[1] == b[1]):
		a[0] -= 1
		a[1] -= 1
		c += 1
		d.append('LD')
while a[0] > b[0]:
	a[0] -= 1
	d.append('L')
	c += 1
while a[0] < b[0]:
	a[0] += 1
	d.append('R')
	c += 1
while a[1] > b[1]:
	a[1] -= 1
	d.append('D')
	c += 1
while a[1] < b[1]:
	a[1] += 1
	d.append('U')
	c += 1
print(c)
for i in d:
	print(i)


S1 = input()
S2 = input()
D = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
T = S1
A = list()
V = [0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']

def mod(x):
	if x < 0:
		return -x
	return x
n = max(mod(int(S1[1]) - int(S2[1])), mod(D[S1[0]] - D[S2[0]]))
print(n)
while T != S2:
	cur = ''
	step = ''
	if D[T[0]] < D[S2[0]]:
		cur += V[D[T[0]] + 1]
		step += 'R'
	elif D[T[0]] > D[S2[0]]:
		cur += V[D[T[0]] - 1]
		step += 'L'
	else:
		cur += T[0]
	if int(T[1]) > int(S2[1]):
		cur += str(int(T[1]) - 1)
		step += 'D'
	elif int(T[1]) < int(S2[1]):
		cur += str(int(T[1]) + 1)
		step += 'U'
	else:
		cur += str(int(T[1]))
	T = cur
	A.append(step)
for i in range(len(A)):
	print(A[i])


row = 'abcdefgh'
col = '12345678'
start = input()
end = input()

def get_next_pos(arr, pos, step):
	for i in range(len(arr)):
		if pos == arr[i]:
			return arr[i + step]
	return pos
count = 0
cur = start
steps = []
while cur != end:
	step = ''
	next_row = cur[0]
	next_col = cur[1]
	if cur[0] > end[0]:
		step += 'L'
		next_row = get_next_pos(row, next_row, -1)
	elif cur[0] < end[0]:
		step += 'R'
		next_row = get_next_pos(row, next_row, 1)
	if cur[1] > end[1]:
		step += 'D'
		next_col = get_next_pos(col, next_col, -1)
	elif cur[1] < end[1]:
		step += 'U'
		next_col = get_next_pos(col, next_col, 1)
	steps.append(step)
	count += 1
	cur = next_row + next_col
print(count)
print('\n'.join(steps))


p1 = str(input())
p2 = str(input())
p1 = [ord(p1[0]) - 96, int(p1[1])]
p2 = [ord(p2[0]) - 96, int(p2[1])]
print(max(abs(p1[0] - p2[0]), abs(p1[1] - p2[1])))
while True:
	vector = ''
	if p1[0] == p2[0] and p1[1] == p2[1]:
		break
	if p1[0] < p2[0]:
		p1[0] += 1
		vector += 'R'
	if p1[0] > p2[0]:
		p1[0] -= 1
		vector += 'L'
	if p1[1] < p2[1]:
		p1[1] += 1
		vector += 'U'
	if p1[1] > p2[1]:
		p1[1] -= 1
		vector += 'D'
	print(vector)


s = list(input())
t = list(input())
moves = list()
while s[0] != t[0] or s[1] != t[1]:
	string = ''
	if s[0] < t[0]:
		string = 'R'
		s[0] = chr(ord(s[0]) + 1)
	elif s[0] > t[0]:
		string = 'L'
		s[0] = chr(ord(s[0]) - 1)
	if s[1] < t[1]:
		string = string + 'U'
		s[1] = str(int(s[1]) + 1)
	elif s[1] > t[1]:
		string = string + 'D'
		s[1] = str(int(s[1]) - 1)
	moves.append(string)
print(len(moves))
print('\n'.join(moves))


(fr, to) = (input(), input())
frx = ord(fr[0])
fry = ord(fr[1])
tox = ord(to[0])
toy = ord(to[1])
print(max(abs(frx - tox), abs(fry - toy)))
while frx < tox and fry > toy:
	print('RD')
	frx += 1
	fry -= 1
while frx > tox and fry > toy:
	print('LD')
	frx -= 1
	fry -= 1
while frx < tox and fry < toy:
	print('RU')
	frx += 1
	fry += 1
while frx > tox and fry < toy:
	print('LU')
	frx -= 1
	fry += 1
while frx < tox:
	print('R')
	frx += 1
while frx > tox:
	print('L')
	frx -= 1
while fry > toy:
	print('D')
	fry -= 1
while fry < toy:
	print('U')
	fry += 1


a = input()
b = input()
c = ' abcdefgh'
p = [c.index(a[0]), int(a[1])]
y = [c.index(b[0]), int(b[1])]
ans = []
while p != y:
	t = ''
	if p[0] < y[0]:
		t += 'R'
		p[0] += 1
	elif p[0] > y[0]:
		t += 'L'
		p[0] -= 1
	if p[1] > y[1]:
		t += 'D'
		p[1] -= 1
	elif p[1] < y[1]:
		t += 'U'
		p[1] += 1
	ans.append(t)
print(len(ans))
for i in ans:
	print(i)


ini = input().strip()
fin = input().strip()
(xa, ya) = (ord(ini[0]), int(ini[1]))
(xb, yb) = (ord(fin[0]), int(fin[1]))
print(max(abs(xa - xb), abs(ya - yb)))
while xa != xb or ya != yb:
	ne = ''
	if xa < xb:
		xa += 1
		ne += 'R'
	elif xa > xb:
		xa -= 1
		ne += 'L'
	if ya > yb:
		ya -= 1
		ne += 'D'
	elif ya < yb:
		ya += 1
		ne += 'U'
	print(ne)


s = input()
t = input()
count = 0
lis = []
while s != t:
	if s[1] == t[1]:
		count = count + 1
		if s[0] > t[0]:
			lis.append('L')
			s = chr(ord(s[0]) - 1) + s[1]
		else:
			lis.append('R')
			s = chr(ord(s[0]) + 1) + s[1]
	elif s[0] == t[0]:
		count += 1
		if s[1] > t[1]:
			lis.append('D')
			s = s[0] + chr(ord(s[1]) - 1)
		else:
			lis.append('U')
			s = s[0] + chr(ord(s[1]) + 1)
	elif s[0] > t[0] and s[1] > t[1]:
		count += 1
		s = chr(ord(s[0]) - 1) + s[1]
		s = s[0] + chr(ord(s[1]) - 1)
		lis.append('LD')
	elif s[0] < t[0] and s[1] < t[1]:
		count += 1
		s = chr(ord(s[0]) + 1) + s[1]
		s = s[0] + chr(ord(s[1]) + 1)
		lis.append('RU')
	elif s[0] > t[0] and s[1] < t[1]:
		count += 1
		s = chr(ord(s[0]) - 1) + s[1]
		s = s[0] + chr(ord(s[1]) + 1)
		lis.append('LU')
	elif s[0] < t[0] and s[1] > t[1]:
		count += 1
		s = chr(ord(s[0]) + 1) + s[1]
		s = s[0] + chr(ord(s[1]) - 1)
		lis.append('RD')
print(count)
for i in lis:
	print(i)


a = input()
d = input()
cA = ord(a[0]) - 96
cD = ord(d[0]) - 96
fA = int(a[1])
fD = int(d[1])
num = 0
ans = ''
while not (cA == cD and fA == fD):
	if not (cA == cD or fA == fD):
		if fA > fD:
			if cA > cD:
				cA -= 1
				ans += '\nLD'
			else:
				cA += 1
				ans += '\nRD'
			fA -= 1
		else:
			if cA > cD:
				cA -= 1
				ans += '\nLU'
			else:
				cA += 1
				ans += '\nRU'
			fA += 1
	elif cA == cD:
		if fA > fD:
			fA -= 1
			ans += '\nD'
		else:
			fA += 1
			ans += '\nU'
	elif cA > cD:
		cA -= 1
		ans += '\nL'
	else:
		cA += 1
		ans += '\nR'
	num += 1
print(num)
print(ans[1:])


dic = {chr(n + 96): n for n in range(1, 9)}
start = list(input())
end = list(input())
start[0] = dic[start[0]]
end[0] = dic[end[0]]
start[1] = int(start[1])
end[1] = int(end[1])
y = end[1] - start[1]
x = end[0] - start[0]
xmove = 'R' * x if x > 0 else 'L' * abs(x)
ymove = 'U' * y if y > 0 else 'D' * abs(y)
total = max(abs(x), abs(y))
both = list(zip(xmove, ymove))
print(total)
for e in both:
	print(e[0] + e[1])
for e in range(abs(abs(x) - abs(y))):
	if abs(x) > abs(y):
		print(xmove[0])
	else:
		print(ymove[0])


(a, ai) = [x for x in input()]
(b, bi) = [x for x in input()]
(ai, bi) = (int(ai), int(bi))
path = []
while a != b or ai != bi:
	curr = ''
	if a < b:
		curr += 'R'
		a = chr(ord(a) + 1)
	if a > b:
		curr += 'L'
		a = chr(ord(a) - 1)
	if ai > bi:
		curr += 'D'
		ai -= 1
	if ai < bi:
		curr += 'U'
		ai += 1
	path.append(curr)
print(len(path))
print('\n'.join(path))


letras = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
movimientos = []
s = input()
t = input()
s = [letras[s[0]], int(s[1])]
t = [letras[t[0]], int(t[1])]
while s[1] != t[1] and s[0] != t[0]:
	if s[1] < t[1] and s[0] > t[0]:
		s[1] += 1
		s[0] -= 1
		movimientos += ['LU']
	elif s[1] < t[1] and s[0] < t[0]:
		s[1] += 1
		s[0] += 1
		movimientos += ['RU']
	elif s[1] > t[1] and s[0] < t[0]:
		s[1] -= 1
		s[0] += 1
		movimientos += ['RD']
	elif s[1] > t[1] and s[0] > t[0]:
		s[1] -= 1
		s[0] -= 1
		movimientos += ['LD']
if s[1] == t[1]:
	if s[0] < t[0]:
		movimientos += abs(s[0] - t[0]) * ['R']
	elif s[0] > t[0]:
		movimientos += abs(t[0] - s[0]) * ['L']
elif s[1] > t[1]:
	movimientos += abs(s[1] - t[1]) * ['D']
elif s[1] < t[1]:
	movimientos += abs(t[1] - s[1]) * ['U']
print(len(movimientos))
for m in movimientos:
	print(m)


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 = input()
t = input()
d = {}
j = 1
for i in range(97, 105):
	d[chr(i)] = j
	j += 1
(x0, y0) = (d[s[0]], int(s[1]))
(x, y) = (d[t[0]], int(t[1]))
n = max(abs(x - x0), abs(y - y0))
print(n)
while x0 < x and y0 < y:
	if x0 == x and y0 == y:
		break
	print('RU')
	x0 += 1
	y0 += 1
while x0 < x and y0 > y:
	if x0 == x and y0 == y:
		break
	print('RD')
	x0 += 1
	y0 -= 1
while x0 > x and y0 < y:
	if x0 == x and y0 == y:
		break
	print('LU')
	x0 -= 1
	y0 += 1
while x0 > x and y0 > y:
	if x0 == x and y0 == y:
		break
	print('LD')
	x0 -= 1
	y0 -= 1
while x0 < x:
	if x0 == x:
		break
	print('R')
	x0 += 1
while x0 > x:
	if x0 == x:
		break
	print('L')
	x0 -= 1
while y0 < y:
	if y0 == y:
		break
	print('U')
	y0 += 1
while y0 > y:
	if y0 == y:
		break
	print('D')
	y0 -= 1


A = input()
B = input()
x = [ord(A[0]) - 97, ord(B[0]) - 97]
y = [int(A[1]), int(B[1])]
d1 = abs(x[1] - x[0])
d2 = abs(y[1] - y[0])
d = max(d1, d2)
print(d)
s = ''
if x[0] < x[1]:
	s += 'R'
if x[0] > x[1]:
	s += 'L'
if y[0] < y[1]:
	s += 'U'
if y[0] > y[1]:
	s += 'D'
for i in range(min(d1, d2)):
	print(s)
s = ''
if d1 > d2:
	if x[0] < x[1]:
		s += 'R'
	if x[0] > x[1]:
		s += 'L'
if d1 < d2:
	if y[0] < y[1]:
		s += 'U'
	if y[0] > y[1]:
		s += 'D'
for i in range(max(d1, d2) - min(d1, d2)):
	print(s)


__author__ = 'Darren'

def solve():
	import sys
	stdin = sys.stdin if True else open('data')
	start = list(map(ord, next(stdin)))
	end = list(map(ord, next(stdin)))
	path = []
	count = 0
	while start != end:
		if end[0] > start[0] and end[1] > start[1]:
			path.append('RU')
			start[0] += 1
			start[1] += 1
		elif end[0] < start[0] and end[1] > start[1]:
			path.append('LU')
			start[0] -= 1
			start[1] += 1
		elif end[0] < start[0] and end[1] < start[1]:
			path.append('LD')
			start[0] -= 1
			start[1] -= 1
		elif end[0] > start[0] and end[1] < start[1]:
			path.append('RD')
			start[0] += 1
			start[1] -= 1
		elif end[0] > start[0]:
			path.append('R')
			start[0] += 1
		elif end[0] < start[0]:
			path.append('L')
			start[0] -= 1
		elif end[1] > start[1]:
			path.append('U')
			start[1] += 1
		else:
			path.append('D')
			start[1] -= 1
		count += 1
	print(count)
	print('\n'.join(path))
solve()


current = input()
final = input()
li = []
while final != current:
	if ord(final[0]) > ord(current[0]):
		if int(final[1]) > int(current[1]):
			li.append('RU')
			current = chr(ord(current[0]) + 1) + str(int(current[1]) + 1)
		elif int(final[1]) < int(current[1]):
			li.append('RD')
			current = chr(ord(current[0]) + 1) + str(int(current[1]) - 1)
		else:
			li.append('R')
			current = chr(ord(current[0]) + 1) + str(int(current[1]))
	elif ord(final[0]) < ord(current[0]):
		if int(final[1]) > int(current[1]):
			li.append('LU')
			current = chr(ord(current[0]) - 1) + str(int(current[1]) + 1)
		elif int(final[1]) < int(current[1]):
			li.append('LD')
			current = chr(ord(current[0]) - 1) + str(int(current[1]) - 1)
		else:
			li.append('L')
			current = chr(ord(current[0]) - 1) + str(int(current[1]))
	elif int(final[1]) > int(current[1]):
		li.append('U')
		current = chr(ord(current[0])) + str(int(current[1]) + 1)
	elif int(final[1]) < int(current[1]):
		li.append('D')
		current = chr(ord(current[0])) + str(int(current[1]) - 1)
print(len(li))
for i in li:
	print(i)


x = list(input())
x[0] = ord(x[0]) - 96
x[1] = ord(x[1]) - 48
y = list(input())
y[0] = ord(y[0]) - 96
y[1] = ord(y[1]) - 48
arr = []
arr1 = []
while x[0] != y[0]:
	if x[0] > y[0]:
		arr.append('L')
		x[0] -= 1
	elif x[0] < y[0]:
		arr.append('R')
		x[0] += 1
while x[1] != y[1]:
	if x[1] > y[1]:
		arr1.append('D')
		x[1] -= 1
	elif x[1] < y[1]:
		arr1.append('U')
		x[1] += 1
n = len(arr) - len(arr1)
m = len(arr1) - len(arr)
if len(arr) < len(arr1):
	print(len(arr1))
	for i in range(len(arr)):
		print(arr[i] + arr1[i])
	for j in range(m):
		print(arr1[j])
else:
	print(len(arr))
	for i in range(len(arr1)):
		print(arr[i] + arr1[i])
	for j in range(n):
		print(arr[j])


c1 = input()
c2 = input()
let = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
x1 = let.index(c1[0])
y1 = int(c1[1])
x2 = let.index(c2[0])
y2 = int(c2[1])
print(max(abs(x1 - x2), abs(y1 - y2)))
while 1:
	if x1 == x2 and y1 == y2:
		break
	if x1 > x2:
		x1 -= 1
		print('L', end='')
	elif x1 < x2:
		x1 += 1
		print('R', end='')
	if y1 > y2:
		y1 -= 1
		print('D', end='')
	elif y1 < y2:
		y1 += 1
		print('U', end='')
	print()


MIN_LETTER = 'a'
MIN_DIGIT = '1'
X_DIRECTION_TO_MOVE = {1: 'R', -1: 'L'}
Y_DIRECTION_TO_MOVE = {1: 'U', -1: 'D'}

def get_cell_coords(cell: str):
	letter = cell[0]
	digit = cell[1]
	return [ord(letter) - ord(MIN_LETTER), ord(digit) - ord(MIN_DIGIT)]

def get_direction(x, y):
	if y > x:
		return 1
	elif y < x:
		return -1
	else:
		return 0
current_cell = input()
destination_cell = input()
current_point = get_cell_coords(current_cell)
destination_point = get_cell_coords(destination_cell)
moves = []
moves_count = 0
while current_point != destination_point:
	move = ''
	x_direction = get_direction(current_point[0], destination_point[0])
	if x_direction:
		move += X_DIRECTION_TO_MOVE[x_direction]
		current_point[0] += x_direction
	y_direction = get_direction(current_point[1], destination_point[1])
	if y_direction:
		move += Y_DIRECTION_TO_MOVE[y_direction]
		current_point[1] += y_direction
	moves.append(move)
	moves_count += 1
print(moves_count)
for move in moves:
	print(move)


s = input()
t = input()
s = [ord(s[0]) - ord('a'), int(s[1]) - 1]
t = [ord(t[0]) - ord('a'), int(t[1]) - 1]
dx = [-1, 0, 1, 1, 1, 0, -1, -1]
dy = [1, 1, 1, 0, -1, -1, -1, 0]
res = []
while s != t:
	mn = 100
	j = 0
	for i in range(8):
		if mn > abs(s[0] + dx[i] - t[0]) + abs(s[1] + dy[i] - t[1]):
			mn = abs(s[0] + dx[i] - t[0]) + abs(s[1] + dy[i] - t[1])
			j = i
	s = [s[0] + dx[j], s[1] + dy[j]]
	res.append(j)
print(len(res))
dd = ['LU', 'U', 'RU', 'R', 'RD', 'D', 'LD', 'L']
for i in res:
	print(dd[i])


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

def index(cell):
	global col_map
	return (col_map[cell[0]], 8 - int(cell[1]))
s = input()
t = input()
s = index(s)
t = index(t)
step_map = {'L': (-1, 0), 'R': (1, 0), 'U': (0, -1), 'D': (0, 1), 'LU': (-1, -1), 'RU': (1, -1), 'LD': (-1, 1), 'RD': (1, 1)}

def dist(s, t):
	return (s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2

def best_step(s, t):
	min_dis = 9999
	step_ = None
	for (step, change) in step_map.items():
		if dist((s[0] + change[0], s[1] + change[1]), t) < min_dis:
			min_dis = dist((s[0] + change[0], s[1] + change[1]), t)
			step_ = step
	return step_
curr_dis = dist(s, t)
steps = []
while curr_dis:
	step_ = best_step(s, t)
	change = step_map[step_]
	s = (s[0] + change[0], s[1] + change[1])
	steps.append(step_)
	curr_dis = dist(s, t)
print(len(steps))
for i in steps:
	print(i)


def comp(s):
	a = s[0]
	res1 = 0
	res2 = 0
	if a == 'a':
		res1 = 1
	elif a == 'b':
		res1 = 2
	elif a == 'c':
		res1 = 3
	elif a == 'd':
		res1 = 4
	elif a == 'e':
		res1 = 5
	elif a == 'f':
		res1 = 6
	elif a == 'g':
		res1 = 7
	elif a == 'h':
		res1 = 8
	res2 = int(s[1])
	return (res1, res2)

def move(x1, y1, x2, y2, count, counter):
	if x1 == x2 and y1 == y2:
		print(count)
		for i in counter:
			print(i)
	elif x1 < x2 and y1 > y2:
		counter.append('RD')
		count += 1
		return move(x1 + 1, y1 - 1, x2, y2, count, counter)
	elif x1 < x2 and y1 == y2:
		counter.append('R')
		count += 1
		return move(x1 + 1, y1, x2, y2, count, counter)
	elif x1 < x2 and y1 < y2:
		counter.append('RU')
		count += 1
		return move(x1 + 1, y1 + 1, x2, y2, count, counter)
	elif x1 > x2 and y1 > y2:
		counter.append('LD')
		count += 1
		return move(x1 - 1, y1 - 1, x2, y2, count, counter)
	elif x1 > x2 and y1 == y2:
		counter.append('L')
		count += 1
		return move(x1 - 1, y1, x2, y2, count, counter)
	elif x1 > x2 and y1 < y2:
		counter.append('LU')
		count += 1
		return move(x1 - 1, y1 + 1, x2, y2, count, counter)
	elif x1 == x2 and y1 < y2:
		counter.append('U')
		count += 1
		return move(x1, y1 + 1, x2, y2, count, counter)
	else:
		counter.append('D')
		count += 1
		return move(x1, y1 - 1, x2, y2, count, counter)
s1 = input()
s2 = input()
move(comp(s1)[0], comp(s1)[1], comp(s2)[0], comp(s2)[1], 0, [])


cp = input()
dp = input()
(x0, y0) = (cp[0], cp[1])
(x1, y1) = (dp[0], dp[1])
ans = max(abs(ord(x0) - ord(x1)), abs(int(y0) - abs(int(y1))))
(x0, y0) = (ord(cp[0]), int(cp[1]))
(x1, y1) = (ord(dp[0]), int(dp[1]))
print(ans)
while 1:
	if x0 == x1 and y0 == y1:
		break
	if x0 < x1:
		x0 += 1
		print('R', end='')
	if x1 < x0:
		x0 -= 1
		print('L', end='')
	if y0 < y1:
		y0 += 1
		print('U', end='')
	if y1 < y0:
		y0 -= 1
		print('D', end='')
	print()


columns = 'abcdefgh'
inp = str(input())
columnS = 'abcdefgh'.index(inp[0])
rowS = int(inp[1])
inp = str(input())
columnT = 'abcdefgh'.index(inp[0])
rowT = int(inp[1])
moveC = columnT - columnS
moveS = rowT - rowS
n = max(abs(moveC), abs(moveS))
print(n)
for i in range(n):
	(c, s) = (0, 0)
	if moveC > 0:
		c += 1
		moveC -= 1
	elif moveC < 0:
		c -= 1
		moveC += 1
	if moveS > 0:
		s += 1
		moveS -= 1
	elif moveS < 0:
		s -= 1
		moveS += 1
	dicC = {-1: 'L', 0: '', 1: 'R'}
	dicS = {-1: 'D', 0: '', 1: 'U'}
	print(dicC[c] + dicS[s])


Answer = []
(Origin, Destination) = (input(), input())
while Origin != Destination:
	This = ''
	if Destination[0] > Origin[0]:
		This += 'R'
		Origin = chr(ord(Origin[0]) + 1) + Origin[1]
	if Destination[0] < Origin[0]:
		This += 'L'
		Origin = chr(ord(Origin[0]) - 1) + Origin[1]
	if Destination[1] > Origin[1]:
		This += 'U'
		Origin = Origin[0] + str(int(Origin[1]) + 1)
	if Destination[1] < Origin[1]:
		This += 'D'
		Origin = Origin[0] + str(int(Origin[1]) - 1)
	Answer.append(This)
print(len(Answer), *Answer, sep='\n')


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
	elif direction[0] < 0:
		moves.append('LD')
		counter += 1
		direction[0] += 1
		direction[1] += 1
	elif 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)


d = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
ne = {'a': 'b', 'b': 'c', 'c': 'd', 'd': 'e', 'e': 'f', 'f': 'g', 'g': 'h'}
pr = {'h': 'g', 'g': 'f', 'f': 'e', 'e': 'd', 'd': 'c', 'c': 'b', 'b': 'a'}
s = list(input())
st = list(input())
num1 = int(s[1])
num2 = int(st[1])
print(max(abs(d[s[0]] - d[st[0]]), abs(num1 - num2)))
while True:
	if s[0] < st[0]:
		if num1 < num2:
			print('RU')
			num1 += 1
			s[0] = ne[s[0]]
		elif num1 > num2:
			print('RD')
			num1 -= 1
			s[0] = ne[s[0]]
		else:
			print('R')
			s[0] = ne[s[0]]
	elif s[0] > st[0]:
		if num1 < num2:
			print('LU')
			num1 += 1
			s[0] = pr[s[0]]
		elif num1 > num2:
			print('LD')
			num1 -= 1
			s[0] = pr[s[0]]
		else:
			print('L')
			s[0] = pr[s[0]]
	elif num1 < num2:
		print('U')
		num1 += 1
	elif num1 > num2:
		print('D')
		num1 -= 1
	else:
		break


s = input()
t = input()
x0 = ord(s[0])
y0 = int(s[1])
x = ord(t[0])
y = int(t[1])
move = ''
n = 0
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 += 'U'
		y0 += 1
	elif y < y0:
		move += 'D'
		y0 -= 1
	move += '\n'
	n += 1
print(n)
print(move)


def question(p, v1, v2):
	if p:
		return v1
	return v2
(s, t) = [input() for i in range(2)]
H = ord(t[0]) - ord(s[0])
V = int(t[1]) - int(s[1])
print(max(abs(H), abs(V)))
for i in range(min(abs(H), abs(V))):
	print(question(H < 0, 'L', 'R') + question(V < 0, 'D', 'U'))
for i in range(abs(abs(H) - abs(V))):
	if abs(H) > abs(V):
		print(question(H < 0, 'L', 'R'))
	else:
		print(question(V < 0, 'D', 'U'))
exit(0)


cols = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
start_position = input()
end_position = input()
start_position_col = int(cols[start_position[0]])
start_position_row = int(start_position[1])
end_position_col = int(cols[end_position[0]])
end_position_row = int(end_position[1])
dirs = list()
if start_position_col - end_position_col > 0:
	col_dir = 'L'
elif start_position_col - end_position_col < 0:
	col_dir = 'R'
else:
	col_dir = ''
if col_dir:
	for i in range(abs(end_position_col - start_position_col)):
		dirs.append(col_dir)
if start_position_row - end_position_row > 0:
	row_dir = 'D'
elif start_position_row - end_position_row < 0:
	row_dir = 'U'
else:
	row_dir = ''
if row_dir:
	for i in range(abs(end_position_row - start_position_row)):
		dirs.append(row_dir)
for (i, x) in enumerate(dirs):
	if x == 'R' or x == 'L':
		if x == 'R' and 'D' in dirs:
			dirs[i] = 'RD'
			dirs.remove('D')
		elif x == 'R' and 'U' in dirs:
			dirs[i] = 'RU'
			dirs.remove('U')
		elif x == 'L' and 'D' in dirs:
			dirs[i] = 'LD'
			dirs.remove('D')
		elif x == 'L' and 'U' in dirs:
			dirs[i] = 'LU'
			dirs.remove('U')
print(len(dirs))
for x in dirs:
	print(x)


from sys import stdin, stdout, stderr, setrecursionlimit
import inspect, re
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readintarr(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writearr(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
a = ord('a')
(sx, sy) = read()
(tx, ty) = read()
(sx, tx) = [ord(c) - a for c in [sx, tx]]
(sy, ty) = [int(c) - 1 for c in [sy, ty]]
dirx = tx - sx
diry = ty - sy
write(max(abs(dirx), abs(diry)))
while (sx, sy) != (tx, ty):
	mov = ''
	if dirx < 0:
		mov += 'L'
		sx -= 1
	if dirx > 0:
		mov += 'R'
		sx += 1
	if diry < 0:
		mov += 'D'
		sy -= 1
	if diry > 0:
		mov += 'U'
		sy += 1
	write(mov)
	dirx = tx - sx
	diry = ty - sy


def parse(cell):
	return (ord(cell[0]) - ord('a') + 1, int(cell[1]))
(src_x, src_y) = parse(input())
(dst_x, dst_y) = parse(input())

def moves(src_x, src_y, dst_x, dst_y):
	while src_x != dst_x or src_y != dst_y:
		move = ''
		if src_x != dst_x:
			move += 'R' if dst_x > src_x else 'L'
			src_x += 1 if dst_x > src_x else -1
		if src_y != dst_y:
			move += 'U' if dst_y > src_y else 'D'
			src_y += 1 if dst_y > src_y else -1
		yield move
m = list(moves(src_x, src_y, dst_x, dst_y))
print(len(m))
print('\n'.join(m))


s1 = input()
x1 = s1[0]
y1 = s1[1]
s2 = input()
x2 = s2[0]
y2 = s2[1]
xchange = ord(x2) - ord(x1)
if xchange > 0:
	xstring = 'R' * xchange
elif xchange < 0:
	xstring = 'L' * (-1 * xchange)
else:
	xstring = ''
ychange = ord(y2) - ord(y1)
if ychange > 0:
	ystring = 'U' * ychange
elif ychange < 0:
	ystring = 'D' * (-1 * ychange)
else:
	ystring = ''
print(max(len(xstring), len(ystring)))
for i in range(7):
	output = ''
	if len(xstring) > i:
		output += xstring[i]
	if len(ystring) > i:
		output += ystring[i]
	if len(output) > 0:
		print(output)


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


a = input()
b = input()
g = list(a)
u = list(b)
x = int(g[1])
y = int(u[1])
if x - y > 0:
	h = 'D'
else:
	h = 'U'
q = ord(g[0])
z = ord(u[0])
if q - z > 0:
	v = 'L'
else:
	v = 'R'
dif2 = abs(q - z)
dif1 = abs(x - y)
if dif1 > dif2:
	print(dif1)
	count = 0
	for i in range(0, dif2):
		count += 1
		print(v + h)
	while count < dif1:
		print(h)
		count += 1
else:
	print(dif2)
	cou2 = 0
	for i in range(0, dif1):
		cou2 += 1
		print(v + h)
	while cou2 < dif2:
		print(v)
		cou2 += 1


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('D')
elif 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)


w1 = list(input())
w2 = list(input())
import math
motion = {(1, -1): 'RD', (-1, -1): 'LD', (1, 1): 'RU', (-1, 1): 'LU'}
horizontal = ord(w2[0]) - ord(w1[0])
vertical = int(w2[1]) - int(w1[1])
first_move = min(abs(horizontal), abs(vertical))
signs = (math.copysign(1, horizontal), math.copysign(1, vertical))
complex_move = motion[signs]
anslist = []
for i in range(first_move):
	anslist.append(complex_move)
horizontal = signs[0] * (abs(horizontal) - first_move)
vertical = signs[1] * (abs(vertical) - first_move)
horizontal = int(horizontal)
vertical = int(vertical)
if any((horizontal, vertical)):
	if horizontal:
		if horizontal > 0:
			anslist.extend(['R'] * horizontal)
		else:
			anslist.extend(['L'] * abs(horizontal))
	elif vertical > 0:
		anslist.extend(['U'] * vertical)
	else:
		anslist.extend(['D'] * abs(vertical))
print(len(anslist))
for i in anslist:
	print(i)


def check(x, y):
	return x >= 1 and x <= 8 and (y >= 1) and (y <= 8)
s = input()
t = input()
x1 = ord(s[0]) - ord('a') + 1
x2 = ord(t[0]) - ord('a') + 1
y1 = int(s[1])
y2 = int(t[1])
d = dict()
a = ['L', 'R', 'U', 'D', 'LU', 'LD', 'RU', 'RD']
x = [-1, 1, 0, 0, -1, -1, 1, 1]
y = [0, 0, 1, -1, 1, -1, 1, -1]
print(max(abs(x1 - x2), abs(y1 - y2)))
while x1 != x2 or y1 != y2:
	m = 9000
	for j in range(8):
		x3 = x1 + x[j]
		y3 = y1 + y[j]
		if check(x3, y3) and abs(x3 - x2) + abs(y3 - y2) < m:
			m = abs(x3 - x2) + abs(y3 - y2)
			jmin = j
	x1 = x1 + x[jmin]
	y1 = y1 + y[jmin]
	print(a[jmin])


t = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h')
r = ('1', '2', '3', '4', '5', '6', '7', '8')
w = input()
init = t.index(w[0])
inir = r.index(w[1])
e = input()
fint = t.index(e[0])
finr = r.index(e[1])
qw = fint - init
ew = finr - inir
ty = max(qw, ew)
l = list()
rdy = min(qw, -ew)
ruy = min(qw, ew)
luy = min(-qw, ew)
ldy = min(-qw, -ew)
for i in range(rdy):
	l.append('RD')
	qw = qw - 1
	ew += 1
for i in range(ruy):
	l.append('RU')
	qw = qw - 1
	ew -= 1
for i in range(luy):
	l.append('LU')
	qw = qw + 1
	ew -= 1
for i in range(ldy):
	l.append('LD')
	qw = qw + 1
	ew += 1
if qw > 0:
	for i in range(qw):
		l.append('R')
else:
	for i in range(-qw):
		l.append('L')
if ew > 0:
	for i in range(ew):
		l.append('U')
else:
	for i in range(-ew):
		l.append('D')
print(len(l))
for i in range(len(l)):
	print(l[i])


import queue

def adjv(v):
	if v[0] > 0:
		yield (v[0] - 1, v[1])
	if v[0] < 7:
		yield (v[0] + 1, v[1])
	if v[1] > 0:
		yield (v[0], v[1] - 1)
	if v[1] < 7:
		yield (v[0], v[1] + 1)
	if v[0] > 0 and v[1] > 0:
		yield (v[0] - 1, v[1] - 1)
	if v[0] < 7 and v[1] < 7:
		yield (v[0] + 1, v[1] + 1)
	if v[0] > 0 and v[1] < 7:
		yield (v[0] - 1, v[1] + 1)
	if v[0] < 7 and v[1] > 0:
		yield (v[0] + 1, v[1] - 1)

def sp(sr, tr):
	dist = dict()
	prev = dict()
	for i in range(8):
		for j in range(8):
			dist[i, j] = float('inf')
			prev[i, j] = None
	dist[sr] = 0
	prev[sr] = None
	q = queue.Queue(maxsize=0)
	q.put(sr)
	while not q.empty():
		cv = q.get()
		for nv in adjv(cv):
			nl = dist[cv] + 1
			if nl < dist[nv]:
				dist[nv] = nl
				prev[nv] = cv
				q.put(nv)
	print(dist[tr])
	rt = list()
	pv = prev[tr]
	while pv:
		if pv[0] < tr[0] and pv[1] < tr[1]:
			rt.append('RU')
		elif pv[0] > tr[0] and pv[1] > tr[1]:
			rt.append('LD')
		elif pv[0] > tr[0] and pv[1] < tr[1]:
			rt.append('LU')
		elif pv[0] < tr[0] and pv[1] > tr[1]:
			rt.append('RD')
		elif pv[0] < tr[0] and pv[1] == tr[1]:
			rt.append('R')
		elif pv[0] > tr[0] and pv[1] == tr[1]:
			rt.append('L')
		elif pv[0] == tr[0] and pv[1] < tr[1]:
			rt.append('U')
		elif pv[0] == tr[0] and pv[1] > tr[1]:
			rt.append('D')
		else:
			rt.append('')
		tr = pv
		pv = prev[tr]
	for move in reversed(rt):
		print(move)
l1 = input().strip()
l2 = input().strip()
x1 = ord(l1[0]) - 97
y1 = int(l1[1]) - 1
x2 = ord(l2[0]) - 97
y2 = int(l2[1]) - 1
sp((x1, y1), (x2, y2))


leaving = input()
attending = input()
list = [1, 2, 3, 4, 5, 6, 7, 8]
d = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
a0 = int(d[attending[0]])
l0 = int(d[leaving[0]])
a1 = int(attending[1])
l1 = int(leaving[1])
if abs(l1 - a1) >= abs(l0 - a0):
	p = abs(a1 - l1)
else:
	p = abs(a0 - l0)
print(p)
if a0 >= l0 and a1 >= l1:
	if a0 - l0 > a1 - l1:
		for i in range(0, a1 - l1):
			print('RU')
		for i in range(a1 - l1, p):
			print('R')
	elif a0 - l0 == a1 - l1:
		for i in range(0, p):
			print('RU')
	else:
		for i in range(0, a0 - l0):
			print('RU')
		for i in range(a0 - l0, p):
			print('U')
elif a0 <= l0 and a1 >= l1:
	if -a0 + l0 > a1 - l1:
		for i in range(0, a1 - l1):
			print('LU')
		for i in range(a1 - l1, p):
			print('L')
	elif l0 - a0 == a1 - l1:
		for i in range(0, p):
			print('LU')
	else:
		for i in range(0, l0 - a0):
			print('LU')
		for i in range(l0 - a0, p):
			print('U')
elif a0 <= l0 and a1 <= l1:
	if l0 - a0 > l1 - a1:
		for i in range(0, l1 - a1):
			print('LD')
		for i in range(l1 - a1, p):
			print('L')
	elif l0 - a0 == l1 - a1:
		for i in range(0, p):
			print('LD')
	else:
		for i in range(0, l0 - a0):
			print('LD')
		for i in range(l0 - a0, p):
			print('D')
elif a0 >= l0 and a1 <= l1:
	if a0 - l0 > -a1 + l1:
		for i in range(0, -a1 + l1):
			print('RD')
		for i in range(-a1 + l1, p):
			print('R')
	elif a0 - l0 == -a1 + l1:
		for i in range(0, p):
			print('RD')
	else:
		for i in range(0, a0 - l0):
			print('RD')
		for i in range(a0 - l0, p):
			print('D')


s = list(map(ord, list(input())))
t = list(map(ord, list(input())))
a = s[0] - t[0]
b = s[1] - t[1]
M = max(abs(a), abs(b))
m = min(abs(a), abs(b))
x = 'LR'[a < 0]
y = 'DU'[b < 0]
if abs(a) == M:
	z = x
else:
	z = y
print(M)
for _ in range(m):
	print(x + y)
for _ in range(M - m):
	print(z)


dic = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
s = input()
t = input()
horz = dic[t[0]] - dic[s[0]]
vert = int(t[1]) - int(s[1])
mini = min(abs(horz), abs(vert))
maxi = max(abs(horz), abs(vert))
arr = []
if horz == 0:
	if vert < 0:
		for i in range(maxi):
			arr.append('D')
	else:
		for i in range(maxi):
			arr.append('U')
elif vert == 0:
	if horz < 0:
		for i in range(maxi):
			arr.append('L')
	else:
		for i in range(maxi):
			arr.append('R')
elif horz > 0:
	if vert > 0:
		for i in range(mini):
			arr.append('RU')
		if abs(horz) > abs(vert):
			for i in range(maxi - mini):
				arr.append('R')
		else:
			for i in range(maxi - mini):
				arr.append('U')
	else:
		for i in range(mini):
			arr.append('RD')
		if abs(horz) > abs(vert):
			for i in range(maxi - mini):
				arr.append('R')
		else:
			for i in range(maxi - mini):
				arr.append('D')
elif vert > 0:
	for i in range(mini):
		arr.append('LU')
	if abs(horz) > abs(vert):
		for i in range(maxi - mini):
			arr.append('L')
	else:
		for i in range(maxi - mini):
			arr.append('U')
else:
	for i in range(mini):
		arr.append('LD')
	if abs(horz) > abs(vert):
		for i in range(maxi - mini):
			arr.append('L')
	else:
		for i in range(maxi - mini):
			arr.append('D')
print(len(arr))
for i in arr:
	print(i)


(p1, p2) = (input(), input())
x = ord(p2[0]) - ord(p1[0])
y = int(p2[1]) - int(p1[1])
print(max(abs(x), abs(y)))
if x >= 0 and y >= 0:
	for i in range(min(x, y)):
		print('RU')
	for i in range(abs(x - y)):
		print('U') if y >= x else print('R')
elif x >= 0 and y < 0:
	for i in range(min(x, abs(y))):
		print('RD')
	for i in range(abs(x - abs(y))):
		print('D') if abs(y) >= x else print('R')
elif x < 0 and y >= 0:
	for i in range(min(abs(x), y)):
		print('LU')
	for i in range(abs(abs(x) - y)):
		print('U') if y >= abs(x) else print('L')
else:
	for i in range(min(abs(x), abs(y))):
		print('LD')
	for i in range(abs(abs(x) - abs(y))):
		print('D') if abs(y) >= abs(x) else print('L')


import sys

def rl(int_: bool=True):
	if int_:
		return [int(w) for w in sys.stdin.readline().split()]
	return [w for w in sys.stdin.readline().split()]
s = rl(False)[0]
t = rl(False)[0]
(sc, sr) = (ord(s[0]) - ord('a') + 1, int(s[1]))
(tc, tr) = (ord(t[0]) - ord('a') + 1, int(t[1]))
count = 0
steps = []
while sc != tc or sr != tr:
	step = ''
	if sc < tc:
		step = 'R'
		sc += 1
	elif sc > tc:
		step = 'L'
		sc -= 1
	if sr < tr:
		step += 'U'
		sr += 1
	elif sr > tr:
		step += 'D'
		sr -= 1
	steps.append(step)
	count += 1
print(count)
for step in steps:
	print(step)


s = input()
d = input()
s0 = int(ord(s[0]) - 96)
s1 = int(s[1])
d1 = int(d[1])
d0 = int(ord(d[0]) - 96)
em = min(abs(s0 - d0), abs(s1 - d1))
tm = min(abs(s0 - d0), abs(s1 - d1)) + abs(abs(s0 - d0) - abs(s1 - d1))
print(tm)
if s0 > d0:
	k = ['L']
else:
	k = ['R']
if s1 > d1:
	k.append('D')
else:
	k.append('U')
for i in range(em):
	print(''.join(k))
if abs(s0 - d0) > abs(s1 - d1):
	if s0 > d0:
		g = 'L'
	else:
		g = 'R'
elif s1 > d1:
	g = 'D'
else:
	g = 'U'
for i in range(tm - em):
	print(g)


x0y0 = input()
xy = input()
x0y0 = [ord(x0y0[0]) - ord('a') + 1, int(x0y0[1])]
xy = [ord(xy[0]) - ord('a') + 1, int(xy[1])]
n = max(abs(x0y0[0] - xy[0]), abs(x0y0[1] - xy[1]))
print(abs(n))
for i in range(0, n):
	if xy[0] > x0y0[0] and xy[1] > x0y0[1]:
		print('RU')
		x0y0[0] += 1
		x0y0[1] += 1
	if xy[0] < x0y0[0] and xy[1] < x0y0[1]:
		print('LD')
		x0y0[0] -= 1
		x0y0[1] -= 1
	if xy[0] < x0y0[0] and xy[1] > x0y0[1]:
		print('LU')
		x0y0[0] -= 1
		x0y0[1] += 1
	if xy[0] > x0y0[0] and xy[1] < x0y0[1]:
		print('RD')
		x0y0[0] += 1
		x0y0[1] -= 1
	if xy[0] > x0y0[0] and xy[1] == x0y0[1]:
		print('R')
		x0y0[0] += 1
	if xy[0] < x0y0[0] and xy[1] == x0y0[1]:
		print('L')
		x0y0[0] -= 1
	if xy[1] > x0y0[1] and xy[0] == x0y0[0]:
		print('U')
		x0y0[1] += 1
	if xy[1] < x0y0[1] and xy[0] == x0y0[0]:
		print('D')
		x0y0[1] -= 1


s = input()
t = input()
a = ord(s[0]) - 96
b = ord(t[0]) - 96
x = int(s[1])
y = int(t[1])
print(max(abs(x - y), abs(a - b)))
while x != y or a != b:
	s = ''
	if a < b:
		a += 1
		s += 'R'
	elif a > b:
		a -= 1
		s += 'L'
	if x > y:
		x -= 1
		s += 'D'
	elif x < y:
		x += 1
		s += 'U'
	print(s)


a = input()
b = input()
a = [ord(a[0]) - ord('a') + 1, int(a[1])]
b = [ord(b[0]) - ord('a') + 1, int(b[1])]
c = [b[0] - a[0], b[1] - a[1]]
mn = min(abs(c[0]), abs(c[1]))
k = mn
k += max(abs(c[0]) - mn, abs(c[1]) - mn)
print(k)
while (abs(c[0]) > 0) | (abs(c[1]) > 0):
	ans = ''
	if c[0] > 0:
		ans += 'R'
		c[0] -= 1
	elif c[0] < 0:
		ans += 'L'
		c[0] += 1
	if c[1] > 0:
		ans += 'U'
		c[1] -= 1
	elif c[1] < 0:
		ans += 'D'
		c[1] += 1
	print(ans)


import sys
dic = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
s = input()
s1 = s[0]
s2 = s[1]
s = (dic[s1], int(s2))
e = input()
e1 = e[0]
e2 = e[1]
e = (dic[e1], int(e2))
xdiffer = s[0] - e[0]
ydiffer = s[1] - e[1]
output = []
while xdiffer > 0:
	output.append('L')
	xdiffer -= 1
while ydiffer > 0:
	output.append('D')
	ydiffer -= 1
while xdiffer < 0:
	output.append('R')
	xdiffer += 1
while ydiffer < 0:
	output.append('U')
	ydiffer += 1
while 'U' in output:
	flag = True
	if 'L' in output:
		output.remove('U')
		output.remove('L')
		output.append('LU')
		flag = False
	if 'R' in output:
		output.remove('U')
		output.remove('R')
		output.append('RU')
		flag = False
	if flag:
		break
while 'D' in output:
	flag = True
	if 'L' in output:
		output.remove('D')
		output.remove('L')
		output.append('LD')
		flag = False
	if 'R' in output:
		output.remove('D')
		output.remove('R')
		output.append('RD')
		flag = False
	if flag:
		break
print(len(output))
for i in output:
	print(i)


def ter(n, sn, sz, sp):
	return sn if n < 0 else sz if n == 0 else sp

def sign(n):
	return ter(n, -1, 0, 1)
s = input()
t = input()
s = [ord(s[0]) - ord('a') + 1, int(s[1])]
t = [ord(t[0]) - ord('a') + 1, int(t[1])]
print(max(abs(s[0] - t[0]), abs(s[1] - t[1])))
while s != t:
	d0 = sign(t[0] - s[0])
	d1 = sign(t[1] - s[1])
	s[0] += d0
	s[1] += d1
	print(ter(d0, 'L', '', 'R') + ter(d1, 'D', '', 'U'))


import operator as op

class ShortestPathComputer:

	def print_path(self):
		print(len(self.path))
		for i in range(len(self.path)):
			print(self.path[i])

	def generate_shortest_path(self):
		curr_coords = self.init_coords
		while self.manhattan_distance(curr_coords, self.final_coords) != 0:
			next = self.next_neighbour(curr_coords)
			curr_coords = self.relative_coords(curr_coords, next)
			self.path.append(next)
		return self

	def next_neighbour(self, coords):
		neighbours = self.list_neighbours(coords)
		(min_neighbour, min_dist) = ('U', ShortestPathComputer.MAX_MANHATTAN_DISTANCE)
		for neighbour in neighbours:
			neighbour_coords = self.relative_coords(coords, neighbour)
			new_dist = self.manhattan_distance(neighbour_coords, self.final_coords)
			if new_dist <= min_dist:
				min_dist = new_dist
				min_neighbour = neighbour
		return min_neighbour

	def list_neighbours(self, coords):
		neighbours = []
		values = list(ShortestPathComputer.relative.values())
		keys = list(ShortestPathComputer.relative.keys())
		neighbours = []
		for i in range(ShortestPathComputer.MAX_NEIGHBOURS):
			(key, value) = (keys[i], values[i])
			if self.coords_are_legit(self.relative_coords(coords, key)):
				neighbours.append(key)
		return neighbours

	def relative_coords(self, coords, marker):
		rel_coords = ShortestPathComputer.relative[marker]
		return tuple(map(op.add, coords, rel_coords))

	def coords_are_legit(self, coords):
		return 0 <= coords[0] < 8 and 0 <= coords[1] < 8

	def manhattan_distance(self, coordsA, coordsB):
		return abs(coordsA[0] - coordsB[0]) + abs(coordsA[1] - coordsB[1])

	def parse_chess_square(self, square):
		(i, j) = tuple(square)
		return (ShortestPathComputer.parseRow[j], ShortestPathComputer.parseCol[i])

	def __init__(self, squareA, squareB):
		self.init_coords = self.parse_chess_square(squareA)
		self.final_coords = self.parse_chess_square(squareB)
		self.path = []
	(MAX_NEIGHBOURS, MAX_MANHATTAN_DISTANCE) = (8, 14)
	parseCol = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}
	parseRow = {'1': 7, '2': 6, '3': 5, '4': 4, '5': 3, '6': 2, '7': 1, '8': 0}
	relative = {'U': (-1, 0), 'D': (1, 0), 'L': (0, -1), 'R': (0, 1), 'RU': (-1, 1), 'RD': (1, 1), 'LU': (-1, -1), 'LD': (1, -1)}
path_finder = ShortestPathComputer(input(), input())
path_finder.generate_shortest_path().print_path()


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')
	if kingPosition == destination:
		print(0)
		return
	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(i)
	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()


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')
		elif 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')
	elif j > 0:
		if abs(i) >= abs(j):
			for _ in range(j):
				print('LU')
			for _ in range(abs(i + j)):
				print('L')
		else:
			for _ in range(abs(i)):
				print('LU')
			for _ in range(abs(i + j)):
				print('U')
	elif 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')


cor = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
s = list(input())
t = list(input())
(x1, y1) = (cor[s[0]], int(s[1]))
(x2, y2) = (cor[t[0]], int(t[1]))
count = 0
moves = []
if x2 > x1:
	if y2 > y1:
		while x1 != x2 and y1 != y2:
			x1 += 1
			y1 += 1
			count += 1
			moves.append('RU')
		else:
			if x1 != x2:
				while x1 != x2:
					x1 += 1
					moves.append('R')
					count += 1
			else:
				while y1 != y2:
					y1 += 1
					moves.append('U')
					count += 1
	else:
		while x1 != x2 and y1 != y2:
			x1 += 1
			y1 -= 1
			count += 1
			moves.append('RD')
		else:
			if x1 != x2:
				while x1 != x2:
					x1 += 1
					moves.append('R')
					count += 1
			else:
				while y1 != y2:
					y1 -= 1
					moves.append('D')
					count += 1
elif y2 > y1:
	while x1 != x2 and y1 != y2:
		x1 -= 1
		y1 += 1
		count += 1
		moves.append('LU')
	else:
		if x1 != x2:
			while x1 != x2:
				x1 -= 1
				moves.append('L')
				count += 1
		else:
			while y1 != y2:
				y1 += 1
				moves.append('U')
				count += 1
else:
	while x1 != x2 and y1 != y2:
		x1 -= 1
		y1 -= 1
		count += 1
		moves.append('LD')
	else:
		if x1 != x2:
			while x1 != x2:
				x1 -= 1
				moves.append('L')
				count += 1
		else:
			while y1 != y2:
				y1 -= 1
				moves.append('D')
				count += 1
print(count)
for move in moves:
	print(move)


a = input()
b = input()
s = 'abcdefgh'
i = int(0)
c = []
for i in range(0, len(s)):
	if a[0] == s[i]:
		a = [i + 1, a[1]]
	if b[0] == s[i]:
		b = [i + 1, b[1]]
g = [int(a[0]) - int(b[0]), int(a[1]) - int(b[1])]
if g[1] < 0:
	c.append(-g[1])
else:
	c.append(g[1])
if g[0] < 0:
	c.append(-g[0])
else:
	c.append(g[0])
print(max(c))
for i in range(0, 8):
	if g[0] == 0 and g[1] == 0:
		break
	elif g[0] != 0 and g[1] != 0:
		if g[0] > 0:
			k = 'L'
			g[0] -= 1
		else:
			k = 'R'
			g[0] += 1
		if g[1] > 0:
			k = k + 'D'
			g[1] -= 1
		else:
			k = k + 'U'
			g[1] += 1
		print(k)
	else:
		if g[0] != 0:
			if g[0] > 0:
				k = 'L'
				g[0] -= 1
			else:
				k = 'R'
				g[0] += 1
			print(k)
		if g[1] != 0:
			if g[1] > 0:
				k = 'D'
				g[1] -= 1
			else:
				k = 'U'
				g[1] += 1
			print(k)


s = input()
t = input()
fx = 'LRUD'
hd = ord(t[0]) - ord(s[0])
vd = ord(t[1]) - ord(s[1])
hd_abs = abs(hd)
vd_abs = abs(vd)
n = max(hd_abs, vd_abs)
print(n)
if hd >= 0:
	m = min(hd_abs, vd_abs)
	for i in range(m):
		if vd >= 0:
			print('RU')
		else:
			print('RD')
	for i in range(n - m):
		if hd_abs >= vd_abs:
			print('R')
		elif vd >= 0:
			print('U')
		else:
			print('D')
else:
	m = min(hd_abs, vd_abs)
	for i in range(m):
		if vd >= 0:
			print('LU')
		else:
			print('LD')
	for i in range(n - m):
		if hd_abs >= vd_abs:
			print('L')
		elif vd >= 0:
			print('U')
		else:
			print('D')


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


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)


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


s = input()
t = input()
m = [ord(s[0]) - 96, int(s[1])]
n = [ord(t[0]) - 96, int(t[1])]
s = m
path = []
c = 0
while n != s:
	if s[0] == n[0]:
		if s[1] < n[1]:
			s[1] = s[1] + 1
			path.append('U')
			c += 1
		elif s[1] > n[1]:
			s[1] = s[1] - 1
			path.append('D')
			c += 1
	elif s[1] == n[1]:
		if s[0] < n[0]:
			s[0] = s[0] + 1
			path.append('R')
			c += 1
		elif s[0] > n[0]:
			s[0] = s[0] - 1
			path.append('L')
			c += 1
	elif s[0] < n[0] and s[1] < n[1]:
		s[0] = s[0] + 1
		s[1] = s[1] + 1
		path.append('RU')
		c += 1
	elif s[0] < n[0] and s[1] > n[1]:
		s[0] = s[0] + 1
		s[1] = s[1] - 1
		path.append('RD')
		c += 1
	elif s[0] > n[0] and s[1] < n[1]:
		s[0] = s[0] - 1
		s[1] = s[1] + 1
		path.append('LU')
		c += 1
	elif s[0] > n[0] and s[1] > n[1]:
		s[0] = s[0] - 1
		s[1] = s[1] - 1
		path.append('LD')
		c += 1
print(c)
for i in range(c):
	print(path[i])


s = list(input())
t = list(input())
s[1] = int(s[1])
t[1] = int(t[1])
s[0] = int(ord(s[0]))
t[0] = int(ord(t[0]))
res = []
while True:
	if s[0] == t[0] and s[1] == t[1]:
		break
	tmp = ''
	if s[0] > t[0]:
		s[0] -= 1
		tmp += 'L'
	elif s[0] < t[0]:
		s[0] += 1
		tmp += 'R'
	if s[1] > t[1]:
		s[1] -= 1
		tmp += 'D'
	elif s[1] < t[1]:
		s[1] += 1
		tmp += 'U'
	res.append(tmp)
print(len(res))
for x in res:
	print(x)


L = list(input())
L1 = list(input())
p = ord(L[0]) - ord(L1[0])
s = int(L[1]) - int(L1[1])
L2 = []
max = 0
while s != 0 or p != 0:
	if p > 0 and s > 0:
		max += 1
		L2.append('LD')
		p = p - 1
		s = s - 1
	elif p > 0 and s < 0:
		max += 1
		L2.append('LU')
		p = p - 1
		s = s + 1
	elif p > 0 and s == 0:
		max += 1
		L2.append('L')
		p = p - 1
	elif p < 0 and s > 0:
		max += 1
		L2.append('RD')
		p = p + 1
		s = s - 1
	elif p < 0 and s < 0:
		max += 1
		L2.append('RU')
		p = p + 1
		s = s + 1
	elif p == 0 and s < 0:
		max += 1
		L2.append('U')
		s = s + 1
	elif p < 0 and s == 0:
		max += 1
		L2.append('R')
		p = p + 1
	elif p == 0 and s > 0:
		max += 1
		L2.append('D')
		s = s - 1
print(max)
for j in L2:
	print(j + '\n')


symbols = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}
n = m = 8
x = input()
x0 = symbols[x[0]]
y0 = int(x[1]) - 1
c = input()
x = symbols[c[0]]
y = int(c[1]) - 1
print(max(abs(x - x0), abs(y - y0)))
while True:
	if (x == x0) & (y == y0):
		break
	if x > x0:
		x0 = x0 + 1
		print('R', end='')
	elif x < x0:
		x0 = x0 - 1
		print('L', end='')
	if y > y0:
		y0 = y0 + 1
		print('U', end='')
	elif y < y0:
		y0 = y0 - 1
		print('D', end='')
	print()


def sgn(x):
	return 1 if x > 0 else 0 if not x else -1
(s, t) = (input(), input())
(cs, rs) = (ord(s[0]) - 96, int(s[1]))
(ct, rt) = (ord(t[0]) - 96, int(t[1]))
(dc, dr) = (ct - cs, rt - rs)
print(max(abs(dc), abs(dr)))
while dc or dr:
	if dc:
		print('R' if dc > 0 else 'L', end='')
		dc -= sgn(dc)
	if dr:
		print('U' if dr > 0 else 'D', end='')
		dr -= sgn(dr)
	print()


def valid_coordinates():
	if (col_source < 'a' or col_source > 'h') or (col_destination < 'a' or col_destination > 'h') or (row_source < 1 or row_source > 8) or (row_destination < 1 or row_destination > 8):
		return 0
	else:
		return 1

def is_done():
	if source == destination:
		return 1
	else:
		return 0

def is_same_col():
	if col_source == col_destination:
		moves = row_destination - row_source
		no_moves = abs(moves)
		list.append(['D' if moves < 0 else 'U', no_moves])
		count.append(no_moves)
		return 1
	else:
		return 0

def is_same_row():
	if row_source == row_destination:
		moves = ord(col_destination) - ord(col_source)
		no_moves = abs(moves)
		list.append(['R' if moves > 0 else 'L', no_moves])
		count.append(no_moves)
		return 1
	else:
		return 0

def is_same_diagonal():
	no_moves = row_source - row_destination
	no_cols = ord(col_destination) - ord(col_source)
	if no_moves == no_cols:
		list.append([('R' if no_cols > 0 else 'L') + ('D' if no_moves > 0 else 'U'), abs(no_moves)])
		count.append(abs(no_moves))
		return 1
	else:
		return 0

def regular_move():
	global source
	global col_source
	global row_source
	if col_destination > col_source:
		R_or_L = 'R'
		new_col_val = chr(ord(source[0]) + 1)
	else:
		R_or_L = 'L'
		new_col_val = chr(ord(source[0]) - 1)
	if row_destination > row_source:
		D_or_U = 'U'
		new_row_val = row_source + 1
	else:
		D_or_U = 'D'
		new_row_val = row_source - 1
	source = new_col_val + str(new_row_val)
	col_source = source[0]
	row_source = int(source[1:])
	list.append([R_or_L + D_or_U, 1])
	count.append(1)
source = input()
destination = input()
col_destination = destination[0]
row_destination = int(destination[1:])
col_source = source[0]
row_source = int(source[1:])
if valid_coordinates():
	list = []
	count = []
	while not is_done():
		if is_same_col():
			source = destination
		elif is_same_row():
			source = destination
		elif is_same_diagonal():
			source = destination
		else:
			regular_move()
print(sum(count))
for value in list:
	print((value[0] + '\n') * value[1], end='')


start = input()
end = input()
alist = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h')
startx = alist.index(start[0]) + 1
endx = alist.index(end[0]) + 1
starty = int(start[1])
endy = int(end[1])
xdirection = 0
ydirection = 0
xtimes = 0
ytimes = 0
outputlist = []
if startx > endx:
	xdirection = 'L'
	xtimes = startx - endx
elif startx < endx:
	xdirection = 'R'
	xtimes = endx - startx
if starty > endy:
	ydirection = 'D'
	ytimes = starty - endy
elif starty < endy:
	ytimes = endy - starty
	ydirection = 'U'
if xtimes == ytimes:
	for x in range(xtimes):
		outputlist.append(xdirection + ydirection)
elif xtimes < ytimes:
	for x in range(xtimes):
		outputlist.append(xdirection + ydirection)
	for x in range(ytimes - xtimes):
		outputlist.append(ydirection)
elif xtimes > ytimes:
	for x in range(ytimes):
		outputlist.append(xdirection + ydirection)
	for x in range(xtimes - ytimes):
		outputlist.append(xdirection)
outputlist.insert(0, len(outputlist))
for y in outputlist:
	print(y)


def main():
	sq1 = input()
	sq2 = input()
	dr = int(sq1[1]) - int(sq2[1])
	move = dict()
	cs = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
	dc = int(cs[sq1[0]]) - int(cs[sq2[0]])
	if dr > 0:
		move['row'] = 'D'
	elif dr == 0:
		move['row'] = ''
	else:
		move['row'] = 'U'
	if dc > 0:
		move['column'] = 'L'
	elif dc == 0:
		move['column'] = ''
	else:
		move['column'] = 'R'
	rm = abs(abs(dr) - abs(dc))
	zm = max(abs(dr), abs(dc)) - rm
	print(rm + zm)
	for i in range(zm):
		print(move['column'] + move['row'])
	for j in range(rm):
		if abs(dr) > abs(dc):
			print(move['row'])
		elif abs(dr) < abs(dc):
			print(move['column'])
main()


ini = list(input())
fin = list(input())
a = int(fin[1]) - int(ini[1])
if a > 0:
	mo_2 = 'U'
else:
	mo_2 = 'D'
di = dict(a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8)
b = di[fin[0]] - di[ini[0]]
if b > 0:
	mo_1 = 'R'
else:
	mo_1 = 'L'
maxx = max(abs(a), abs(b))
minn = min(abs(a), abs(b))
print(maxx)
for i in range(minn):
	print(mo_1 + mo_2)
for i in range(maxx - minn):
	if abs(a) > abs(b):
		print(mo_2)
	else:
		print(mo_1)


__author__ = 'linh'

def main():
	start = input()
	stop = input()
	if ord(start[0]) > 105 or ord(start[0]) < 97:
		print(ord(start[0]))
		return
	else:
		start_row = ord(start[0]) - 96
	if int(start[1]) > 8 or int(start[1]) < 1:
		return
	else:
		start_col = int(start[1])
	if ord(stop[0]) > 105 or ord(stop[0]) < 97:
		return
	else:
		stop_row = ord(stop[0]) - 96
	if int(stop[1]) > 8 or int(stop[1]) < 1:
		return
	else:
		stop_col = int(stop[1])
	i = abs(start_row - stop_row)
	j = abs(start_col - stop_col)
	step1 = min(i, j)
	print(max(i, j))
	if start_row <= stop_row:
		if start_col <= stop_col:
			while step1 != 0:
				print('RU')
				step1 -= 1
			if i <= j:
				step2 = j - i
				while step2 != 0:
					print('U')
					step2 -= 1
			else:
				step2 = i - j
				while step2 != 0:
					print('R')
					step2 -= 1
		else:
			while step1 != 0:
				print('RD')
				step1 -= 1
			if i <= j:
				step2 = j - i
				while step2 != 0:
					print('D')
					step2 -= 1
			else:
				step2 = i - j
				while step2 != 0:
					print('R')
					step2 -= 1
	elif start_col <= stop_col:
		while step1 != 0:
			print('LU')
			step1 -= 1
		if i <= j:
			step2 = j - i
			while step2 != 0:
				print('U')
				step2 -= 1
		else:
			step2 = i - j
			while step2 != 0:
				print('L')
				step2 -= 1
	else:
		while step1 != 0:
			print('LD')
			step1 -= 1
		if i <= j:
			step2 = j - i
			while step2 != 0:
				print('D')
				step2 -= 1
		else:
			step2 = i - j
			while step2 != 0:
				print('L')
				step2 -= 1
main()


s = input()
t = input()
lis = []
while s != t:
	r = ''
	if s[0] > t[0]:
		r += 'L'
		s = chr(ord(s[0]) - 1) + s[1]
	elif s[0] < t[0]:
		r += 'R'
		s = chr(ord(s[0]) + 1) + s[1]
	if s[1] > t[1]:
		r += 'D'
		s = s[0] + chr(ord(s[1]) - 1)
	elif s[1] < t[1]:
		r += 'U'
		s = s[0] + chr(ord(s[1]) + 1)
	lis.append(r)
print(len(lis))
for i in range(len(lis)):
	print(lis[i])


(s, t) = (input(), input())
(sx, sy) = (ord(s[0]) - ord('A'), int(s[1]))
(tx, ty) = (ord(t[0]) - ord('A'), int(t[1]))
moves = []
while (sx, sy) != (tx, ty):
	m = ''
	if sx < tx:
		m += 'R'
		sx += 1
	elif sx > tx:
		m += 'L'
		sx -= 1
	if sy < ty:
		m += 'U'
		sy += 1
	elif sy > ty:
		m += 'D'
		sy -= 1
	moves.append(m)
print(len(moves))
for m in moves:
	print(m)


c1 = input()
c2 = input()
d = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
(x0, y0) = (d[c1[0]], int(c1[1]))
(x, y) = (d[c2[0]], int(c2[1]))
print(max(abs(x - x0), abs(y - y0)))
while x != x0 or y != y0:
	if x0 < x:
		print('R', end='')
		x0 += 1
	elif x0 > x:
		print('L', end='')
		x0 -= 1
	if y0 < y:
		print('U', end='')
		y0 += 1
	elif y0 > y:
		print('D', end='')
		y0 -= 1
	print()


(a, b) = (input(), input())
print(max(abs(ord(a[0]) - ord(b[0])), abs(ord(a[1]) - ord(b[1]))))
while 1:
	if a == b:
		break
	if a[0] < b[0]:
		print('R', end='')
		a = chr(ord(a[0]) + 1) + a[1]
	elif a[0] > b[0]:
		print('L', end='')
		a = chr(ord(a[0]) - 1) + a[1]
	if int(a[1]) < int(b[1]):
		print('U', end='')
		a = a[0] + chr(ord(a[1]) + 1)
	elif int(a[1]) > int(b[1]):
		print('D', end='')
		a = a[0] + chr(ord(a[1]) - 1)
	print('')


def get_pos():
	(j, i) = input()
	j = ord(j) - ord('a')
	i = 8 - int(i)
	return (i, j)
(i1, j1) = get_pos()
(i2, j2) = get_pos()
steps = 0
res = []
while i1 != i2 or j1 != j2:
	ret = []
	if j1 < j2:
		ret.append('R')
		j1 += 1
	if j1 > j2:
		ret.append('L')
		j1 -= 1
	if i1 < i2:
		ret.append('D')
		i1 += 1
	if i1 > i2:
		ret.append('U')
		i1 -= 1
	res.append(''.join(ret))
	steps += 1
print(steps)
for ret in res:
	print(ret)


sgn = lambda x: 1 if x > 0 else -1 if x < 0 else 0
DIR = {(-1, 1): 'LU', (0, 1): 'U', (1, 1): 'RU', (-1, 0): 'L', (1, 0): 'R', (-1, -1): 'LD', (0, -1): 'D', (1, -1): 'RD'}
(s, t) = (input(), input())
(x, y) = (ord(s[0]) - ord(t[0]), ord(s[1]) - ord(t[1]))
print(max(abs(x), abs(y)))
while x or y:
	(dx, dy) = (-sgn(x), -sgn(y))
	(x, y) = (x + dx, y + dy)
	print(DIR[dx, dy])


def ter(n, an, az, ap):
	return an if n < 0 else az if n == 0 else ap

def sign(x):
	return ter(x, -1, 0, 1)
s = input()
t = input()
s = [ord(s[0]) - ord('a') + 1, int(s[1])]
t = [ord(t[0]) - ord('a') + 1, int(t[1])]
print(max(abs(s[0] - t[0]), abs(s[1] - t[1])))
while s != t:
	d0 = sign(t[0] - s[0])
	d1 = sign(t[1] - s[1])
	print(ter(d0, 'L', '', 'R') + ter(d1, 'D', '', 'U'))
	s[0] += d0
	s[1] += d1


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


import math
a = input()
b = input()
x1 = ord(a[0]) - ord('a')
y1 = int(a[1]) - 1
x2 = ord(b[0]) - ord('a')
y2 = int(b[1]) - 1
print(max(abs(x1 - x2), abs(y1 - y2)))
while x1 != x2 or y1 != y2:
	if x1 < x2:
		print('R', end='')
		x1 += 1
	elif x1 > x2:
		print('L', end='')
		x1 -= 1
	if y1 > y2:
		print('D', end='')
		y1 -= 1
	elif y1 < y2:
		print('U', end='')
		y1 += 1
	print()


a = list(input())
b = list(input())
w = ord(a[0]) - 96
x = int(a[1])
y = ord(b[0]) - 96
z = int(b[1])
s = 0
t = 0
A = y - w
if A < 0:
	s = 1
B = z - x
if B < 0:
	t = 1
if s == 0 and t == 0:
	u = 'RU'
	if abs(A) > abs(B):
		v = 'R'
	else:
		v = 'U'
elif s == 1 and t == 0:
	u = 'LU'
	if abs(A) > abs(B):
		v = 'L'
	else:
		v = 'U'
elif s == 1 and t == 1:
	u = 'LD'
	if abs(A) > abs(B):
		v = 'L'
	else:
		v = 'D'
elif s == 0 and t == 1:
	u = 'RD'
	if abs(A) > abs(B):
		v = 'R'
	else:
		v = 'D'
q = min(abs(A), abs(B))
e = abs(abs(A) - abs(B))
print(q + e)
for i in range(q):
	print(u)
for i in range(e):
	print(v)


horizontalMapping = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
source = input()
dest = input()
source = [horizontalMapping[source[0]], int(source[1])]
dest = [horizontalMapping[dest[0]], int(dest[1])]
print(max(abs(int(source[1]) - int(dest[1])), abs(int(source[0]) - dest[0])))
while not (source[0] == dest[0] and source[1] == dest[1]):
	if source[0] < dest[0]:
		print('R', end='')
		source[0] += 1
	elif source[0] > dest[0]:
		print('L', end='')
		source[0] -= 1
	if source[1] < dest[1]:
		print('U', end='')
		source[1] += 1
	elif source[1] > dest[1]:
		print('D', end='')
		source[1] -= 1
	print()


s = list(input())
t = list(input())
s[1] = int(s[1])
t[1] = int(t[1])
s[0] = int(ord(s[0]))
t[0] = int(ord(t[0]))
res = []
while True:
	if s[0] == t[0] and s[1] == t[1]:
		break
	elif s[0] == t[0]:
		if s[1] > t[1]:
			s[1] -= 1
			res.append('D')
		else:
			s[1] += 1
			res.append('U')
	elif s[1] == t[1]:
		if s[0] > t[0]:
			s[0] -= 1
			res.append('L')
		else:
			s[0] += 1
			res.append('R')
	elif s[0] > t[0] and s[1] > t[1]:
		s[0] -= 1
		s[1] -= 1
		res.append('LD')
	elif s[0] > t[0] and s[1] < t[1]:
		s[0] -= 1
		s[1] += 1
		res.append('LU')
	elif s[0] < t[0] and s[1] > t[1]:
		s[0] += 1
		s[1] -= 1
		res.append('RD')
	elif s[0] < t[0] and s[1] < t[1]:
		s[0] += 1
		s[1] += 1
		res.append('RU')
print(len(res))
for x in res:
	print(x)


import sys

def Pathdt(st, fi, dem):
	XX = [1, -1, 0, 0, 1, -1, -1, 1]
	YY = [0, 0, 1, -1, 1, 1, -1, -1]
	DT = ['R', 'L', 'U', 'D', 'RU', 'LU', 'LD', 'RD']
	dt = ((st[0] - fi[0]) ** 2 + (st[1] - fi[1]) ** 2) ** 0.5
	tam = [0, 0, 0]
	for k in range(8):
		dt1 = ((st[0] + XX[k] - fi[0]) ** 2 + (st[1] + YY[k] - fi[1]) ** 2) ** 0.5
		if dt1 < dt:
			dt = dt1
			tam[0] = XX[k]
			tam[1] = YY[k]
			tam[2] = k
	st[0] += tam[0]
	st[1] += tam[1]
	dem += 1
	path.append(DT[tam[2]])
	if st[0] == fi[0] and st[1] == fi[1]:
		print(dem)
		for i in path:
			print(i)
		sys.exit()
	else:
		Pathdt(st, fi, dem)
path = []
s = input()
f = input()
dem = 0
start = [ord(s[0]) - ord('a'), int(s[1])]
finish = [ord(f[0]) - ord('a'), int(f[1])]
if start[0] == finish[0] and start[1] == finish[1]:
	print(dem)
	sys.exit()
Pathdt(start, finish, dem)


(actual_char, actual_int) = input('')
(destino_char, destino_int) = input('')
actual_char = ord(actual_char)
actual_int = int(actual_int)
destino_char = ord(destino_char)
destino_int = int(destino_int)
v = []
cont = 0
while actual_char != destino_char or actual_int != destino_int:
	if actual_char == destino_char:
		if actual_int > destino_int:
			v.append('D')
			actual_int -= 1
		else:
			v.append('U')
			actual_int += 1
	elif actual_int == destino_int:
		if actual_char > destino_char:
			v.append('L')
			actual_char -= 1
		else:
			v.append('R')
			actual_char += 1
	elif actual_char > destino_char and actual_int > destino_int:
		v.append('LD')
		actual_char -= 1
		actual_int -= 1
	elif actual_char < destino_char and actual_int < destino_int:
		v.append('RU')
		actual_char += 1
		actual_int += 1
	elif actual_char > destino_char and actual_int < destino_int:
		v.append('LU')
		actual_char -= 1
		actual_int += 1
	else:
		v.append('RD')
		actual_char += 1
		actual_int -= 1
	cont += 1
print(cont)
for i in range(0, len(v)):
	print(v[i])


s = input()
t = input()

def Char2Num(ch):
	return ord(ch) - ord('a') + 1

def Num2Char(num):
	return chr(ord('a') + num - 1)
s_x = Char2Num(s[0])
s_y = int(s[1])
t_x = Char2Num(t[0])
t_y = int(t[1])
steps = []
x = s_x
y = s_y
while x < t_x and y < t_y:
	steps.append('RU')
	x += 1
	y += 1
while x > t_x and y > t_y:
	steps.append('LD')
	x -= 1
	y -= 1
while x < t_x and y > t_y:
	steps.append('RD')
	x += 1
	y -= 1
while x > t_x and y < t_y:
	steps.append('LU')
	x -= 1
	y += 1
while x < t_x:
	steps.append('R')
	x += 1
while x > t_x:
	steps.append('L')
	x -= 1
while y < t_y:
	steps.append('U')
	y += 1
while y > t_y:
	steps.append('D')
	y -= 1
print(len(steps))
for step in steps:
	print(step)


king = input()
goal = input()
kx = ord(king[0]) - 97
ky = int(king[1]) - 1
gx = ord(goal[0]) - 97
gy = int(goal[1]) - 1
path = []
while True:
	if kx > gx:
		if ky == gy:
			path.append('L')
			kx -= 1
		elif ky > gy:
			path.append('LD')
			kx -= 1
			ky -= 1
		else:
			path.append('LU')
			kx -= 1
			ky += 1
	elif kx < gx:
		if ky == gy:
			path.append('R')
			kx += 1
		elif ky > gy:
			path.append('RD')
			kx += 1
			ky -= 1
		else:
			path.append('RU')
			kx += 1
			ky += 1
	elif ky == gy:
		break
	elif ky < gy:
		path.append('U')
		ky += 1
	else:
		path.append('D')
		ky -= 1
print(len(path))
for i in path:
	print(i)


a = input()
b = input()
(A, B) = ([], [])
dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
for x in a:
	A.append(x)
for x in b:
	B.append(x)
(A[0], B[0]) = (int(dict[A[0]]), int(dict[B[0]]))
(A[1], B[1]) = (int(A[1]), int(B[1]))
C = []
while A[0] != B[0]:
	if A[0] < B[0]:
		if A[1] < B[1]:
			C.append('RU')
			A[0] = A[0] + 1
			A[1] = A[1] + 1
		elif A[1] > B[1]:
			C.append('RD')
			A[0] = A[0] + 1
			A[1] = A[1] - 1
		elif A[1] == B[1]:
			C.append('R')
			A[0] = A[0] + 1
	elif A[0] > B[0]:
		if A[1] < B[1]:
			C.append('LU')
			A[0] = A[0] - 1
			A[1] = A[1] + 1
		elif A[1] > B[1]:
			C.append('LD')
			A[0] = A[0] - 1
			A[1] = A[1] - 1
		elif A[1] == B[1]:
			C.append('L')
			A[0] = A[0] - 1
	elif A[1] < B[1]:
		C.append('U')
		A[1] = A[1] + 1
	elif A[1] > B[1]:
		C.append('D')
		A[1] = A[1] - 1
while A[1] != B[1]:
	if A[0] < B[0]:
		if A[1] < B[1]:
			C.append('RU')
			A[0] = A[0] + 1
			A[1] = A[1] + 1
		elif A[1] > B[1]:
			C.append('RD')
			A[0] = A[0] + 1
			A[1] = A[1] - 1
		elif A[1] == B[1]:
			C.append('R')
			A[0] = A[0] + 1
	elif A[0] > B[0]:
		if A[1] < B[1]:
			C.append('LU')
			A[0] = A[0] - 1
			A[1] = A[1] + 1
		elif A[1] > B[1]:
			C.append('LD')
			A[0] = A[0] - 1
			A[1] = A[1] - 1
		elif A[1] == B[1]:
			C.append('L')
			A[0] = A[0] - 1
	elif A[1] < B[1]:
		C.append('U')
		A[1] = A[1] + 1
	elif A[1] > B[1]:
		C.append('D')
		A[1] = A[1] - 1
print(len(C))
while C != []:
	print(C[0])
	C.pop(0)


def get_location(start):
	s = list(start)
	x = ord(s[0]) - ord('a') + 1
	y = int(s[1])
	return (x, y)
	pass

class Solution:

	def __init__(self):
		self.start = input()
		self.target = input()
		self.ps = get_location(self.start)
		pt = get_location(self.target)
		self.tx = pt[0]
		self.ty = pt[1]
		self.ans = []

	def solve(self):
		self.compute_answer(self.ps)
		print(len(self.ans))
		for x in self.ans:
			print(x)
		pass

	def compute_answer(self, ps):
		sx = ps[0]
		sy = ps[1]
		if sx == self.tx and sy == self.ty:
			return
		if sx == self.tx:
			if sy < self.ty:
				self.ans.append('U')
				ps = (sx, sy + 1)
				self.compute_answer(ps)
			elif sy > self.ty:
				self.ans.append('D')
				ps = (sx, sy - 1)
				self.compute_answer(ps)
		elif sy == self.ty:
			if sx > self.tx:
				self.ans.append('L')
				ps = (sx - 1, sy)
				self.compute_answer(ps)
			elif sx < self.tx:
				self.ans.append('R')
				ps = (sx + 1, sy)
				self.compute_answer(ps)
		if sx < self.tx and sy > self.ty:
			s = (sx + 1, sy - 1)
			self.ans.append('RD')
			self.compute_answer(s)
		elif sx > self.tx and sy > self.ty:
			s = (sx - 1, sy - 1)
			self.ans.append('LD')
			self.compute_answer(s)
		elif sx > self.tx and self.ty > sy:
			s = (sx - 1, sy + 1)
			self.ans.append('LU')
			self.compute_answer(s)
		elif self.tx > sx and self.ty > sy:
			s = (sx + 1, sy + 1)
			self.ans.append('RU')
			self.compute_answer(s)
		pass
s = Solution()
s.solve()


__author__ = 'Obriel Muga'
columnas = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']

def ajedrez(posicion_actual, posicion_final, lista_final):
	(c_actual, f_actual) = posicion_actual
	(c_final, f_final) = posicion_final
	if posicion_actual == posicion_final:
		print(len(lista_final))
		for i in lista_final:
			print(i)
		return
	elif c_actual < c_final and f_actual < f_final:
		lista_final.append('RU')
		return ajedrez((c_actual + 1, f_actual + 1), posicion_final, lista_final)
	elif c_actual > c_final and f_actual > f_final:
		lista_final.append('LD')
		return ajedrez((c_actual - 1, f_actual - 1), posicion_final, lista_final)
	elif c_actual == c_final and f_actual < f_final:
		lista_final.append('U')
		return ajedrez((c_actual, f_actual + 1), posicion_final, lista_final)
	elif c_actual > c_final and f_actual < f_final:
		lista_final.append('LU')
		return ajedrez((c_actual - 1, f_actual + 1), posicion_final, lista_final)
	elif c_actual == c_final and f_actual > f_final:
		lista_final.append('D')
		return ajedrez((c_actual, f_actual - 1), posicion_final, lista_final)
	elif c_actual < c_final and f_actual > f_final:
		lista_final.append('RD')
		return ajedrez((c_actual + 1, f_actual - 1), posicion_final, lista_final)
	elif f_actual == f_final and c_actual > c_final:
		lista_final.append('L')
		return ajedrez((c_actual - 1, f_actual), posicion_final, lista_final)
	elif f_actual == f_final and c_actual < c_final:
		lista_final.append('R')
		return ajedrez((c_actual + 1, f_actual), posicion_final, lista_final)
inicio = str(input())
final = str(input())
columna_inicial = columnas.index(inicio[0])
columna_final = columnas.index(final[0])
fila_inicial = int(inicio[1]) - 1
fila_final = int(final[1]) - 1
ajedrez((columna_inicial, fila_inicial), (columna_final, fila_final), [])


s = input()
t = input()
c = ord(s[0]) - ord(t[0])
d = ord(s[1]) - ord(t[1])
print(max(c, -c, d, -d))
while c != 0 or d != 0:
	r = ''
	if c < 0:
		r = 'R'
		c += 1
	if c > 0:
		r = 'L'
		c -= 1
	if d < 0:
		r += 'U'
		d += 1
	if d > 0:
		r += 'D'
		d -= 1
	print(r)


s = input()
r = input()
a = list(s)
b = list(r)
a[0] = ord(a[0])
b[0] = ord(b[0])
a[1] = int(a[1])
b[1] = int(b[1])
if a[0] < b[0]:
	if a[1] < b[1]:
		print(max(b[0] - a[0], b[1] - a[1]))
		while b[0] - a[0] and b[1] - a[1]:
			print('RU')
			a[0] += 1
			a[1] += 1
		if b[0] - a[0]:
			for i in range(b[0] - a[0]):
				print('R')
		else:
			for i in range(b[1] - a[1]):
				print('U')
	else:
		print(max(b[0] - a[0], a[1] - b[1]))
		while b[0] - a[0] and a[1] - b[1]:
			print('RD')
			a[0] += 1
			a[1] -= 1
		if b[0] - a[0]:
			for i in range(b[0] - a[0]):
				print('R')
		else:
			for i in range(a[1] - b[1]):
				print('D')
elif a[1] < b[1]:
	print(max(a[0] - b[0], b[1] - a[1]))
	while a[0] - b[0] and b[1] - a[1]:
		print('LU')
		a[0] -= 1
		a[1] += 1
	if a[0] - b[0]:
		for i in range(a[0] - b[0]):
			print('L')
	else:
		for i in range(b[1] - a[1]):
			print('U')
else:
	print(max(a[0] - b[0], a[1] - b[1]))
	while a[0] - b[0] and a[1] - b[1]:
		print('LD')
		a[0] -= 1
		a[1] -= 1
	if a[0] - b[0]:
		for i in range(a[0] - b[0]):
			print('L')
	else:
		for i in range(a[1] - b[1]):
			print('D')


s = input()
t = input()
x = ord(t[0]) - ord(s[0])
y = int(t[1]) - int(s[1])
print(max(abs(x), abs(y)))
while x != 0 or y != 0:
	direction = ''
	if x > 0:
		direction += 'R'
		x -= 1
	if x < 0:
		direction += 'L'
		x += 1
	if y > 0:
		direction += 'U'
		y -= 1
	if y < 0:
		direction += 'D'
		y += 1
	print(direction)


s = input()
t = input()
diff_vertical = int(s[1]) - int(t[1])
diff_hor = ord(s[0]) - ord(t[0])
print(max(abs(diff_hor), abs(diff_vertical)))
while True:
	if diff_vertical > 0:
		if diff_hor > 0:
			print('LD')
			diff_hor -= 1
			diff_vertical -= 1
		elif diff_hor < 0:
			print('RD')
			diff_hor += 1
			diff_vertical -= 1
		else:
			print('D')
			diff_vertical -= 1
	elif diff_vertical < 0:
		if diff_hor > 0:
			print('LU')
			diff_hor -= 1
			diff_vertical += 1
		elif diff_hor < 0:
			print('RU')
			diff_hor += 1
			diff_vertical += 1
		else:
			print('U')
			diff_vertical += 1
	elif diff_hor > 0:
		print('L')
		diff_hor -= 1
	elif diff_hor < 0:
		print('R')
		diff_hor += 1
	else:
		break


def main():
	startpoint = [i for i in input()]
	endpoint = [j for j in input()]
	x_distance = ord(startpoint[0]) - ord(endpoint[0])
	y_distance = int(startpoint[1]) - int(endpoint[1])
	x_abs_distance = abs(ord(startpoint[0]) - ord(endpoint[0]))
	y_abs_distance = abs(int(startpoint[1]) - int(endpoint[1]))
	print(max(x_abs_distance, y_abs_distance))
	while x_distance != 0 or y_distance != 0:
		r = ''
		if x_distance < 0:
			r = 'R'
			x_distance += 1
		if x_distance > 0:
			r = 'L'
			x_distance -= 1
		if y_distance < 0:
			r += 'U'
			y_distance += 1
		if y_distance > 0:
			r += 'D'
			y_distance -= 1
		print(r)
main()


s = input()
t = input()
import math
b = ord(t[0]) - ord(s[0])
b_mod = math.fabs(b)
c = int(t[1]) - int(s[1])
c = int(c)
c_mod = math.fabs(c)
otvet = max(b_mod, c_mod)
print(int(otvet))
while b_mod != c_mod:
	if c_mod < b_mod:
		if b > 0:
			b_mod = b_mod - 1
			print('R')
		else:
			b_mod = b_mod - 1
			print('L')
	elif c > 0:
		c_mod = c_mod - 1
		print('U')
	else:
		c_mod = c_mod - 1
		print('D')
while c_mod > 0 and b_mod > 0:
	if c > 0 and b > 0:
		c_mod = c_mod - 1
		b_mod = b_mod - 1
		print('RU')
	elif c > 0 and b < 0:
		c_mod = c_mod - 1
		b_mod = b_mod - 1
		print('LU')
	elif c < 0 and b < 0:
		c_mod = c_mod - 1
		b_mod = b_mod - 1
		print('LD')
	else:
		c_mod = c_mod - 1
		b_mod = b_mod - 1
		print('RD')


t1 = input()
t2 = input()
x1 = ord(t1[0]) - ord('a') + 1
y1 = int(t1[1])
x2 = ord(t2[0]) - ord('a') + 1
y2 = int(t2[1])
print(max(abs(x2 - x1), abs(y2 - y1)))
if x1 <= x2 and y1 <= y2:
	for i in range(min(x2 - x1, y2 - y1)):
		print('RU')
if x1 <= x2 and y1 > y2:
	for i in range(min(x2 - x1, y1 - y2)):
		print('RD')
if x1 > x2 and y1 <= y2:
	for i in range(min(x1 - x2, y2 - y1)):
		print('LU')
if x1 > x2 and y1 > y2:
	for i in range(min(x1 - x2, y1 - y2)):
		print('LD')
if x2 - x1 > abs(y2 - y1):
	for i in range(x2 - x1 - abs(y2 - y1)):
		print('R')
if x1 - x2 > abs(y2 - y1):
	for i in range(x1 - x2 - abs(y2 - y1)):
		print('L')
if y2 - y1 > abs(x2 - x1):
	for i in range(y2 - y1 - abs(x2 - x1)):
		print('U')
if y1 - y2 > abs(x2 - x1):
	for i in range(y1 - y2 - abs(x2 - x1)):
		print('D')


s1 = input()
s2 = input()
dx = ord(s2[0]) - ord(s1[0])
dy = ord(s2[1]) - ord(s1[1])
ans = []
step = 0
while dx != 0 or dy != 0:
	tans = ''
	step = step + 1
	if dx > 0:
		tans = tans + 'R'
		dx = dx - 1
	elif dx < 0:
		tans = tans + 'L'
		dx = dx + 1
	if dy > 0:
		tans = tans + 'U'
		dy = dy - 1
	elif dy < 0:
		tans = tans + 'D'
		dy = dy + 1
	ans.append(tans)
print(step)
for st in ans:
	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]) < 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')
		elif s[0] > t[0]:
			print('L')
		else:
			print('R')


a = input()
b = input()
s = ord(a[0]) - ord(b[0])
t = int(a[1]) - int(b[1])
i = 0
k = 0
j = 0
if s < 0:
	l = 'R'
else:
	l = 'L'
if t > 0:
	m = 'D'
else:
	m = 'U'
print(max(abs(s), abs(t)))
while i < max(abs(s), abs(t)):
	if abs(s) > j:
		print(l, end='')
		j = j + 1
	if abs(t) > k:
		print(m)
		k = k + 1
	else:
		print()
	i = i + 1


s = input()
t = input()
a = int(s[1]) - int(t[1])
f = ord(s[0])
g = ord(t[0])
b = chr(f)
c = chr(g)
d = int(s[1])
e = int(t[1])
h = f - g
if b == c and d == e:
	print(0)
else:
	print(max(abs(a), abs(h)))
	while b != c or d != e:
		if b < c:
			print('R', end='')
			b = chr(ord(b) + 1)
		elif b > c:
			print('L', end='')
			b = chr(ord(b) - 1)
		if d < e:
			print('U')
			d += 1
		elif d > e:
			print('D')
			d -= 1
		else:
			print(' ')


import os
import sys
import math
from io import BytesIO, IOBase
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

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

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

def ncr(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def seive(n):
	primes = [True] * (n + 1)
	ans = []
	for i in range(2, n):
		if not primes[i]:
			continue
		j = 2 * i
		while j <= n:
			primes[j] = False
			j += i
	for p in range(2, n + 1):
		if primes[p]:
			ans += [p]
	return ans

def factors(n):
	factors = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			if n // x == x:
				factors.append(x)
			else:
				factors.append(x)
				factors.append(n // x)
		x += 1
	return factors

def main():
	try:
		s = input()
		h = input()
		ho = ord(s[0])
		hd = ord(h[0])
		vo = ord(s[1])
		vd = ord(h[1])
		ans = max(abs(ho - hd), abs(vo - vd))
		print(ans)
		ans = []
		if ho < hd:
			if abs(ho - hd) > abs(vo - vd):
				ans += ['R'] * (abs(ho - hd) - abs(vo - vd))
				if vo > vd:
					ans += ['RD'] * abs(vo - vd)
				else:
					ans += ['RU'] * abs(vo - vd)
			elif vo > vd:
				ans += ['D'] * abs(abs(ho - hd) - abs(vo - vd))
				ans += ['RD'] * abs(hd - ho)
			else:
				ans += ['U'] * abs(abs(ho - hd) - abs(vo - vd))
				ans += ['RU'] * abs(hd - ho)
		elif abs(ho - hd) > abs(vo - vd):
			ans += ['L'] * (abs(ho - hd) - abs(vo - vd))
			if vo > vd:
				ans += ['LD'] * abs(vo - vd)
			else:
				ans += ['LU'] * abs(vo - vd)
		elif vo > vd:
			ans += ['D'] * abs(abs(ho - hd) - abs(vo - vd))
			ans += ['LD'] * abs(hd - ho)
		else:
			ans += ['U'] * abs(abs(ho - hd) - abs(vo - vd))
			ans += ['LU'] * abs(hd - ho)
		print(*ans, sep='\n')
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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


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)


def step():
	global x1, x2, y1, y2, step_count, moves
	move = ''
	if x1 > x2:
		move += 'L'
		x1 -= 1
	elif x1 < x2:
		move += 'R'
		x1 += 1
	if y1 > y2:
		move += 'D'
		y1 -= 1
	elif y1 < y2:
		move += 'U'
		y1 += 1
	step_count += 1
	moves.append(move)
p1 = input()
(x1, y1) = (ord(p1[0]) - ord('a'), int(p1[1]))
p2 = input()
(x2, y2) = (ord(p2[0]) - ord('a'), int(p2[1]))
(step_count, moves) = (0, [])
while x1 != x2 or y1 != y2:
	step()
print(step_count)
print('\n'.join(moves))


start = list(input())
finish = list(input())
(start[0], finish[0]) = (list('abcdefgh').index(start[0]) + 1, list('abcdefgh').index(finish[0]) + 1)
v = finish[0] - start[0]
h = int(finish[1]) - int(start[1])
if v < 0:
	v_flag = 'L'
else:
	v_flag = 'R'
if h > 0:
	h_flag = 'U'
else:
	h_flag = 'D'
v = abs(v)
h = abs(h)
print(max(v, h))
smol = min(v, h)
big = max(v, h) - smol
for x in range(smol):
	print(v_flag + h_flag)
for x in range(big):
	print((v > h) * v_flag + (v < h) * h_flag)


coord1 = input()
coord2 = input()
coord1 = [ord(coord1[0]) - 96, int(coord1[1])]
coord2 = [ord(coord2[0]) - 96, int(coord2[1])]
CountMoves = 0
Moves = []
while coord1[0] != coord2[0] or coord1[1] != coord2[1]:
	if coord1[0] == coord2[0]:
		if coord1[1] > coord2[1]:
			Moves.append('D')
			coord1[1] -= 1
		else:
			Moves.append('U')
			coord1[1] += 1
	elif coord1[0] > coord2[0]:
		if coord1[1] == coord2[1]:
			Moves.append('L')
			coord1[0] -= 1
		elif coord1[1] > coord2[1]:
			Moves.append('LD')
			coord1[0] -= 1
			coord1[1] -= 1
		else:
			Moves.append('LU')
			coord1[0] -= 1
			coord1[1] += 1
	elif coord1[1] == coord2[1]:
		Moves.append('R')
		coord1[0] += 1
	elif coord1[1] > coord2[1]:
		Moves.append('RD')
		coord1[0] += 1
		coord1[1] -= 1
	else:
		Moves.append('RU')
		coord1[0] += 1
		coord1[1] += 1
	CountMoves += 1
print(CountMoves)
for i in range(0, len(Moves)):
	print(Moves[i])


a = input()
b = input()
a1 = ord(a[0])
a2 = int(a[1])
b1 = ord(b[0])
b2 = int(b[1])
l = []
ans = 0
while a1 < b1 and a2 < b2:
	l.append('RU')
	a1 += 1
	a2 += 1
	ans += 1
while a1 > b1 and a2 < b2:
	l.append('LU')
	a1 -= 1
	a2 += 1
	ans += 1
while a1 > b1 and a2 > b2:
	l.append('LD')
	a1 -= 1
	a2 -= 1
	ans += 1
while a1 < b1 and a2 > b2:
	l.append('RD')
	a1 += 1
	a2 -= 1
	ans += 1
while a1 < b1:
	a1 += 1
	l.append('R')
	ans += 1
while a1 > b1:
	a1 -= 1
	l.append('L')
	ans += 1
while a2 < b2:
	a2 += 1
	l.append('U')
	ans += 1
while a2 > b2:
	a2 -= 1
	l.append('D')
	ans += 1
print(ans)
for i in l:
	print(i)


a = list(input())
b = list(input())
x = 'D' if a[1] > b[1] else 'U'
y = 'L' if a[0] > b[0] else 'R'
m = abs(ord(a[0]) - ord(b[0]))
n = abs(ord(a[1]) - ord(b[1]))
c = max(m, n)
print(c)
j = y + x
for _ in range(min(m, n)):
	print(j)
mini = min(m, n)
m -= mini
n -= mini
for _ in range(m):
	print(y)
for _ in range(n):
	print(x)


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)


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)))
while 1:
	if x == _x and y == _y:
		break
	if x < _x:
		x += 1
		print('R', end='')
	elif x > _x:
		x -= 1
		print('L', end='')
	if y > _y:
		y -= 1
		print('D', end='')
	elif y < _y:
		y += 1
		print('U', end='')
	print('')


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, t) = (input(), input())
path = []
n = 0
while s[0] > t[0] and s[1] > t[1]:
	path.append('LD')
	n += 1
	s = chr(ord(s[0]) - 1) + chr(ord(s[1]) - 1)
while s[0] > t[0] and s[1] < t[1]:
	path.append('LU')
	n += 1
	s = chr(ord(s[0]) - 1) + chr(ord(s[1]) + 1)
while s[0] < t[0] and s[1] < t[1]:
	path.append('RU')
	n += 1
	s = chr(ord(s[0]) + 1) + chr(ord(s[1]) + 1)
while s[0] < t[0] and s[1] > t[1]:
	path.append('RD')
	n += 1
	s = chr(ord(s[0]) + 1) + chr(ord(s[1]) - 1)
while s[0] > t[0]:
	path.append('L')
	n += 1
	s = chr(ord(s[0]) - 1) + s[1]
while s[0] < t[0]:
	path.append('R')
	n += 1
	s = chr(ord(s[0]) + 1) + s[1]
while s[1] < t[1]:
	path.append('U')
	n += 1
	s = s[0] + chr(ord(s[1]) + 1)
while s[1] > t[1]:
	path.append('D')
	n += 1
	s = s[0] + chr(ord(s[1]) - 1)
print(n)
for step in path:
	print(step)


s = input()
t = input()
sx = ord(s[0]) - ord('a') + 1
sy = int(s[1])
tx = ord(t[0]) - ord('a') + 1
ty = int(t[1])
dx = abs(sx - tx)
dy = abs(sy - ty)
d1 = min(dx, dy)
d2 = max(dx, dy)
print(d2)
if sx <= tx:
	if sy <= ty:
		for i in range(d1):
			print('RU')
		for i in range(d2 - d1):
			if dx <= dy:
				print('U')
			else:
				print('R')
	else:
		for i in range(d1):
			print('RD')
		for i in range(d2 - d1):
			if dx <= dy:
				print('D')
			else:
				print('R')
elif sy <= ty:
	for i in range(d1):
		print('LU')
	for i in range(d2 - d1):
		if dx <= dy:
			print('U')
		else:
			print('L')
else:
	for i in range(d1):
		print('LD')
	for i in range(d2 - d1):
		if dx <= dy:
			print('D')
		else:
			print('L')


(sx, sy) = input()
(tx, ty) = input()
sx = ord(sx) - ord('a')
tx = ord(tx) - ord('a')
sy = int(sy) - 1
ty = int(ty) - 1
moves = []
while (sx, sy) != (tx, ty):
	while sx != tx and sy != ty:
		if tx > sx:
			if ty > sy:
				moves += ['RU']
				sx += 1
				sy += 1
			else:
				moves += ['RD']
				sx += 1
				sy -= 1
		elif ty > sy:
			moves += ['LU']
			sx -= 1
			sy += 1
		else:
			moves += ['LD']
			sx -= 1
			sy -= 1
	while sx != tx or sy != ty:
		if sx > tx:
			moves += ['L']
			sx -= 1
		elif sx < tx:
			moves += ['R']
			sx += 1
		elif sy > ty:
			moves += ['D']
			sy -= 1
		else:
			moves += ['U']
			sy += 1
print(len(moves))
print(*moves, sep='\n')


a = input()
b = input()
sorh = ord(a[0])
tarh = ord(b[0])
sorv = int(a[1])
tarv = int(b[1])
hor = abs(ord(a[0]) - ord(b[0]))
ver = abs(int(a[1]) - int(b[1]))
korno = max(hor, ver) - abs(hor - ver)
s = ''
l = []
if korno > 0:
	if tarh - sorh > 0:
		s = 'R'
		if tarv > sorv:
			s = s + 'U'
		elif sorv > tarv:
			s = s + 'D'
	else:
		s = 'L'
		if tarv > sorv:
			s = s + 'U'
		elif sorv > tarv:
			s = s + 'D'
	for i in range(korno):
		l.append(s)
if tarv > sorv:
	p = tarv - sorv - korno
	for i in range(p):
		l.append('U')
elif sorv > tarv:
	p = sorv - tarv - korno
	for i in range(p):
		l.append('D')
if tarh > sorh:
	p = tarh - sorh - korno
	for i in range(p):
		l.append('R')
elif sorh > tarh:
	p = sorh - tarh - korno
	for i in range(p):
		l.append('L')
print(len(l))
for i in range(len(l)):
	print(l[i])


import os
import sys
debug = True
if debug and os.path.exists('input.in'):
	input = open('input.in', 'r').readline
else:
	debug = False
	input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
test_count = 1
if debug:
	test_count = int(input())
for t in range(test_count):
	if debug:
		print('Test Case #', t + 1)
	S = input()
	E = input()
	X1 = ord(S[0])
	Y1 = ord(S[1])
	X2 = ord(E[0])
	Y2 = ord(E[1])
	rows = abs(X1 - X2)
	cols = abs(Y1 - Y2)
	diagonal = min(rows, cols)
	moves = []
	diaMove = ''
	otherMove = ''
	if X2 >= X1:
		if Y2 >= Y1:
			diaMove = 'RU'
			otherMove = 'R' if rows >= cols else 'U'
		else:
			diaMove = 'RD'
			otherMove = 'R' if rows >= cols else 'D'
	elif Y2 >= Y1:
		diaMove = 'LU'
		otherMove = 'L' if rows >= cols else 'U'
	else:
		diaMove = 'LD'
		otherMove = 'L' if rows >= cols else 'D'
	for _ in range(diagonal):
		moves.append(diaMove)
	for _ in range(max(rows, cols) - diagonal):
		moves.append(otherMove)
	print(len(moves))
	print('\n'.join(moves))


def main():
	s = input()
	e = input()
	hor = ord(s[0]) - ord(e[0])
	ver = int(s[1]) - int(e[1])
	max_steps = max(abs(hor), abs(ver))
	print(max_steps)
	while hor or ver:
		step = ''
		if hor > 0:
			hor -= 1
			step += 'L'
		if hor < 0:
			hor += 1
			step += 'R'
		if ver > 0:
			ver -= 1
			step += 'D'
		if ver < 0:
			ver += 1
			step += 'U'
		print(step)
main()


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


S1 = str(input())
S2 = str(input())
if S1[0] == 'a':
	S1 += '1'
if S1[0] == 'b':
	S1 += '2'
if S1[0] == 'c':
	S1 += '3'
if S1[0] == 'd':
	S1 += '4'
if S1[0] == 'e':
	S1 += '5'
if S1[0] == 'f':
	S1 += '6'
if S1[0] == 'g':
	S1 += '7'
if S1[0] == 'h':
	S1 += '8'
if S2[0] == 'a':
	S2 += '1'
if S2[0] == 'b':
	S2 += '2'
if S2[0] == 'c':
	S2 += '3'
if S2[0] == 'd':
	S2 += '4'
if S2[0] == 'e':
	S2 += '5'
if S2[0] == 'f':
	S2 += '6'
if S2[0] == 'g':
	S2 += '7'
if S2[0] == 'h':
	S2 += '8'
a = int(S1[1])
b = int(S2[1])
c = int(S1[2])
d = int(S2[2])
B = []
while a != b or c != d:
	if a > b and c < d:
		a = a - 1
		c = c + 1
		B.append('RD')
	elif a > b and c > d:
		a = a - 1
		c = c - 1
		B.append('LD')
	elif a < b and c < d:
		a = a + 1
		c = c + 1
		B.append('RU')
	elif a < b and c > d:
		a = a + 1
		c = c - 1
		B.append('LU')
	elif c == d and a > b:
		a = a - 1
		B.append('D')
	elif c == d and a < b:
		a = a + 1
		B.append('U')
	elif a == b and c < d:
		c = c + 1
		B.append('R')
	elif a == b and c > d:
		c = c - 1
		B.append('L')
print(len(B))
for i in B:
	print(i)


s1 = input()
s2 = input()
a = ord(s1[0]) - ord(s2[0])
b = ord(s1[1]) - ord(s2[1])
minimum_moves = max(a, b, -a, -b)
print(minimum_moves)
while a != 0 or b != 0:
	path = ''
	if a > 0:
		a -= 1
		path += 'L'
	if a < 0:
		a += 1
		path += 'R'
	if b < 0:
		b += 1
		path += 'U'
	if b > 0:
		b -= 1
		path += 'D'
	print(path)


c1 = input()
c2 = input()
x1 = ord(c1[0]) - ord('a')
y1 = int(c1[1]) - 1
x2 = ord(c2[0]) - ord('a')
y2 = int(c2[1]) - 1
dx = abs(x1 - x2)
dy = abs(y1 - y2)
print(max(dx, dy))
while x1 != x2 or y1 != y2:
	a = ''
	b = ''
	if x2 > x1:
		a = 'R'
		x1 = x1 + 1
	elif x2 < x1:
		a = 'L'
		x1 = x1 - 1
	if y2 > y1:
		b = 'U'
		y1 = y1 + 1
	elif y2 < y1:
		b = 'D'
		y1 = y1 - 1
	print(a + b)


s = input()
t = input()
letter = 'abcdefgh'
s1 = letter.index(s[0])
t1 = letter.index(t[0])
s2 = int(s[1])
t2 = int(t[1])
i = 0
while s1 != t1 or s2 != t2:
	locals()['move' + str(i)] = ''
	if s1 < t1:
		locals()['move' + str(i)] += 'R'
		s1 += 1
	elif s1 > t1:
		locals()['move' + str(i)] += 'L'
		s1 += -1
	if s2 < t2:
		locals()['move' + str(i)] += 'U'
		s2 += 1
	elif s2 > t2:
		locals()['move' + str(i)] += 'D'
		s2 += -1
	i += 1
print(i)
for k in range(i):
	print(locals()['move' + str(k)], end='\n')


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


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'
	if dc < sc:
		sc -= 1
		s += 'L'
	if dr > sr:
		sr += 1
		s += 'U'
	if dr < sr:
		sr -= 1
		s += 'D'
	l.append(s)
print(count)
for x in l:
	print(x)


s = input()
t = input()
ps = [ord(s[0]) - 96, int(s[1])]
pt = [ord(t[0]) - 96, int(t[1])]
tt = ps
path = []
c = 0
while pt != tt:
	if tt[0] == pt[0]:
		if tt[1] < pt[1]:
			tt[1] = tt[1] + 1
			path.append('U')
			c += 1
		elif tt[1] > pt[1]:
			tt[1] = tt[1] - 1
			path.append('D')
			c += 1
	elif tt[1] == pt[1]:
		if tt[0] < pt[0]:
			tt[0] = tt[0] + 1
			path.append('R')
			c += 1
		elif tt[0] > pt[0]:
			tt[0] = tt[0] - 1
			path.append('L')
			c += 1
	elif tt[0] < pt[0] and tt[1] < pt[1]:
		tt[0] = tt[0] + 1
		tt[1] = tt[1] + 1
		path.append('RU')
		c += 1
	elif tt[0] < pt[0] and tt[1] > pt[1]:
		tt[0] = tt[0] + 1
		tt[1] = tt[1] - 1
		path.append('RD')
		c += 1
	elif tt[0] > pt[0] and tt[1] < pt[1]:
		tt[0] = tt[0] - 1
		tt[1] = tt[1] + 1
		path.append('LU')
		c += 1
	elif tt[0] > pt[0] and tt[1] > pt[1]:
		tt[0] = tt[0] - 1
		tt[1] = tt[1] - 1
		path.append('LD')
		c += 1
print(c)
for i in range(c):
	print(path[i])


(s1, t1) = input()
t1 = int(t1)
(s2, t2) = input()
t2 = int(t2)
x = ord(s1) - ord(s2)
y = t1 - t2
n = max(abs(x), abs(y))
print(n)
while x != 0 or y != 0:
	m = ''
	if x < 0:
		m = 'R'
		x += 1
	elif x > 0:
		m = 'L'
		x -= 1
	if y > 0:
		m = m + 'D'
		y -= 1
	elif y < 0:
		m = m + 'U'
		y += 1
	print(m)


d = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
e = {(1, 1): 'LU', (-1, -1): 'RD', (-1, 1): 'RU', (1, -1): 'LD', (0, -1): 'L', (1, 0): 'D', (-1, 0): 'U', (0, 1): 'R'}
a = input()
b = input()
coordX = d[b[0]] - d[a[0]]
coordY = 9 - int(b[1]) - (9 - int(a[1]))
v1 = 0
v2 = 0
L = []
while True:
	if coordX == 0 and coordY == 0:
		break
	else:
		if coordX == 0:
			v1 = 0
		elif coordX < 0:
			v1 = 1
		else:
			v1 = -1
		if coordY == 0:
			v2 = 0
		elif coordY < 0:
			v2 = 1
		else:
			v2 = -1
		if coordX == 0:
			L.append(e[-v2, 0])
		elif coordY == 0:
			L.append(e[0, -v1])
		else:
			L.append(e[v1, v2])
		coordX += v1
		coordY += v2
print(len(L))
print('\n'.join(L))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

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

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

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

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	s = S()
	t = S()
	a = ord(t[0]) - ord(s[0])
	b = ord(t[1]) - ord(s[1])
	r = []
	while a != 0 or b != 0:
		u = ''
		if a < 0:
			u += 'L'
			a += 1
		elif a > 0:
			u += 'R'
			a -= 1
		if b < 0:
			u += 'D'
			b += 1
		elif b > 0:
			u += 'U'
			b -= 1
		r.append(u)
	return '{}\n{}'.format(len(r), '\n'.join(r))
print(main())


s = list(input())
t = input()
ans = []
while ''.join(s) != t:
	cur = ''
	if s[0] < t[0]:
		cur = cur + 'R'
		s[0] = chr(ord(s[0]) + 1)
	if s[0] > t[0]:
		cur = cur + 'L'
		s[0] = chr(ord(s[0]) - 1)
	if s[1] < t[1]:
		cur = cur + 'U'
		s[1] = chr(ord(s[1]) + 1)
	if s[1] > t[1]:
		cur = cur + 'D'
		s[1] = chr(ord(s[1]) - 1)
	ans += [cur]
print(len(ans))
for c in ans:
	print(c)


def readline():
	s = input()
	return (ord(s[0]) - ord('a') + 1, int(s[1]))

def CF_3A():
	(x0, y0) = readline()
	(x1, y1) = readline()
	print(max(abs(x1 - x0), abs(y1 - y0)))
	while x0 != x1 or y0 != y1:
		if x0 == x1:
			if y0 > y1:
				y0 -= 1
				print('D')
			else:
				y0 += 1
				print('U')
		elif y0 == y1:
			if x0 > x1:
				x0 -= 1
				print('L')
			else:
				x0 += 1
				print('R')
		elif x0 > x1:
			if y0 > y1:
				x0 -= 1
				y0 -= 1
				print('LD')
			else:
				x0 -= 1
				y0 += 1
				print('LU')
		elif y0 > y1:
			x0 += 1
			y0 -= 1
			print('RD')
		else:
			x0 += 1
			y0 += 1
			print('RU')
CF_3A()


(l1, n1) = list(input())
(l2, n2) = list(input())
ans = []
diff1 = ord(l2) - ord(l1)
diff2 = ord(n2) - ord(n1)
while diff1 != 0 and diff2 != 0:
	if diff1 > 0 and diff2 > 0:
		ans.append('RU')
		diff1 -= 1
		diff2 -= 1
	elif diff1 > 0 and diff2 < 0:
		ans.append('RD')
		diff1 -= 1
		diff2 += 1
	elif diff1 < 0 and diff2 > 0:
		ans.append('LU')
		diff1 += 1
		diff2 -= 1
	elif diff1 < 0 and diff2 < 0:
		ans.append('LD')
		diff1 += 1
		diff2 += 1
if diff1 > 0:
	for i in range(diff1):
		ans.append('R')
elif diff1 < 0:
	for i in range(diff1 * -1):
		ans.append('L')
elif diff2 > 0:
	for i in range(diff2):
		ans.append('U')
elif diff2 < 0:
	for i in range(diff2 * -1):
		ans.append('D')
print(len(ans))
for i in ans:
	print(i)


s = input()
t = input()
(column, row) = (ord(s[0]) - ord(t[0]), ord(s[1]) - ord(t[1]))
print(max(column, -column, row, -row))
while column != 0 or row != 0:
	step = ''
	if column < 0:
		step = 'R'
		column += 1
	if column > 0:
		step = 'L'
		column -= 1
	if row < 0:
		step += 'U'
		row += 1
	if row > 0:
		step += 'D'
		row -= 1
	print(step)


v1 = list(input())
v2 = list(input())
uh = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
(x1, y1) = (uh.index(v1[0]), (int(v1[1]) - 8) * -1)
(x2, y2) = (uh.index(v2[0]), (int(v2[1]) - 8) * -1)
x = x2 - x1
y = y2 - y1
maximo = max(abs(x), abs(y))
dir_linea = ''
if maximo == abs(x):
	d = abs(y)
	h = abs(abs(x) - abs(y))
	v = 0
	if x > 0:
		dir_linea = 'R'
	if x < 0:
		dir_linea = 'L'
else:
	d = abs(x)
	h = 0
	v = abs(abs(y) - abs(x))
	if y > 0:
		dir_linea = 'D'
	if y < 0:
		dir_linea = 'U'
dir_diag = ''
if x > 0 and y > 0:
	dir_diag = 'RD'
if x < 0 and y > 0:
	dir_diag = 'LD'
if x > 0 and y < 0:
	dir_diag = 'RU'
if x < 0 and y < 0:
	dir_diag = 'LU'
print(d + h + v)
for _ in range(h):
	print(dir_linea)
for _ in range(v):
	print(dir_linea)
for _ in range(d):
	print(dir_diag)


inp = input()
s = [ord(inp[0]) - ord('a'), ord(inp[1]) - ord('1')]
inp = input()
t = [ord(inp[0]) - ord('a'), ord(inp[1]) - ord('1')]
print(max(abs(s[0] - t[0]), abs(s[1] - t[1])))
while s != t:
	lr = t[0] - s[0]
	ud = t[1] - s[1]
	out = ''
	if lr > 0:
		s[0] += 1
		out += 'R'
	elif lr < 0:
		s[0] -= 1
		out += 'L'
	if ud > 0:
		s[1] += 1
		out += 'U'
	elif ud < 0:
		s[1] -= 1
		out += 'D'
	print(out)


(t1, t2) = (input(), input())
(xs, ys, xt, yt) = (ord(t1[0]) - ord('a') + 1, int(t1[1]), ord(t2[0]) - ord('a') + 1, int(t2[1]))
n = max(abs(xt - xs), abs(yt - ys))
print(n)
for i in range(n):
	if xs < xt:
		if ys > yt:
			print('RD')
			ys -= 1
		elif ys < yt:
			print('RU')
			ys += 1
		else:
			print('R')
		xs += 1
	elif xs > xt:
		if ys > yt:
			print('LD')
			ys -= 1
		elif ys < yt:
			print('LU')
			ys += 1
		else:
			print('L')
		xs -= 1
	elif xs == xt:
		if ys > yt:
			print('D')
			ys -= 1
		elif ys < yt:
			print('U')
			ys += 1
		else:
			print('L')


def f(x, y, a, b, c):
	return [a] * y + [b] * (x - y) if x > y else [a] * x + [c] * (y - x)
(u, v) = (input(), input())
(x, y) = (ord(v[0]) - ord(u[0]), int(v[1]) - int(u[1]))
if x < 0:
	ans = f(-x, -y, 'LD', 'L', 'D') if y < 0 else f(-x, y, 'LU', 'L', 'U')
else:
	ans = f(x, -y, 'RD', 'R', 'D') if y < 0 else f(x, y, 'RU', 'R', 'U')
print(len(ans))
print('\n'.join(ans))


y_cor = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
a = input()
b = input()
x1 = y_cor[a[0]]
y1 = int(a[1])
x2 = y_cor[b[0]]
y2 = int(b[1])
s = ''
c = 0
while True:
	if [x1, y1] == [x2, y2]:
		break
	if x2 > x1:
		x1 += 1
		s += 'R'
	if x2 < x1:
		x2 += 1
		s += 'L'
	if y2 > y1:
		y1 += 1
		s += 'U'
	if y2 < y1:
		y2 += 1
		s += 'D'
	s += '\n'
	c += 1
print(c)
print(s)


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


s1 = input()
s2 = input()
RL = ord(s2[0]) - ord(s1[0])
DU = int(s2[1]) - int(s1[1])
lvl = max(abs(RL), abs(DU))
print(lvl)
if RL > 0:
	R = True
else:
	R = False
if DU > 0:
	U = True
else:
	U = False
DU = abs(DU)
RL = abs(RL)
mn = min(RL, DU)
if R == True and U == True:
	for i in range(mn):
		print('RU')
	if DU > RL:
		for i in range(lvl - mn):
			print('U')
	else:
		for i in range(lvl - mn):
			print('R')
elif R == True and U == False:
	for i in range(mn):
		print('RD')
	if DU > RL:
		for i in range(lvl - mn):
			print('D')
	else:
		for i in range(lvl - mn):
			print('R')
elif R == False and U == True:
	for i in range(mn):
		print('LU')
	if DU > RL:
		for i in range(lvl - mn):
			print('U')
	else:
		for i in range(lvl - mn):
			print('L')
else:
	for i in range(mn):
		print('LD')
	if DU > RL:
		for i in range(lvl - mn):
			print('D')
	else:
		for i in range(lvl - mn):
			print('L')


rey = input('')
a = ord(rey[0]) - 96
b = int(rey[1])
(x, y) = input('')
x = ord(x) - 96
y = int(y)
c = 0
k = []
while a != x or b != y:
	c += 1
	if b == y or x == a:
		if a < x:
			a += 1
			k.append('R')
		elif a > x:
			a -= 1
			k.append('L')
		if b < y:
			b += 1
			k.append('U')
		elif b > y:
			b -= 1
			k.append('D')
	else:
		if a < x and b < y:
			a += 1
			b += 1
			k.append('RU')
		elif a < x and b > y:
			a += 1
			b -= 1
			k.append('RD')
		if a > x and b < y:
			a -= 1
			b += 1
			k.append('LU')
		elif a > x and b > y:
			a -= 1
			b -= 1
			k.append('LD')
print(c)
for i in k:
	print(i)


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 = abs(x1 - x0) + abs(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))


def A():
	start = convert(list(input()))
	end = convert(list(input()))
	moves = []
	count = 0
	while start != end:
		move = ''
		if start[0] < end[0]:
			move += 'R'
			start[0] += 1
		elif start[0] > end[0]:
			move += 'L'
			start[0] -= 1
		if start[1] < end[1]:
			move += 'U'
			start[1] += 1
		elif start[1] > end[1]:
			move += 'D'
			start[1] -= 1
		count += 1
		moves.append(move)
	print(count)
	for move in moves:
		print(move)

def convert(input):
	for i in range(0, 2):
		temp = ord(input[i])
		if temp > ord('8'):
			temp -= ord('a') - 1
		else:
			temp -= ord('1') - 1
		input[i] = temp
	return input
A()


def fun(s):
	if s == 'a':
		return 1
	if s == 'b':
		return 2
	if s == 'c':
		return 3
	if s == 'd':
		return 4
	if s == 'e':
		return 5
	if s == 'f':
		return 6
	if s == 'g':
		return 7
	if s == 'h':
		return 8
str = input()
y1 = int(str[1])
x1 = int(fun(str[0]))
str = input()
y2 = int(str[1])
x2 = int(fun(str[0]))
print(max(abs(x1 - x2), abs(y1 - y2)))
while True:
	if x1 == x2 and y1 == y2:
		break
	if x2 > x1:
		x1 += 1
		print('R', end='')
	if x2 < x1:
		x1 -= 1
		print('L', end='')
	if y2 > y1:
		y1 += 1
		print('U', end='')
	if y2 < y1:
		y1 -= 1
		print('D', end='')
	print('')


col = list('abcdefgh')
beg = list(input())
end = list(input())
beg[0] = col.index(beg[0]) + 1
beg[1] = int(beg[1])
end[0] = col.index(end[0]) + 1
end[1] = int(end[1])
print(max(abs(beg[0] - end[0]), abs(beg[1] - end[1])))
while True:
	if beg[0] == end[0] and beg[1] == end[1]:
		break
	if beg[0] > end[0]:
		print('L', end='')
		beg[0] -= 1
	elif beg[0] < end[0]:
		print('R', end='')
		beg[0] += 1
	if beg[1] < end[1]:
		print('U', end='')
		beg[1] += 1
	elif beg[1] > end[1]:
		print('D', end='')
		beg[1] -= 1
	print('')


def rank(x):
	return ord(x) - 96
line1 = input()
line2 = input()
(x1, y1) = (rank(line1[0]), int(line1[1]))
(x2, y2) = (rank(line2[0]), int(line2[1]))
print(max(abs(x1 - x2), abs(y1 - y2)))
m1 = max(abs(x1 - x2), abs(y1 - y2))
m2 = min(abs(x1 - x2), abs(y1 - y2))
if x1 == x2 and y1 == y2:
	pass
elif x1 > x2 and y1 == y2:
	for i in range(x1 - x2):
		print('L')
elif x1 < x2 and y1 == y2:
	for i in range(x2 - x1):
		print('R')
elif x1 == x2 and y1 > y2:
	for i in range(y1 - y2):
		print('D')
elif x1 == x2 and y1 < y2:
	for i in range(y2 - y1):
		print('U')
elif x1 > x2 and y1 > y2:
	for i in range(m2):
		print('LD')
	if x1 - x2 >= y1 - y2:
		for i in range(m1 - m2):
			print('L')
	else:
		for i in range(m1 - m2):
			print('D')
elif x1 > x2 and y1 < y2:
	for i in range(m2):
		print('LU')
	if x1 - x2 >= y2 - y1:
		for i in range(m1 - m2):
			print('L')
	else:
		for i in range(m1 - m2):
			print('U')
elif x1 < x2 and y1 > y2:
	for i in range(m2):
		print('RD')
	if x2 - x1 >= y1 - y2:
		for i in range(m1 - m2):
			print('R')
	else:
		for i in range(m1 - m2):
			print('D')
elif x1 < x2 and y1 < y2:
	for i in range(m2):
		print('RU')
	if x2 - x1 >= y2 - y1:
		for i in range(m1 - m2):
			print('R')
	else:
		for i in range(m1 - m2):
			print('U')


s = input()
t = input()
(cs, ct) = (ord(s[0]) - 96, ord(t[0]) - 96)
(rs, rt) = (int(s[1]), int(t[1]))
h = 0
l = ''
for i in range(abs(cs - ct)):
	h += 1
	if cs > ct and rs > rt:
		l += 'LD '
		cs -= 1
		rs -= 1
	elif cs > ct and rs < rt:
		l += 'LU '
		cs -= 1
		rs += 1
	elif cs > ct and rs == rt:
		l += 'L '
		cs -= 1
	elif cs < ct and rs > rt:
		l += 'RD '
		cs += 1
		rs -= 1
	elif cs < ct and rs < rt:
		l += 'RU '
		cs += 1
		rs += 1
	elif cs < ct and rs == rt:
		l += 'R '
		cs += 1
for i in range(abs(rs - rt)):
	h += 1
	if rs > rt:
		l += 'D '
		rs -= 1
	elif rs < rt:
		l += 'U '
		rs += 1
print(h)
l1 = l.split()
for i in range(len(l1)):
	print(l1[i])


s = input()
d = input()
S = 'abcdefgh'
x = [S.index(s[0]) + 1, int(s[1])]
y = [S.index(d[0]) + 1, int(d[1])]
Results = []
while x != y:
	if x[0] == y[0]:
		if x[1] > y[1]:
			Results.append('D\n')
			x[1] -= 1
		else:
			Results.append('U\n')
			x[1] += 1
	elif x[0] > y[0]:
		if x[1] > y[1]:
			Results.append('LD\n')
			x[0] -= 1
			x[1] -= 1
		elif x[1] < y[1]:
			Results.append('LU\n')
			x[1] += 1
			x[0] -= 1
		else:
			Results.append('L\n')
			x[0] -= 1
	elif x[1] > y[1]:
		Results.append('RD\n')
		x[1] -= 1
		x[0] += 1
	elif x[1] < y[1]:
		Results.append('RU\n')
		x[1] += 1
		x[0] += 1
	else:
		Results.append('R\n')
		x[0] += 1
print(len(Results))
for item in Results:
	print(item, end='')


s = input()
t = input()
dx = ord(t[0]) - ord(s[0])
dy = ord(t[1]) - ord(s[1])
print(max(abs(dx), abs(dy)))
while dx != 0 or dy != 0:
	cx = ''
	if dx > 0:
		dx -= 1
		cx = 'R'
	elif dx < 0:
		dx += 1
		cx = 'L'
	if dy > 0:
		print(cx + 'U')
		dy -= 1
	elif dy == 0:
		print(cx)
	else:
		print(cx + 'D')
		dy += 1


s = input()
t = input()
cnt = 0
moves = []
i = 0
while s != t:
	cnt += 1
	x = [s[0], s[1]]
	if s[0] > t[0] and s[1] < t[1]:
		x[0] = chr(ord(s[0]) - 1)
		x[1] = chr(ord(s[1]) + 1)
		moves.append('LU')
	elif s[0] > t[0] and s[1] > t[1]:
		x[0] = chr(ord(s[0]) - 1)
		x[1] = chr(ord(s[1]) - 1)
		moves.append('LD')
	elif s[0] < t[0] and s[1] > t[1]:
		x[0] = chr(ord(s[0]) + 1)
		x[1] = chr(ord(s[1]) - 1)
		moves.append('RD')
	elif s[0] < t[0] and s[1] < t[1]:
		x[0] = chr(ord(s[0]) + 1)
		x[1] = chr(ord(s[1]) + 1)
		moves.append('RU')
	elif s[0] < t[0]:
		x[0] = chr(ord(s[0]) + 1)
		moves.append('R')
	elif s[0] > t[0]:
		x[0] = chr(ord(s[0]) - 1)
		moves.append('L')
	elif s[1] > t[1]:
		x[1] = chr(ord(s[1]) - 1)
		moves.append('D')
	else:
		x[1] = chr(ord(s[1]) + 1)
		moves.append('U')
	s = ''
	s += x[0]
	s += x[1]
print(cnt)
for i in moves:
	print(i)


s = input()
t = input()
dx = ord(t[0]) - ord(s[0])
dy = int(t[1]) - int(s[1])
adx = abs(dx)
ady = abs(dy)
m = ''
for i in range(max(adx, ady)):
	s = ''
	if i < adx:
		if dx > 0:
			s += 'R'
		elif dx < 0:
			s += 'L'
	if i < ady:
		if dy > 0:
			s += 'U'
		elif dy < 0:
			s += 'D'
	m += s
m = m.replace('RD', 'K')
m = m.replace('RU', 'M')
m = m.replace('LD', 'X')
m = m.replace('LU', 'N')
n = len(m)
M = ''
for i in range(n - 1):
	M += m[i] + '\n'
if n > 0:
	M += m[n - 1]
M = M.replace('K', 'RD')
M = M.replace('M', 'RU')
M = M.replace('X', 'LD')
M = M.replace('N', 'LU')
print(n)
print(M)


s = input()
t = input()
(u, v) = (ord(s[0]) - ord(t[0]), ord(s[1]) - ord(t[1]))
print(max(u, -u, v, -v))
while u != 0 or v != 0:
	a = ''
	if u < 0:
		a = 'R'
		u += 1
	if u > 0:
		a = 'L'
		u -= 1
	if v < 0:
		a += 'U'
		v += 1
	if v > 0:
		a += 'D'
		v -= 1
	print(a)


start = input()
end = input()
rl = ['L' if ord(start[0]) > ord(end[0]) else 'R'] * abs(ord(start[0]) - ord(end[0]))
ud = ['D' if ord(start[1]) > ord(end[1]) else 'U'] * abs(ord(start[1]) - ord(end[1]))
print(max(len(rl), len(ud)))
for n in range(max(len(rl), len(ud))):
	print((rl[n] if len(rl) > n else '') + (ud[n] if len(ud) > n else ''))


import string
d = {a: i + 1 for (i, a) in enumerate(string.ascii_lowercase)}
s = input()
t = input()
(x1, y1) = (d[s[0]], int(s[1]))
(x2, y2) = (d[t[0]], int(t[1]))
a = x2 - x1
b = y2 - y1
moves = max(abs(a), abs(b))
print(moves)
if a >= 0 and b >= 0:
	if abs(a) > abs(b):
		print('RU\n' * abs(b) + 'R\n' * (abs(a) - abs(b)))
	else:
		print('RU\n' * abs(a) + 'U\n' * (abs(b) - abs(a)))
elif a >= 0 and b < 0:
	if abs(a) > abs(b):
		print('RD\n' * abs(b) + 'R\n' * (abs(a) - abs(b)))
	else:
		print('RD\n' * abs(a) + 'D\n' * (abs(b) - abs(a)))
elif a < 0 and b >= 0:
	if abs(a) > abs(b):
		print('LU\n' * abs(b) + 'L\n' * (abs(a) - abs(b)))
	else:
		print('LU\n' * abs(a) + 'U\n' * (abs(b) - abs(a)))
elif abs(a) > abs(b):
	print('LD\n' * abs(b) + 'L\n' * (abs(a) - abs(b)))
else:
	print('LD\n' * abs(a) + 'D\n' * (abs(b) - abs(a)))


(s, e) = (input(), input())
(x1, y1, x2, y2) = (s[0], s[1], e[0], e[1])
if x1 < x2:
	xd = ord(x2) - ord(x1)
	if y1 < y2:
		yd = int(y2) - int(y1)
		if xd > yd:
			print('%d\n%s' % (xd, 'RU\n' * yd + 'R\n' * (xd - yd)))
		else:
			print('%d\n%s' % (yd, 'RU\n' * xd + 'U\n' * (yd - xd)))
	else:
		yd = int(y1) - int(y2)
		if xd > yd:
			print('%d\n%s' % (xd, 'RD\n' * yd + 'R\n' * (xd - yd)))
		else:
			print('%d\n%s' % (yd, 'RD\n' * xd + 'D\n' * (yd - xd)))
else:
	xd = ord(x1) - ord(x2)
	if y1 < y2:
		yd = int(y2) - int(y1)
		if xd > yd:
			print('%d\n%s' % (xd, 'LU\n' * yd + 'L\n' * (xd - yd)))
		else:
			print('%d\n%s' % (yd, 'LU\n' * xd + 'U\n' * (yd - xd)))
	else:
		yd = int(y1) - int(y2)
		if xd > yd:
			print('%d\n%s' % (xd, 'LD\n' * yd + 'L\n' * (xd - yd)))
		else:
			print('%d\n%s' % (yd, 'LD\n' * xd + 'D\n' * (yd - xd)))


c_p = input()
r_p = input()

def R():
	global p
	p = p.replace(p[0], a[a.index(p[0]) + 1])
	return p

def L():
	global p
	p = p.replace(p[0], a[a.index(p[0]) - 1])
	return p

def U():
	global p
	p = p.replace(p[1], b[b.index(p[1]) + 1])
	return p

def D():
	global p
	p = p.replace(p[1], b[b.index(p[1]) - 1])
	return p

def LU():
	L()
	U()

def LD():
	L()
	D()

def RU():
	R()
	U()

def RD():
	R()
	D()
a = 'abcdefgh'
b = '12345678'
A = c_p[0]
B = c_p[1]
p = c_p
n = 0
moves = []
if c_p == r_p:
	print(0)
	quit()
while p != r_p:
	if p[0] == r_p[0]:
		if b.index(p[1]) > b.index(r_p[1]):
			while B != r_p[1]:
				D()
				moves.append('D')
				n = n + 1
				B = p[1]
		elif b.index(p[1]) < b.index(r_p[1]):
			while B != r_p[1]:
				U()
				moves.append('U')
				n = n + 1
				B = p[1]
	elif p[1] == r_p[1]:
		if a.index(p[0]) > a.index(r_p[0]):
			while A != r_p[0]:
				L()
				moves.append('L')
				n = n + 1
				A = p[0]
		elif a.index(p[0]) < a.index(r_p[0]):
			while A != r_p[0]:
				R()
				moves.append('R')
				n = n + 1
				A = p[0]
	elif b.index(p[1]) > b.index(r_p[1]) and a.index(p[0]) > a.index(r_p[0]):
		LD()
		moves.append('LD')
		n = n + 1
	elif b.index(p[1]) > b.index(r_p[1]) and a.index(p[0]) < a.index(r_p[0]):
		RD()
		moves.append('RD')
		n = n + 1
	elif b.index(p[1]) < b.index(r_p[1]) and a.index(p[0]) > a.index(r_p[0]):
		LU()
		moves.append('LU')
		n = n + 1
	elif b.index(p[1]) < b.index(r_p[1]) and a.index(p[0]) < a.index(r_p[0]):
		RU()
		moves.append('RU')
		n = n + 1
print(n)
for m in moves:
	print(m)


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

def dirname(dir):
	output = ''
	if dir[0] == 1:
		output += 'R'
	elif dir[0] == -1:
		output += 'L'
	if dir[1] == 1:
		output += 'U'
	elif dir[1] == -1:
		output += 'D'
	return output
alphabet = 'abcdefgh'
start = input().strip()
start = (alphabet.index(start[0]), int(start[1]) - 1)
end = input().strip()
end = (alphabet.index(end[0]), int(end[1]) - 1)
xsteps = end[0] - start[0]
ysteps = end[1] - start[1]
steps = max(abs(xsteps), abs(ysteps))
diagonal = min(abs(xsteps), abs(ysteps))
direction = (sign(xsteps), sign(ysteps))
print(steps)
for i in range(diagonal):
	start = (start[0] + direction[0], start[1] + direction[1])
	print(dirname(direction))
while start[0] != end[0]:
	start = (start[0] + direction[0], start[1])
	print(dirname((direction[0], 0)))
while start[1] != end[1]:
	start = (start[0], start[1] + direction[1])
	print(dirname((0, direction[1])))


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)


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


import sys
input = sys.stdin.readline

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

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

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

def foo():
	s = insr()
	(s[0], s[1]) = (ord(s[0]), int(s[1]))
	t = insr()
	(t[0], t[1]) = (ord(t[0]), int(t[1]))
	cnt = 0
	ad = []
	while True:
		if s[0] == t[0] or s[1] == t[1]:
			break
		if t[0] - s[0] > 0 and t[1] - s[1] > 0:
			cnt += 1
			ad.append('RU')
			s[0] += 1
			s[1] += 1
		elif t[0] - s[0] > 0 and t[1] - s[1] < 0:
			cnt += 1
			ad.append('RD')
			s[0] += 1
			s[1] -= 1
		elif t[0] - s[0] < 0 and t[1] - s[1] > 0:
			cnt += 1
			ad.append('LU')
			s[0] -= 1
			s[1] += 1
		else:
			cnt += 1
			ad.append('LD')
			s[0] -= 1
			s[1] -= 1
	while True:
		if s[0] == t[0] and s[1] == t[1]:
			break
		if t[1] - s[1] > 0:
			cnt += 1
			ad.append('U')
			s[1] += 1
		elif t[1] - s[1] < 0:
			cnt += 1
			ad.append('D')
			s[1] -= 1
		elif t[0] - s[0] > 0:
			cnt += 1
			ad.append('R')
			s[0] += 1
		else:
			cnt += 1
			ad.append('L')
			s[0] -= 1
	print(len(ad))
	for item in ad:
		print(item)
foo()


import sys

def moves_route(moves_no, x_axis_moves, y_axis_moves):
	moves = []
	for _ in range(moves_no):
		if x_axis_moves > 0:
			moves.append('R')
			x_axis_moves -= 1
		elif x_axis_moves < 0:
			moves.append('L')
			x_axis_moves += 1
		if y_axis_moves > 0:
			moves.append('U')
			y_axis_moves -= 1
		elif y_axis_moves < 0:
			moves.append('D')
			y_axis_moves += 1
		moves.append('\n')
	return moves

def main(sinp=sys.stdin, sout=sys.stdout):
	(start, end) = sinp.read().split()
	letter_coords = 'abcdefgh'
	letter_to_num = {letter_coords[i]: i for i in range(len(letter_coords))}
	y_axis_moves = int(end[1]) - int(start[1])
	x_axis_moves = letter_to_num[end[0]] - letter_to_num[start[0]]
	moves_no = max(abs(x_axis_moves), abs(y_axis_moves))
	sout.write(str(moves_no) + '\n')
	sout.write(''.join(moves_route(moves_no, x_axis_moves, y_axis_moves)))
main()


(s1, s2, ans) = (list(input()), input(), [])
while ''.join(s1) != s2:
	if s1[1] == s2[1]:
		if s1[0] > s2[0]:
			ans.append('L')
			s1[0] = chr(ord(s1[0]) - 1)
		else:
			ans.append('R')
			s1[0] = chr(ord(s1[0]) + 1)
	elif s1[0] == s2[0]:
		if int(s1[1]) > int(s2[1]):
			ans.append('D')
			s1[1] = str(int(s1[1]) - 1)
		else:
			ans.append('U')
			s1[1] = str(int(s1[1]) + 1)
	else:
		tem = ''
		if s1[0] > s2[0]:
			tem += 'L'
			s1[0] = chr(ord(s1[0]) - 1)
		else:
			tem += 'R'
			s1[0] = chr(ord(s1[0]) + 1)
		if int(s1[1]) > int(s2[1]):
			tem += 'D'
			s1[1] = str(int(s1[1]) - 1)
		else:
			tem += 'U'
			s1[1] = str(int(s1[1]) + 1)
		ans.append(tem)
print(len(ans))
print(*ans, sep='\n')


def main():

	def sign(x):
		return 1 if x > 0 else -1
	s = input()
	x0 = ord(s[0]) - ord('a')
	y0 = int(s[1])
	t = input()
	x1 = ord(t[0]) - ord('a')
	y1 = int(t[1])
	ans = []
	while x0 != x1 and y0 != y1:
		ans.append('LR'[x0 < x1] + 'DU'[y0 < y1])
		x0 += sign(x1 - x0)
		y0 += sign(y1 - y0)
	while x0 != x1:
		ans.append('LR'[x0 < x1])
		x0 += sign(x1 - x0)
	while y0 != y1:
		ans.append('DU'[y0 < y1])
		y0 += sign(y1 - y0)
	print(len(ans))
	print('\n'.join(ans))
import sys, io, os
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(io.IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	for x in args:
		file.write(str(x))
	file.write(kwargs.pop('end', '\n'))
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inputt = lambda t=0: range(t) if t else range(int(input()))
inputi = lambda : map(int, input().split())
inputl = lambda : list(inputi())
from math import *
from heapq import *
from bisect import *
from itertools import *
from functools import reduce, lru_cache
from collections import Counter, defaultdict
import re, copy, operator, cmath
from builtins import *
main()


s = input()
t = input()
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)


mode = 'filadasde'
if mode == 'file':
	f = open('test.txt', 'r')
g = []
if mode == 'file':
	first = list(f.readline())[:-1]
	second = list(f.readline())
else:
	first = list(input())
	second = list(input())
while first != second:
	horizontal = ''
	vertical = ''
	if first[0] < second[0]:
		first[0] = chr(ord(first[0]) + 1)
		horizontal = 'R'
	elif first[0] > second[0]:
		first[0] = chr(ord(first[0]) - 1)
		horizontal = 'L'
	if first[1] < second[1]:
		first[1] = chr(ord(first[1]) + 1)
		vertical = 'U'
	elif first[1] > second[1]:
		first[1] = chr(ord(first[1]) - 1)
		vertical = 'D'
	g.append([horizontal, vertical])
print(len(g))
for i in g:
	print('{0}{1}'.format(i[0], i[1]))
if mode == 'file':
	f.close()


def checkPath(row, col):
	li = []
	if row - 1 >= 0 and (not ar[row - 1][col]):
		ar[row - 1][col] = ar[row][col] + 1
		li.append([row - 1, col])
	if col - 1 >= 0 and (not ar[row][col - 1]):
		ar[row][col - 1] = ar[row][col] + 1
		li.append([row, col - 1])
	if row + 1 < 8 and (not ar[row + 1][col]):
		ar[row + 1][col] = ar[row][col] + 1
		li.append([row + 1, col])
	if col + 1 < 8 and (not ar[row][col + 1]):
		ar[row][col + 1] = ar[row][col] + 1
		li.append([row, col + 1])
	if row - 1 >= 0 and col - 1 >= 0 and (not ar[row - 1][col - 1]):
		ar[row - 1][col - 1] = ar[row][col] + 1
		li.append([row - 1, col - 1])
	if row - 1 >= 0 and col + 1 < 8 and (not ar[row - 1][col + 1]):
		ar[row - 1][col + 1] = ar[row][col] + 1
		li.append([row - 1, col + 1])
	if row + 1 < 8 and col + 1 < 8 and (not ar[row + 1][col + 1]):
		ar[row + 1][col + 1] = ar[row][col] + 1
		li.append([row + 1, col + 1])
	if row + 1 < 8 and col - 1 >= 0 and (not ar[row + 1][col - 1]):
		ar[row + 1][col - 1] = ar[row][col] + 1
		li.append([row + 1, col - 1])
	return li
ar = [[0] * 8 for _ in range(8)]
(startp, startq) = list(input().strip())
startx = ord('8') - ord(startq)
starty = ord(startp) - ord('a')
(endp, endq) = list(input().strip())
endx = ord('8') - ord(endq)
endy = ord(endp) - ord('a')
ar[startx][starty] = 1
li = checkPath(startx, starty)
while li:
	t = []
	for (m, n) in li:
		if (m, n) == (endx, endy):
			t = []
			break
		t.extend(checkPath(m, n))
	li = t
print(ar[endx][endy] - 1)
li = []
idx = ar[endx][endy]
(row, col) = (endx, endy)
while idx:
	idx -= 1
	if row - 1 >= 0 and ar[row - 1][col] == idx:
		li.append('D')
		row -= 1
		continue
	if col - 1 >= 0 and ar[row][col - 1] == idx:
		li.append('R')
		col -= 1
		continue
	if row + 1 < 8 and ar[row + 1][col] == idx:
		li.append('U')
		row += 1
		continue
	if col + 1 < 8 and ar[row][col + 1] == idx:
		li.append('L')
		col += 1
		continue
	if row - 1 >= 0 and col - 1 >= 0 and (ar[row - 1][col - 1] == idx):
		li.append('RD')
		row -= 1
		col -= 1
		continue
	if row - 1 >= 0 and col + 1 < 8 and (ar[row - 1][col + 1] == idx):
		li.append('LD')
		row -= 1
		col += 1
		continue
	if row + 1 < 8 and col + 1 < 8 and (ar[row + 1][col + 1] == idx):
		li.append('LU')
		row += 1
		col += 1
		continue
	if row + 1 < 8 and col - 1 >= 0 and (ar[row + 1][col - 1] == idx):
		li.append('RU')
		row += 1
		col -= 1
		continue
li.reverse()
for item in li:
	print(item)


n = input()
m = input()
xi = n[0]
yi = int(n[1])
xf = m[0]
yf = int(m[1])
sol = []
while xi != xf or yi != yf:
	ok = 0
	if xi < xf:
		sol.append('R')
		xi = chr(ord(xi) + 1)
		ok = 1
	elif xi > xf:
		sol.append('L')
		xi = chr(ord(xi) - 1)
		ok = 1
	if yi < yf:
		if ok:
			sol[len(sol) - 1] += 'U'
		else:
			sol.append('U')
		yi += 1
	elif yi > yf:
		if ok:
			sol[len(sol) - 1] += 'D'
		else:
			sol.append('D')
		yi -= 1
print(len(sol))
for i in range(len(sol)):
	print(sol[i])


s = input()
t = input()
d_x = ord(s[0]) - ord(t[0])
d_y = ord(s[1]) - ord(t[1])
print(max(abs(d_x), abs(d_y)))
path = []
while abs(d_x):
	if d_x < 0:
		path.append('R')
		d_x += 1
	elif d_x > 0:
		path.append('L')
		d_x -= 1
step = 0
while abs(d_y) and step < max(abs(d_x), abs(d_y)):
	if d_y < 0:
		try:
			path[step] += 'U'
		except:
			path.append('U')
	elif d_y > 0:
		try:
			path[step] += 'D'
		except:
			path.append('D')
	step += 1
for step in path:
	print(step)


s = input()
e = input()
c = s
steps = []
while c != e:
	nc = ''
	ns = ''
	if c[0] < e[0]:
		ns = 'R'
		nc = chr(ord(c[0]) + 1)
	elif c[0] > e[0]:
		ns = 'L'
		nc = chr(ord(c[0]) - 1)
	else:
		nc = e[0]
	if c[1] < e[1]:
		ns += 'U'
		nc += str(int(c[1]) + 1)
	elif c[1] > e[1]:
		ns += 'D'
		nc += str(int(c[1]) - 1)
	else:
		nc += e[1]
	steps.append(ns)
	c = nc
print(len(steps))
for step in steps:
	print(step)


start = input()
end = input()
x1 = ord(start[0]) - ord('a') + 1
y1 = eval(start[1])
x2 = ord(end[0]) - ord('a') + 1
y2 = eval(end[1])
steps = max(abs(x1 - x2), abs(y1 - y2))
print(steps)
while x1 != x2 or y1 != y2:
	if x1 < x2:
		print('R', end='')
		x1 += 1
	elif x1 > x2:
		print('L', end='')
		x1 -= 1
	if y1 < y2:
		print('U')
		y1 += 1
	elif y1 > y2:
		print('D')
		y1 -= 1
	elif y1 == y2:
		print()


origin = input()
destination = input()
x = ord(destination[0]) - ord(origin[0])
y = ord(destination[1]) - ord(origin[1])
print(max(abs(x), abs(y)))
while x != 0 or y != 0:
	(line, x) = ('L', x + 1) if x < 0 else ('R', x - 1) if x > 0 else ('', x)
	(line, y) = (line + 'D', y + 1) if y < 0 else (line + 'U', y - 1) if y > 0 else (line, y)
	print(line)


s = list(str(input()))
t = list(str(input()))
refer = 'abcdefgh'
r = [refer.index(s[0]) - refer.index(t[0]), int(s[1]) - int(t[1])]
h_line = list()
v_line = list()
if r[0] > 0:
	h_line = ['L'] * abs(r[0])
else:
	h_line = ['R'] * abs(r[0])
if r[1] > 0:
	v_line = ['D'] * abs(r[1])
else:
	v_line = ['U'] * abs(r[1])
r_line = list()
h_size = len(h_line)
v_size = len(v_line)
for i in range(min(h_size, v_size)):
	r_line.append(h_line[i] + v_line[i])
if h_size > v_size:
	r_line.extend(h_line[v_size:])
else:
	r_line.extend(v_line[h_size:])
print(max(h_size, v_size))
print('\n'.join(r_line))


s = input()
t = input()
(s1, s2) = (ord(s[0]), int(s[1]))
(t1, t2) = (ord(t[0]), int(t[1]))
num1 = t1 - s1
num2 = t2 - s2
num = max(abs(num1), abs(num2))
print(num)
for i in range(num):
	scr = ''
	if num1 > 0:
		scr += 'R'
		num1 -= 1
	elif num1 < 0:
		scr += 'L'
		num1 += 1
	if num2 > 0:
		scr += 'U'
		num2 -= 1
	elif num2 < 0:
		scr += 'D'
		num2 += 1
	print(scr)


a = input()
b = input()
x1 = ord(a[0])
x2 = ord(b[0])
disx = abs(x2 - x1)
if x1 > x2:
	xj = 'L'
elif x2 > x1:
	xj = 'R'
else:
	xj = 'no'
y1 = int(a[1])
y2 = int(b[1])
if y2 > y1:
	yj = 'U'
elif y1 > y2:
	yj = 'D'
else:
	yj = 'no'
disy = abs(y2 - y1)
g = min(disy, disx)
print(-g + disx + disy)
for i in range(g):
	print(xj + yj)
disx -= g
disy -= g
for i in range(disx):
	print(xj)
for i in range(disy):
	print(yj)


def main():
	(a, b) = (input(), input())
	a = (ord(a[0]) - ord('a'), int(a[1]) - 1)
	b = (ord(b[0]) - ord('a'), int(b[1]) - 1)
	ans = []
	while a != b:
		if a[0] < b[0] and a[1] < b[1]:
			ans.append('RU')
			a = (a[0] + 1, a[1] + 1)
		elif a[0] < b[0] and a[1] > b[1]:
			ans.append('RD')
			a = (a[0] + 1, a[1] - 1)
		elif a[0] < b[0] and a[1] == b[1]:
			ans.append('R')
			a = (a[0] + 1, a[1])
		elif a[0] > b[0] and a[1] < b[1]:
			ans.append('LU')
			a = (a[0] - 1, a[1] + 1)
		elif a[0] > b[0] and a[1] > b[1]:
			ans.append('LD')
			a = (a[0] - 1, a[1] - 1)
		elif a[0] > b[0] and a[1] == b[1]:
			ans.append('L')
			a = (a[0] - 1, a[1])
		elif a[0] == b[0] and a[1] < b[1]:
			ans.append('U')
			a = (a[0], a[1] + 1)
		elif a[0] == b[0] and a[1] > b[1]:
			ans.append('D')
			a = (a[0], a[1] - 1)
	print(len(ans))
	print('\n'.join(ans))
main()


import sys
(fs, rs) = list(sys.stdin.readline().rstrip())
(fe, re) = list(sys.stdin.readline().rstrip())
fs = ord(fs) - ord('a')
fe = ord(fe) - ord('a')
(rs, re) = (int(rs), int(re))
d = max(abs(fs - fe), abs(rs - re))
print(d)
while re - rs != 0 and fe - fs != 0:
	if re > rs:
		if fe > fs:
			print('RU')
			rs += 1
			fs += 1
		else:
			print('LU')
			rs += 1
			fs -= 1
	elif fe > fs:
		print('RD')
		rs -= 1
		fs += 1
	else:
		print('LD')
		rs -= 1
		fs -= 1
while re != rs or fe != fs:
	if re == rs:
		if fe > fs:
			print('R')
			fs += 1
		else:
			print('L')
			fs -= 1
	elif re > rs:
		print('U')
		rs += 1
	else:
		print('D')
		rs -= 1


s = input()
t = input()

def str_to_nmb(argument):
	switcher = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
	return switcher.get(argument, 'nothing')
s = [str_to_nmb(s[0]), int(s[1])]
t = [str_to_nmb(t[0]), int(t[1])]
count = 0
lst = []
while s != t:
	while s[0] != t[0] and s[1] != t[1]:
		if s[0] > t[0] and s[1] > t[1]:
			s[0] -= 1
			s[1] -= 1
			lst.append('LD')
		if s[0] > t[0] and s[1] < t[1]:
			s[0] -= 1
			s[1] += 1
			lst.append('LU')
		if s[0] < t[0] and s[1] > t[1]:
			s[0] += 1
			s[1] -= 1
			lst.append('RD')
		if s[0] < t[0] and s[1] < t[1]:
			s[0] += 1
			s[1] += 1
			lst.append('RU')
		count += 1
	if s[0] == t[0]:
		if s[1] > t[1]:
			s[1] -= 1
			count += 1
			lst.append('D')
		elif s[1] < t[1]:
			s[1] += 1
			count += 1
			lst.append('U')
		else:
			break
	if s[1] == t[1]:
		if s[0] > t[0]:
			s[0] -= 1
			count += 1
			lst.append('L')
		elif s[0] < t[0]:
			s[0] += 1
			count += 1
			lst.append('R')
		else:
			break
print(count)
print('\n'.join(lst))


line = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
s = str(input())
w = str(input())
x = int(line.index(list(s)[0]))
y = int(line.index(list(w)[0]))
a = int(list(s)[1])
b = int(list(w)[1])
z = abs(x - y)
p = abs(a - b)
print(max(z, p))
if z > p and z != 0:
	if x > y:
		if a > b:
			for i in range(p):
				print('LD')
			for i in range(z - p):
				print('L')
		elif a < b:
			for i in range(p):
				print('LU')
			for i in range(z - p):
				print('L')
		else:
			for i in range(z):
				print('L')
	elif x < y:
		if a > b:
			for i in range(p):
				print('RD')
			for i in range(z - p):
				print('R')
		elif a < b:
			for i in range(p):
				print('RU')
			for i in range(z - p):
				print('R')
		else:
			for i in range(z):
				print('R')
if z < p and p != 0:
	if a > b:
		if x > y:
			for i in range(z):
				print('LD')
			for i in range(p - z):
				print('D')
		elif x < y:
			for i in range(z):
				print('RD')
			for i in range(p - z):
				print('D')
		else:
			for i in range(p):
				print('R')
	if a < b:
		if x > y:
			for i in range(z):
				print('LU')
			for i in range(p - z):
				print('U')
		elif x < y:
			for i in range(z):
				print('RU')
			for i in range(p - z):
				print('U')
		else:
			for i in range(p):
				print('U')
if z == p and z != 0:
	if a < b:
		if x > y:
			for i in range(z):
				print('LU')
		if x < y:
			for i in range(z):
				print('RU')
	if a > b:
		if x > y:
			for i in range(z):
				print('LD')
		if x < y:
			for i in range(z):
				print('RD')


from queue import Queue
offset = (('L', 0, -1), ('R', 0, 1), ('U', 1, 0), ('D', -1, 0), ('LU', 1, -1), ('LD', -1, -1), ('RU', 1, 1), ('RD', -1, 1))

def possible(i, j):
	return 0 <= i < 8 and 0 <= j < 8

def bfs(s, t):
	queue = Queue()
	s = (int(s[1]) - 1, ord(s[0]) - 97, [])
	(ti, tj) = (int(t[1]) - 1, ord(t[0]) - 97)
	queue.put(s)
	visited = [[False] * 8 for _ in range(8)]
	while True:
		(i, j, path) = queue.get()
		if i == ti and j == tj:
			return (len(path), path)
		visited[i][j] = True
		for (direction, di, dj) in offset:
			newi = i + di
			newj = j + dj
			if possible(newi, newj) and (not visited[newi][newj]):
				queue.put((newi, newj, path + [direction]))

def main():
	s = input()
	t = input()
	(n, path) = bfs(s, t)
	print(n)
	print(*path, sep='\n')
main()


l = list(input())
(s, p) = (l[0], l[1])
p = int(p)
l = list(input())
(t, q) = (l[0], l[1])
q = int(q)
x = abs(ord(s) - ord(t))
y = abs(p - q)
if x > y:
	n = x - y
	m = y
	if ord(t) > ord(s):
		g = 'R'
	else:
		g = 'L'
	if p > q:
		h = 'D'
	else:
		h = 'U'
else:
	n = y - x
	m = x
	if p > q:
		g = 'D'
	else:
		g = 'U'
	if ord(t) > ord(s):
		h = 'R'
	else:
		h = 'L'
print(n + m)
if h + g == 'LU' or h + g == 'LD' or h + g == 'RU' or (h + g == 'RD'):
	for i in range(n):
		print(g)
	for i in range(m):
		print(h + g)
else:
	for i in range(m):
		print(g + h)
	for i in range(n):
		print(g)


arr_row = ['0', '8', '7', '6', '5', '4', '3', '2', '1']
arr_col = ['0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
vectors = [[0, 1], [0, -1], [1, 0], [-1, 0], [1, 1], [-1, -1], [-1, 1], [1, -1]]
directions = ['R', 'L', 'D', 'U', 'RD', 'LU', 'RU', 'LD']

def get_position_row(a_row, a):
	k = 0
	for i in range(len(arr_row)):
		if arr_row[i] == a[1]:
			k = i
	return k

def get_position_col(a_col, a):
	y = 0
	for j in range(len(a_col)):
		if a_col[j] == a[0]:
			y = j
	return y

def get_directions(vectors_map, directions_0, a):
	direction = ''
	for i in range(len(vectors_map)):
		if vectors_map[i] == a:
			direction = directions_0[i]
	return direction

def next_direction(a):
	k = []
	if a == 0:
		k.append(0)
		k.append(0)
	if a != 0:
		if a / abs(a) < 0:
			k.append(abs(a))
			k.append(str(-1))
		if a / abs(a) > 0:
			k.append(abs(a))
			k.append(str(1))
	return k
s = input()
t = input()
x = get_position_row(arr_row, t) - get_position_row(arr_row, s)
y = get_position_col(arr_col, t) - get_position_col(arr_col, s)
delta = min(abs(x), abs(y))
if x == 0:
	dx = 0
else:
	dx = x / abs(x)
if y == 0:
	dy = 0
else:
	dy = y / abs(y)
vector_0 = [int(dx), int(dy)]
x0 = int(x - delta * dx)
y0 = int(y - delta * dy)
x1 = next_direction(x0)
y1 = next_direction(y0)
delta_1 = int(x1[0]) + int(y1[0])
vector_1 = [int(x1[1]), int(y1[1])]
steps = delta + delta_1
path = []
for i in range(delta):
	path.append(get_directions(vectors, directions, vector_0))
for j in range(delta_1):
	path.append(get_directions(vectors, directions, vector_1))
print(steps)
for i in path:
	print(i, end='')
	print()


a = list(input())
b = list(input())
c = abs(ord(a[0]) - ord(b[0]))
a[0] = ord(a[0])
a[1] = ord(a[1])
b[0] = ord(b[0])
b[1] = ord(b[1])
print(max(abs(a[0] - b[0]), abs(a[1] - b[1])))
while abs(a[0] - b[0]) and abs(a[1] - b[1]):
	if a[0] > b[0] and a[1] > b[1]:
		a[0] = a[0] - 1
		a[1] = a[1] - 1
		print('LD')
	if a[0] > b[0] and a[1] < b[1]:
		a[0] = a[0] - 1
		b[1] = b[1] - 1
		print('LU')
	if a[0] < b[0] and a[1] > b[1]:
		b[0] = b[0] - 1
		a[1] = a[1] - 1
		print('RD')
	if a[0] < b[0] and a[1] < b[1]:
		b[0] = b[0] - 1
		b[1] = b[1] - 1
		print('RU')
while abs(a[0] - b[0]):
	if a[0] > b[0]:
		a[0] -= 1
		print('L')
	if a[0] < b[0]:
		b[0] -= 1
		print('R')
while abs(a[1] - b[1]):
	if a[1] > b[1]:
		a[1] -= 1
		print('D')
	if a[1] < b[1]:
		b[1] -= 1
		print('U')


(start, end) = (input(), input())
(h, v) = (ord(end[0]) - ord(start[0]), int(end[1]) - int(start[1]))
diag = min(abs(h), abs(v))
st = max(abs(v) - diag, abs(h) - diag)
print(diag + st)
(s1, s2) = ('', '')
if h > 0:
	s1 += 'R'
else:
	s1 += 'L'
if v > 0:
	s1 += 'U'
else:
	s1 += 'D'
if abs(v) > abs(h):
	if v > 0:
		s2 = 'U'
	else:
		s2 = 'D'
elif h > 0:
	s2 = 'R'
else:
	s2 = 'L'
for i in range(diag):
	print(s1)
for i in range(st):
	print(s2)


(x1, y1) = [ord(i) - 48 for i in input()]
(x2, y2) = [ord(i) - 48 for i in input()]
mat = []
while x1 != x2 or y1 != y2:
	s = ''
	if x2 > x1:
		x1 += 1
		s += 'R'
	if x2 < x1:
		x1 -= 1
		s += 'L'
	if y2 > y1:
		y1 += 1
		s += 'U'
	if y2 < y1:
		y1 -= 1
		s += 'D'
	mat.append(s)
print(len(mat))
for i in mat:
	print(i)


s = input().rstrip()
start = [ord(s[0]) - ord('a'), int(s[1]) - 1]
s = input().rstrip()
end = [ord(s[0]) - ord('a'), int(s[1]) - 1]
sign = lambda x: 0 if x == 0 else x // abs(x)
moves = {(1, 1): 'RU', (1, -1): 'RD', (-1, 1): 'LU', (-1, -1): 'LD', (0, 1): 'U', (0, -1): 'D', (1, 0): 'R', (-1, 0): 'L'}
res = []
while start != end:
	k = (sign(end[0] - start[0]), sign(end[1] - start[1]))
	start[0] += k[0]
	start[1] += k[1]
	res.append(moves[k])
print(len(res))
for c in res:
	print(c)


f = input()
t = input()
l = ' abcdefgh'
x = l.index(f[0])
y = int(f[1])
tx = l.index(t[0])
ty = int(t[1])
c = 0
r = []
while not (x == tx and y == ty):
	c += 1
	m = ''
	if x > tx:
		m += 'L'
		x -= 1
	elif x < tx:
		m += 'R'
		x += 1
	if y > ty:
		m += 'D'
		y -= 1
	elif y < ty:
		m += 'U'
		y += 1
	r += [m]
print(c)
print('\n'.join(r))


class ChessPos(object):
	trans_1 = {k: v for (v, k) in enumerate('abcdefgh', 1)}
	trans_2 = {k: v for (k, v) in enumerate('abcdefgh', 1)}

	def __init__(self, square):
		self.x = ChessPos.trans_1[square[0]]
		self.y = int(square[1])

	def __sub__(self, other):
		return (self.x - other.x, self.y - other.y)

	def __str__(self):
		return '{}{}:({},{})'.format(ChessPos.trans_2[self.x], self.y, self.x, self.y)
isPos = lambda x: x > 0
isNeg = lambda x: x < 0

def cross_direction(delta):
	if isPos(delta[0]):
		if isPos(delta[1]):
			return 'RU'
		elif isNeg(delta[1]):
			return 'RD'
	elif isNeg(delta[0]):
		if isPos(delta[1]):
			return 'LU'
		elif isNeg(delta[1]):
			return 'LD'

def str8_direction(delta):
	if isPos(delta[0]):
		return 'R'
	elif isNeg(delta[0]):
		return 'L'
	elif isPos(delta[1]):
		return 'U'
	elif isNeg(delta[1]):
		return 'D'

def KingSP():
	start = ChessPos(input())
	end = ChessPos(input())
	delta = end - start
	abs_delta = (abs(delta[0]), abs(delta[1]))
	steps = max(abs_delta)
	cross = abs(min(abs_delta))
	norm_delta = (abs_delta[0] - cross, abs_delta[1] - cross)
	print(steps)
	while isPos(abs_delta[0]) and isPos(abs_delta[1]):
		print(cross_direction(delta))
		abs_delta = (abs_delta[0] - 1, abs_delta[1] - 1)
	delta = (abs_delta[0] * (-1) ** isNeg(delta[0]), abs_delta[1] * (-1) ** isNeg(delta[1]))
	while isPos(abs_delta[0]) or isPos(abs_delta[1]):
		print(str8_direction(delta))
		abs_delta = (abs_delta[0] - 1, abs_delta[1] - 1)
KingSP()


def toCoord(line):
	return (ord('a') - ord(line[0]), ord('1') - ord(line[1]))
(kx, ky) = toCoord(input())
(tx, ty) = toCoord(input())
moves = []
lr = 'L' if kx < tx else 'R'
ud = 'D' if ky < ty else 'U'
if kx != tx and ky != ty:
	if abs(kx - tx) < abs(ky - ty):
		diag = abs(kx - tx)
		parallel = abs(ky - ty) - diag
		last = ud
	else:
		diag = abs(ky - ty)
		parallel = abs(kx - tx) - diag
		last = lr
	for i in range(diag):
		moves.append(lr + ud)
	for i in range(parallel):
		moves.append(last)
elif kx == tx:
	for i in range(abs(ky - ty)):
		moves.append(ud)
else:
	for i in range(abs(kx - tx)):
		moves.append(lr)
print(len(moves))
print('\n'.join(moves))


a = list(input())
a[1] = int(a[1]) - 1
a[0] = ord(a[0]) - 97
b = list(input())
b[1] = int(b[1]) - 1
b[0] = ord(b[0]) - 97
print(max(abs(a[1] - b[1]), abs(a[0] - b[0])))
while a != b:
	dd = ''
	if a[0] < b[0]:
		dd += 'R'
		a[0] += 1
	elif a[0] > b[0]:
		dd += 'L'
		a[0] -= 1
	if a[1] > b[1]:
		dd += 'D'
		a[1] -= 1
	elif a[1] < b[1]:
		dd += 'U'
		a[1] += 1
	print(dd)


x = list(input())
y = list(input())
(x0, y0) = (int(ord(x[0]) - ord('a') + 1), int(x[1]))
(x1, y1) = (int(ord(y[0]) - ord('a') + 1), int(y[1]))
print(max(abs(x1 - x0), abs(y0 - y1)))
while x0 != x1 or y0 != y1:
	if x1 > x0:
		print('R', end='')
		x0 += 1
	if x0 > x1:
		print('L', end='')
		x0 -= 1
	if y0 > y1:
		print('D', end='')
		y0 -= 1
	if y1 > y0:
		print('U', end='')
		y0 += 1
	print()


def rr():
	return input().rstrip()

def rri():
	return int(rr())

def rrl():
	return list(map(int, rr().split()))

def rrt():
	return tuple(map(int, rr().split()))
from collections import defaultdict

def mus(d=lambda : 0):
	return defaultdict(lambda : defaultdict(d))

def dd0(d=lambda : 0):
	return defaultdict(d)

def ms(x, y, d=0):
	return [[0] * y for i in range(x)]

def ar(x, d=0):
	return [d] * x

def ppm(m, n=0, x=0, y=0):
	print('\n'.join(('\t'.join((str(m[j][i]) for j in range(y or n))) for i in range(x or n))))

def ppa(a, n):
	print('\t'.join(map(str, a[0:n])))

def ppl(a=0, x=[1]):
	x[0] = a or x[0] + 1
	print('-' + '- -' * 14 + '-# ' + str(x[0] - 2) + ' #-' + '- -' * 14 + '-')

def fltn(a):
	(i for sub in a for i in sub)

def yn(x):
	return 'YES' if x else 'NO'
from itertools import accumulate
from itertools import groupby

def grp(x):
	return ((i, sum((1 for _ in g))) for (i, g) in groupby(x))
import math

def rnar():
	return (*rrl(), rrl())

def rn():
	return (*rrl(),)

def read():
	st = rr()
	en = rr()
	return (st, en)

def solve(st, en):
	(x1, y1) = (ord('a') - ord(st[0]), int(st[1]))
	(x2, y2) = (ord('a') - ord(en[0]), int(en[1]))
	(dx, dy) = (x2 - x1, y2 - y1)
	em = []
	while dx != 0 or dy != 0:
		cm = ''
		if dx > 0:
			cm += 'L'
			dx -= 1
		elif dx < 0:
			cm += 'R'
			dx += 1
		if dy > 0:
			cm += 'U'
			dy -= 1
		elif dy < 0:
			cm += 'D'
			dy += 1
		em.append(cm)
	ans = str(len(em)) + '\n' + '\n'.join(em)
	return ans
test_count = 1
for _ in range(test_count):
	input_data = read()
	result = solve(*input_data)
	print(result)


s0 = input()
s = []
s.append(ord(s0[0]))
s.append(int(s0[1]))
t0 = input()
t = []
t.append(ord(t0[0]))
t.append(int(t0[1]))
a0 = t[0] - s[0]
b0 = t[1] - s[1]
a = abs(a0)
b = abs(b0)
m = max(a, b)
d = abs(a - b)
h = []
if a0 >= 0 and b0 >= 0:
	if a >= b:
		for i in range(m):
			if i < d:
				h.append('R')
			else:
				h.append('RU')
	else:
		for i in range(m):
			if i < d:
				h.append('U')
			else:
				h.append('RU')
if a0 >= 0 and b0 < 0:
	if a >= b:
		for i in range(m):
			if i < d:
				h.append('R')
			else:
				h.append('RD')
	else:
		for i in range(m):
			if i < d:
				h.append('D')
			else:
				h.append('RD')
if a0 < 0 and b0 >= 0:
	if a >= b:
		for i in range(m):
			if i < d:
				h.append('L')
			else:
				h.append('LU')
	else:
		for i in range(m):
			if i < d:
				h.append('U')
			else:
				h.append('LU')
if a0 < 0 and b0 < 0:
	if a >= b:
		for i in range(m):
			if i < d:
				h.append('L')
			else:
				h.append('LD')
	else:
		for i in range(m):
			if i < d:
				h.append('D')
			else:
				h.append('LD')
print(m)
for i in range(m):
	print(h[i], end='\n')


steps = []
count = 0
step = ['', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
s = input()
t = input()
sx = step.index(s[0])
sy = int(s[1])
tx = step.index(t[0])
ty = int(t[1])
while sx != tx or sy != ty:
	count = count + 1
	if sx > tx:
		if sy > ty:
			steps.append('LD')
			sy = sy - 1
		elif sy < ty:
			steps.append('LU')
			sy = sy + 1
		else:
			steps.append('L')
		sx = sx - 1
	elif sx < tx:
		if sy > ty:
			steps.append('RD')
			sy = sy - 1
		elif sy < ty:
			steps.append('RU')
			sy = sy + 1
		else:
			steps.append('R')
		sx = sx + 1
	elif sy > ty:
		steps.append('D')
		sy = sy - 1
	elif sy < ty:
		steps.append('U')
		sy = sy + 1
print(count)
for i in steps:
	print(i)


p1 = input()
p2 = input()
x1 = ord(p1[0]) - 96
x2 = ord(p2[0]) - 96
y1 = int(p1[1])
y2 = int(p2[1])
z = min(abs(x2 - x1), abs(y2 - y1))
moves = z
ar1 = []
if x2 > x1 and y2 > y1:
	x1 += z
	y1 += z
	for c in range(z):
		ar1.append('RU')
elif x2 > x1 and y2 < y1:
	x1 += z
	y1 -= z
	for c in range(z):
		ar1.append('RD')
elif x2 < x1 and y2 > y1:
	x1 -= z
	y1 += z
	for c in range(z):
		ar1.append('LU')
else:
	x1 -= z
	y1 -= z
	for c in range(z):
		ar1.append('LD')
if x2 > x1:
	moves += x2 - x1
	for c in range(x2 - x1):
		ar1.append('R')
elif x2 < x1:
	moves += x1 - x2
	for c in range(x1 - x2):
		ar1.append('L')
elif y2 > y1:
	moves += y2 - y1
	for c in range(y2 - y1):
		ar1.append('U')
else:
	moves += y1 - y2
	for c in range(y1 - y2):
		ar1.append('D')
print(moves)
for sv in range(len(ar1)):
	print(ar1[sv])


columns = '-abcdefgh'
(x, y) = input()
(x0, y0) = (columns.index(x), int(y))
(x, y) = input()
(x1, y1) = (columns.index(x), int(y))
(dx, dy) = (x1 - x0, y1 - y0)
num_moves = max(map(abs, [dx, dy]))
num_ordinal_moves = min(map(abs, [dx, dy]))
num_cardinal_moves = num_moves - num_ordinal_moves
horizontal_direction = 'L' if dx < 0 else 'R'
vertical_direction = 'D' if dy < 0 else 'U'
ordinal_direction = horizontal_direction + vertical_direction
cardinal_direction = horizontal_direction if abs(dx) > abs(dy) else vertical_direction
directions = [ordinal_direction] * num_ordinal_moves + [cardinal_direction] * num_cardinal_moves
print(len(directions))
print('\n'.join(directions))


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)
switcher = ''
for i in range(h_1):
	if t1 < t2 and int(first_position[1]) < int(second_position[1]):
		print('RU')
		switcher = 'RU'
	if t1 < t2 and int(first_position[1]) > int(second_position[1]):
		print('RD')
		switcher = 'RD'
	if t1 > t2 and int(first_position[1]) < int(second_position[1]):
		print('LU')
		switcher = 'LU'
	if t1 > t2 and int(first_position[1]) > int(second_position[1]):
		print('LD')
		switcher = 'LD'
for j in range(h_2):
	if switcher == 'LU' and h_1_1 < h_1_2:
		print('U')
	if (switcher == 'LU' or switcher == 'LD') and h_1_1 > h_1_2:
		print('L')
	if switcher == 'LD' and h_1_1 < h_1_2:
		print('D')
	if switcher == 'RU' and h_1_1 < h_1_2:
		print('U')
	if switcher == 'RD' and h_1_1 < h_1_2:
		print('D')
	if (switcher == 'RU' or switcher == 'RD') and h_1_1 > h_1_2:
		print('R')
	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 int(first_position[1]) == int(second_position[1]) and t1 < t2:
		print('R')
	if int(first_position[1]) == int(second_position[1]) and t1 > t2:
		print('L')


s = input()
t = input()
srow = int(s[1])
scol = ord(s[0]) - 97 + 1
trow = int(t[1])
tcol = ord(t[0]) - 97 + 1
movelist = []
moves = 0
while True:
	if srow > trow:
		if scol > tcol:
			movelist.append('LD')
			srow -= 1
			scol -= 1
		elif scol < tcol:
			movelist.append('RD')
			srow -= 1
			scol += 1
		else:
			movelist.append('D')
			srow -= 1
	elif srow < trow:
		if scol > tcol:
			movelist.append('LU')
			srow += 1
			scol -= 1
		elif scol < tcol:
			movelist.append('RU')
			srow += 1
			scol += 1
		else:
			movelist.append('U')
			srow += 1
	elif scol > tcol:
		movelist.append('L')
		scol -= 1
	elif scol < tcol:
		movelist.append('R')
		scol += 1
	else:
		break
	moves += 1
print(moves)
for move in movelist:
	print(move)


coord = (input(), input())
(s, t) = [[ord(x) % 16 for x in c] for c in coord]
print(max(abs(s[0] - t[0]), abs(s[1] - t[1])))
while s != t:
	r = ''
	if s[0] < t[0]:
		r += 'R'
		s[0] += 1
	elif s[0] > t[0]:
		r += 'L'
		s[0] -= 1
	if s[1] < t[1]:
		r += 'U'
		s[1] += 1
	elif s[1] > t[1]:
		r += 'D'
		s[1] -= 1
	print(r)


a = 'abcdefgh'
b = {a[i - 1]: i for i in range(1, 9)}
s = input()
t = input()
(x0, x1) = (b[s[0]], int(s[1]))
(y0, y1) = (b[t[0]], int(t[1]))
print(max(abs(x0 - y0), abs(x1 - y1)))
while True:
	if x0 == y0 and x1 == y1:
		break
	if x0 < y0:
		x0 += 1
		print('R', end='')
	elif x0 > y0:
		x0 -= 1
		print('L', end='')
	if x1 < y1:
		x1 += 1
		print('U', end='')
	elif x1 > y1:
		x1 -= 1
		print('D', end='')
	print()


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


n = input()
m = input()
n0 = ord(n[0])
n1 = ord(n[1])
m0 = ord(m[0])
m1 = ord(m[1])
k = abs(n0 - m0)
u = abs(n1 - m1)
print(min(k, u) + abs(k - u))
while True:
	if n0 < m0:
		print('R', end='')
		n0 = n0 + 1
	elif n0 > m0:
		print('L', end='')
		n0 = n0 - 1
	if n1 < m1:
		print('U', end='')
		n1 = n1 + 1
	elif n1 > m1:
		print('D', end='')
		n1 = n1 - 1
	print('')
	if n0 == m0 and n1 == m1:
		break


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)


def rep(a):
	if a == 'a':
		a = 1
	elif a == 'b':
		a = 2
	elif a == 'c':
		a = 3
	elif a == 'd':
		a = 4
	elif a == 'e':
		a = 5
	elif a == 'f':
		a = 6
	elif a == 'g':
		a = 7
	elif a == 'h':
		a = 8
	return a
(x1, y1) = list(input())
y1 = int(y1)
x1 = rep(x1)
(x2, y2) = list(input())
y2 = int(y2)
x2 = rep(x2)
steps = 0
quarter = 0
k = 0
ss = []
while k == 0:
	if x2 - x1 == 0 or y2 - y1 == 0:
		k = 1
		if x2 - x1 == 0:
			if y2 - y1 > 0:
				st = 'U'
			else:
				st = 'D'
			steps += abs(y2 - y1)
			for i in range(abs(y2 - y1)):
				ss.append(st)
		elif y2 - y1 == 0:
			if x2 - x1 > 0:
				st = 'R'
			else:
				st = 'L'
			steps += abs(x2 - x1)
			for i in range(abs(x2 - x1)):
				ss.append(st)
	elif x2 - x1 > 0 and y2 - y1 > 0:
		quarter = 1
	elif x2 - x1 > 0 and y2 - y1 < 0:
		quarter = 2
	elif x2 - x1 < 0 and y2 - y1 > 0:
		quarter = 4
	elif x2 - x1 < 0 and y2 - y1 < 0:
		quarter = 3
	l = [abs(x2 - x1), abs(y2 - y1)]
	mm = min(l)
	maxx = max(l)
	if quarter == 1:
		for j in range(mm):
			ss.append('RU')
			steps += 1
			x1 += 1
			y1 += 1
		if maxx == mm:
			k = 1
	if quarter == 2:
		for j in range(mm):
			ss.append('RD')
			steps += 1
			x1 += 1
			y1 -= 1
		if maxx == mm:
			k = 1
	if quarter == 3:
		for j in range(mm):
			ss.append('LD')
			steps += 1
			x1 -= 1
			y1 -= 1
		if maxx == mm:
			k = 1
	if quarter == 4:
		for j in range(mm):
			ss.append('LU')
			steps += 1
			x1 -= 1
			y1 += 1
		if maxx == mm:
			k = 1
print(steps)
for hh in ss:
	print(hh)


def ctoi(x):
	if x == 'a':
		return 1
	if x == 'b':
		return 2
	if x == 'c':
		return 3
	if x == 'd':
		return 4
	if x == 'e':
		return 5
	if x == 'f':
		return 6
	if x == 'g':
		return 7
	if x == 'h':
		return 8
a = input()
a1 = ctoi(a[0])
a2 = int(a[1])
b = input()
b1 = ctoi(b[0])
b2 = int(b[1])
A = abs(a1 - b1)
B = abs(a2 - b2)
print(max(A, B))
while a1 != b1 or a2 != b2:
	ans = ''
	if a1 < b1:
		a1 += 1
		ans += 'R'
	elif a1 > b1:
		a1 -= 1
		ans += 'L'
	if a2 < b2:
		a2 += 1
		ans += 'U'
	elif a2 > b2:
		a2 -= 1
		ans += 'D'
	print(ans)


s = input()
t = input()
x = ord(s[0]) - ord(t[0])
y = ord(s[1]) - ord(t[1])
if x < 0:
	xStep = 'R'
	x = -x
else:
	xStep = 'L'
if y < 0:
	yStep = 'U'
	y = -y
else:
	yStep = 'D'
print(max(x, y))
while x > y:
	print(xStep)
	x -= 1
while x < y:
	print(yStep)
	y -= 1
while x:
	print(xStep + yStep)
	x -= 1


import math
alph = 'abcdefghijklmnopqrstuvwxyz'
s = str(input())
t = str(input())
x1 = alph.index(s[0])
x2 = alph.index(t[0])
y1 = int(s[1])
y2 = int(t[1])
dx = x2 - x1
dy = y2 - y1
n = max(abs(dx), abs(dy))
print(n)
delta = abs(abs(dx) - abs(dy))
if abs(dx) >= abs(dy):
	if dx >= 0:
		for i in range(delta):
			print('R')
		if dy >= 0:
			for i in range(abs(dy)):
				print('RU')
		else:
			for i in range(abs(dy)):
				print('RD')
	else:
		for i in range(delta):
			print('L')
		if dy >= 0:
			for i in range(abs(dy)):
				print('LU')
		else:
			for i in range(abs(dy)):
				print('LD')
elif dy >= 0:
	for i in range(delta):
		print('U')
	if dx >= 0:
		for i in range(abs(dx)):
			print('RU')
	else:
		for i in range(abs(dx)):
			print('LU')
else:
	for i in range(delta):
		print('D')
	if dx >= 0:
		for i in range(abs(dx)):
			print('RD')
	else:
		for i in range(abs(dx)):
			print('LD')


start = input()
end = input()
(x, y) = (ord(start[0]) - 64, int(start[1]))
(xf, yf) = (ord(end[0]) - 64, int(end[1]))
print(max([abs(xf - x), abs(yf - y)]))
while x != xf or y != yf:
	if x - xf > 0 and yf - y > 0:
		print('LU')
		x -= 1
		y += 1
	elif xf - x > 0 and yf - y > 0:
		print('RU')
		x += 1
		y += 1
	elif x - xf > 0 and y - yf > 0:
		print('LD')
		x -= 1
		y -= 1
	elif xf - x > 0 and y - yf > 0:
		print('RD')
		x += 1
		y -= 1
	elif xf - x == 0 and yf - y > 0:
		print('U')
		y += 1
	elif xf - x == 0 and y - yf > 0:
		print('D')
		y -= 1
	elif x - xf > 0 and y - yf == 0:
		print('L')
		x -= 1
	elif xf - x > 0 and y - yf == 0:
		print('R')
		x += 1


s = list(input())
t = list(input())
s[1] = int(s[1])
t[1] = int(t[1])
r = -(ord(s[0].lower()) - 96 - (ord(t[0].lower()) - 96))
d = s[1] - t[1]
print(min(abs(r), abs(d)) + abs(abs(r) - abs(d)))
for i in range(0, min(abs(r), abs(d))):
	if r > 0 and d > 0:
		print('RD')
	elif r > 0 and d < 0:
		print('RU')
	elif r < 0 and d > 0:
		print('LD')
	elif r < 0 and d < 0:
		print('LU')
for i in range(0, abs(abs(r) - abs(d))):
	if abs(r) > abs(d):
		if r < 0:
			print('L')
		elif r > 0:
			print('R')
	if abs(d) > abs(r):
		if d < 0:
			print('U')
		elif d > 0:
			print('D')


n = input()
start = [ord(n[0]) - 96, int(n[1])]
n = input()
end = [ord(n[0]) - 96, int(n[1])]
route = [end[i] - start[i] for i in [0, 1]]
print(int(min(abs(route[0]), abs(route[1])) + abs(abs(route[0]) - abs(route[1]))))
a = 'R' if route[0] > 0 else 'L'
a += 'U' if route[1] > 0 else 'D'
for i in range(min(abs(route[0]), abs(route[1]))):
	print(a)
if abs(route[0]) > abs(route[1]):
	for i in range(abs(abs(route[0]) - abs(route[1]))):
		print('L' if route[0] < 0 else 'R')
elif abs(route[0]) < abs(route[1]):
	for i in range(abs(abs(route[0]) - abs(route[1]))):
		print('D' if route[1] < 0 else 'U')


king = input()
destiny = input()
xk = ord(king[0])
xd = ord(destiny[0])
yk = int(king[1])
yd = int(destiny[1])
moves = []
while xk != xd or yk != yd:
	if xk < xd:
		h = 'R'
		xk += 1
	elif xk > xd:
		h = 'L'
		xk -= 1
	else:
		h = ''
	if yk < yd:
		v = 'U'
		yk += 1
	elif yk > yd:
		v = 'D'
		yk -= 1
	else:
		v = ''
	moves.append(h + v)
print(len(moves))
for i in moves:
	print(i)


d1 = input()
d2 = input()
t1 = list(d1)
t2 = list(d2)
arr = []
ans = 0
while t2 != t1:
	if t1[0] > t2[0] and t1[1] > t2[1]:
		ans += 1
		t1[1] = chr(ord(t1[1]) - 1)
		t1[0] = chr(ord(t1[0]) - 1)
		arr.append('LD')
	elif t1[0] > t2[0] and t1[1] < t2[1]:
		ans += 1
		t1[1] = chr(ord(t1[1]) + 1)
		t1[0] = chr(ord(t1[0]) - 1)
		arr.append('LU')
	elif t1[0] < t2[0] and t1[1] < t2[1]:
		ans += 1
		t1[1] = chr(ord(t1[1]) + 1)
		t1[0] = chr(ord(t1[0]) + 1)
		arr.append('RU')
	elif t1[0] < t2[0] and t1[1] > t2[1]:
		ans += 1
		t1[1] = chr(ord(t1[1]) - 1)
		t1[0] = chr(ord(t1[0]) + 1)
		arr.append('RD')
	elif t1[0] == t2[0] and t1[1] > t2[1]:
		ans += 1
		t1[1] = chr(ord(t1[1]) - 1)
		arr.append('D')
	elif t1[0] == t2[0] and t1[1] < t2[1]:
		ans += 1
		t1[1] = chr(ord(t1[1]) + 1)
		arr.append('U')
	elif t1[0] > t2[0] and t1[1] == t2[1]:
		ans += 1
		t1[0] = chr(ord(t1[0]) - 1)
		arr.append('L')
	elif t1[0] < t2[0] and t1[1] == t2[1]:
		ans += 1
		t1[0] = chr(ord(t1[0]) + 1)
		arr.append('R')
print(ans)
for i in range(len(arr)):
	print(arr[i])


def sign(x):
	return 1 if x > 0 else -1
s = input()
x0 = ord(s[0]) - ord('a')
y0 = int(s[1])
t = input()
x1 = ord(t[0]) - ord('a')
y1 = int(t[1])
ans = []
while x0 != x1 and y0 != y1:
	ans.append('LR'[x0 < x1] + 'DU'[y0 < y1])
	x0 += sign(x1 - x0)
	y0 += sign(y1 - y0)
while x0 != x1:
	ans.append('LR'[x0 < x1])
	x0 += sign(x1 - x0)
while y0 != y1:
	ans.append('DU'[y0 < y1])
	y0 += sign(y1 - y0)
print(len(ans))
print('\n'.join(ans))


sp = ['', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
s = input()
s = [sp.index(s[0]), int(s[1])]
k = input()
k = [sp.index(k[0]), int(k[1])]
h = []
while s != k:
	if s[0] < k[0] and s[1] < k[1]:
		s[0] += 1
		s[1] += 1
		h.append('RU')
	elif s[0] > k[0] and s[1] > k[1]:
		s[0] -= 1
		s[1] -= 1
		h.append('LD')
	elif s[0] < k[0] and s[1] > k[1]:
		s[0] += 1
		s[1] -= 1
		h.append('RD')
	elif s[0] > k[0] and s[1] < k[1]:
		s[0] -= 1
		s[1] += 1
		h.append('LU')
	elif s[0] == k[0] and s[1] < k[1]:
		s[1] += 1
		h.append('U')
	elif s[0] == k[0] and s[1] > k[1]:
		s[1] -= 1
		h.append('D')
	elif s[0] < k[0] and s[1] == k[1]:
		s[0] += 1
		h.append('R')
	else:
		s[0] -= 1
		h.append('L')
print(len(h))
for i in h:
	print(i)


s = list(input())
t = list(input())
v = int(t[1]) - int(s[1])
h = ord(t[0]) - ord(s[0])
move_v = ''
move_h = ''
if v >= 0:
	move_v = 'U'
else:
	move_v = 'D'
	v = -v
if h >= 0:
	move_h = 'R'
else:
	move_h = 'L'
	h = -h
moves = min(h, v) + abs(h - v)
print(moves)
while v > 0 and h > 0:
	print(move_h, move_v, sep='')
	v -= 1
	h -= 1
while v > 0:
	print(move_v)
	v -= 1
while h > 0:
	print(move_h)
	h -= 1


s = input()
t = input()
x1 = ord(s[0]) - 97
y1 = int(s[1]) - 1
x2 = ord(t[0]) - 97
y2 = int(t[1]) - 1
count = 0
path = []
while not (x1 == x2 and y1 == y2):
	ans = ''
	if x1 > x2:
		ans += 'L'
		x1 -= 1
	elif x1 < x2:
		ans += 'R'
		x1 += 1
	if y1 > y2:
		ans += 'D'
		y1 -= 1
	elif y1 < y2:
		ans += 'U'
		y1 += 1
	count += 1
	path.append(ans)
print(count)
for x in path:
	print(x)


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


d = {chr(ord('a') + i): i + 1 for i in range(0, 8)}

class Point(object):

	def __init__(self, arr):
		self.x = arr[0]
		self.y = arr[1]

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

	def __ne__(self, other):
		if not self.__eq__(other):
			return True
		return False

def min(s, t):
	moves = []
	while s != t:
		if t.x == s.x:
			if t.y > s.y:
				s.y += 1
				moves.append('U')
			else:
				s.y -= 1
				moves.append('D')
		elif t.y == s.y:
			if t.x > s.x:
				s.x += 1
				moves.append('R')
			else:
				s.x -= 1
				moves.append('L')
		elif t.x - s.x < 0 and t.y - s.y < 0:
			s.x -= 1
			s.y -= 1
			moves.append('LD')
		elif t.x - s.x < 0 and t.y - s.y > 0:
			s.x -= 1
			s.y += 1
			moves.append('LU')
		elif t.x - s.x > 0 and t.y - s.y > 0:
			s.x += 1
			s.y += 1
			moves.append('RU')
		else:
			s.x += 1
			s.y -= 1
			moves.append('RD')
	return (len(moves), '\n'.join(moves))
s = [i for i in input()]
t = [i for i in input()]
s[0] = d.get(s[0])
t[0] = d.get(t[0])
s[1] = int(s[1])
t[1] = int(t[1])
s = Point(s)
t = Point(t)
(mov_len, moves) = min(s, t)
print(mov_len)
print(moves)


def diff_row(s, f):
	return s - f

def diff_column(s, f):
	return s - f
start = input()
finish = input()
path = []
rows = 'abcdefgh'
s_column = int(start[1])
s_row = int(rows.find(start[0]))
f_column = int(finish[1])
f_row = int(rows.find(finish[0]))
iterations = max(abs(diff_row(s_row, f_row)), abs(diff_column(s_column, f_column)))
for i in range(iterations):
	if diff_row(s_row, f_row) == 0:
		if diff_column(s_column, f_column) > 0:
			path.append('D')
			s_column -= 1
		else:
			path.append('U')
			s_column += 1
	elif diff_column(s_column, f_column) == 0:
		if diff_row(s_row, f_row) > 0:
			path.append('L')
			s_row -= 1
		else:
			path.append('R')
			s_row += 1
	elif diff_row(s_row, f_row) > 0:
		if diff_column(s_column, f_column) > 0:
			path.append('LD')
			s_column -= 1
			s_row -= 1
		else:
			path.append('LU')
			s_column += 1
			s_row -= 1
	elif diff_column(s_column, f_column) > 0:
		path.append('RD')
		s_column -= 1
		s_row += 1
	else:
		path.append('RU')
		s_column += 1
		s_row += 1
print(iterations)
for i in path:
	print(i)


start = input()
end = input()
end0 = ord(end[0])
end1 = ord(end[1])
start0 = ord(start[0])
start1 = ord(start[1])
s0 = end0 - start0
s1 = end1 - start1
count = 0
moves = []
while s0 != 0 or s1 != 0:
	if s0 > 0:
		start0 += 1
		move0 = 'R'
		if s1 > 0:
			start1 += 1
			move1 = 'U'
		elif s1 == 0:
			move1 = ''
		else:
			start1 -= 1
			move1 = 'D'
		moves.append(move0 + move1)
	elif s0 == 0:
		move0 = ''
		if s1 > 0:
			start1 += 1
			move1 = 'U'
		elif s1 == 0:
			move1 = ''
		else:
			start1 -= 1
			move1 = 'D'
		moves.append(move0 + move1)
	else:
		start0 -= 1
		move0 = 'L'
		if s1 > 0:
			start1 += 1
			move1 = 'U'
		elif s1 == 0:
			move1 = ''
		else:
			start1 -= 1
			move1 = 'D'
		moves.append(move0 + move1)
	count += 1
	s0 = end0 - start0
	s1 = end1 - start1
print(count)
for i in range(len(moves)):
	print(moves[i])


s = input()
t = input()
d1 = 'L' if s[0] > t[0] else 'R'
d2 = 'D' if s[1] > t[1] else 'U'
(diff1, diff2) = (abs(ord(s[0]) - ord(t[0])), abs(ord(s[1]) - ord(t[1])))
print(max(diff1, diff2))
while diff1 > 0 or diff2 > 0:
	if diff1 > 0:
		print(d1, end='')
		diff1 -= 1
	if diff2 > 0:
		print(d2, end='')
		diff2 -= 1
	print()


count = 0
list = [] * 0
ara1 = str(input())
x1 = ord(ara1[0]) - ord('a')
y1 = int(ara1[1])
ara2 = str(input())
x2 = ord(ara2[0]) - ord('a')
y2 = int(ara2[1])
while x1 != x2 or y1 != y2:
	str = ''
	if x1 > x2:
		str = 'L'
		x1 -= 1
	elif x1 < x2:
		str = 'R'
		x1 += 1
	if y1 < y2:
		str += 'U'
		y1 += 1
	elif y1 > y2:
		str += 'D'
		y1 -= 1
	list.append(str)
	count += 1
print(count)
for string in list:
	print(string)


adj = [[1, 8, 9], [0, 8, 9, 10, 2], [1, 9, 10, 11, 3], [2, 10, 11, 12, 4], [3, 11, 12, 13, 5], [4, 12, 13, 14, 6], [5, 13, 14, 15, 7], [6, 14, 15], [0, 1, 9, 17, 16], [0, 1, 2, 10, 18, 17, 16, 8], [1, 2, 3, 11, 19, 18, 17, 9], [2, 3, 4, 12, 20, 19, 18, 10], [3, 4, 5, 13, 21, 20, 19, 11], [4, 5, 6, 14, 22, 21, 20, 12], [5, 6, 7, 15, 23, 22, 21, 13], [7, 6, 14, 22, 23], [8, 9, 17, 25, 24], [8, 9, 10, 18, 26, 25, 24, 16], [9, 10, 11, 19, 27, 26, 25, 17], [10, 11, 12, 20, 28, 27, 26, 18], [11, 12, 13, 21, 29, 28, 27, 19], [12, 13, 14, 22, 30, 29, 28, 20], [13, 14, 15, 23, 31, 30, 29, 21], [15, 14, 22, 30, 31], [16, 17, 25, 33, 32], [16, 17, 18, 26, 34, 33, 32, 24], [17, 18, 19, 27, 35, 34, 33, 25], [18, 19, 20, 28, 36, 35, 34, 26], [19, 20, 21, 29, 37, 36, 35, 27], [20, 21, 22, 30, 38, 37, 36, 28], [21, 22, 23, 31, 39, 38, 37, 29], [23, 22, 30, 38, 39], [24, 25, 33, 41, 40], [24, 25, 26, 34, 42, 41, 40, 32], [25, 26, 27, 35, 43, 42, 41, 33], [26, 27, 28, 36, 44, 43, 42, 34], [27, 28, 29, 37, 45, 44, 43, 35], [28, 29, 30, 38, 46, 45, 44, 36], [29, 30, 31, 39, 47, 46, 45, 37], [31, 30, 38, 46, 47], [32, 33, 41, 49, 48], [32, 33, 34, 42, 50, 49, 48, 40], [33, 34, 35, 43, 51, 50, 49, 41], [34, 35, 36, 44, 52, 51, 50, 42], [35, 36, 37, 45, 53, 52, 51, 43], [36, 37, 38, 46, 54, 53, 52, 44], [37, 38, 39, 47, 55, 54, 53, 45], [39, 38, 46, 54, 55], [40, 41, 49, 57, 56], [40, 41, 42, 50, 58, 57, 56, 48], [41, 42, 43, 51, 59, 58, 57, 49], [42, 43, 44, 52, 60, 59, 58, 50], [43, 44, 45, 53, 61, 60, 59, 51], [44, 45, 46, 54, 62, 61, 60, 52], [45, 46, 47, 55, 63, 62, 61, 53], [47, 46, 54, 62, 63], [48, 49, 57], [56, 48, 49, 50, 58], [57, 49, 50, 51, 59], [58, 50, 51, 52, 60], [59, 51, 52, 53, 61], [60, 52, 53, 54, 62], [61, 53, 54, 55, 63], [55, 54, 62]]
G = {}
for i in range(len(adj)):
	temp = {}
	for j in adj[i]:
		temp[j] = 1
	G[i] = temp
board = [[56, 57, 58, 59, 60, 61, 62, 63], [48, 49, 50, 51, 52, 53, 54, 55], [40, 41, 42, 43, 44, 45, 46, 47], [32, 33, 34, 35, 36, 37, 38, 39], [24, 25, 26, 27, 28, 29, 30, 31], [16, 17, 18, 19, 20, 21, 22, 23], [8, 9, 10, 11, 12, 13, 14, 15], [0, 1, 2, 3, 4, 5, 6, 7]]
w = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}

def coord_to_word(l):
	return board[int(l[1]) - 1][w[l[0]]]

def command(a, b):
	if a - 9 == b:
		return 'LU'
	elif a - 8 == b:
		return 'U'
	elif a - 7 == b:
		return 'RU'
	elif a + 1 == b:
		return 'R'
	elif a + 9 == b:
		return 'RD'
	elif a + 8 == b:
		return 'D'
	elif a + 7 == b:
		return 'LD'
	elif a - 1 == b:
		return 'L'
N = len(G)
t = []
p = {}
b = {}
v = None
e = None
s = []

def dijkstra(v, p, t, b, e):
	for x in G[v]:
		xm = p[v] + G[v][x]
		if not x in p:
			p[x] = xm
			b[x] = v
		elif not x in t:
			if p[x] > xm:
				p[x] = xm
				b[x] = v
	t.append(v)
	if N <= len(t):
		s.insert(0, e)
		while True:
			if b[e] == -1:
				break
			e = b[e]
			s.insert(0, e)
		return s
	for d in p:
		if d not in t:
			dm = p[d]
			break
	for y in p:
		if p[y] < dm and (not y in t):
			dm = p[y]
			d = y
	v = d
	dijkstra(v, p, t, b, e)

def start_v(start, end):
	v = start
	e = end
	p[v] = 0
	b[v] = -1
	return (v, p, b, e)
A = coord_to_word(input())
B = coord_to_word(input())
(v, p, b, e) = start_v(A, B)
dijkstra(v, p, t, b, e)
print(len(s) - 1)
for i in range(0, len(s) - 1):
	print(command(s[i], s[i + 1]))


def printing(count, string):
	for x in range(count):
		print(string)

def main():
	start = list(input())
	end = list(input())
	alphabet = list('abcdefgh')
	start[0] = alphabet.index(start[0])
	end[0] = alphabet.index(end[0])
	start[1] = int(start[1])
	end[1] = int(end[1])
	horizontal = abs(start[0] - end[0])
	vertical = abs(start[1] - end[1])
	moves = max(horizontal, vertical)
	print(moves)
	if start[0] < end[0]:
		str1 = 'R'
		bo1 = True
	elif start[0] > end[0]:
		str1 = 'L'
		bo1 = True
	else:
		bo1 = False
	if start[1] < end[1]:
		str2 = 'U'
		bo2 = True
	elif start[1] > end[1]:
		str2 = 'D'
		bo2 = True
	else:
		bo2 = False
	if bo1:
		if bo2:
			double = str1 + str2
			if vertical > horizontal:
				single = str2
			else:
				single = str1
			printing(min(horizontal, vertical), double)
			printing(abs(vertical - horizontal), single)
		else:
			for x in range(horizontal):
				print(str1)
	elif bo2:
		for x in range(vertical):
			print(str2)
	else:
		return None
main()


s = input()
t = input()
l = []
count = 0
while s != t:
	if s[0] == t[0]:
		if int(s[1]) > int(t[1]):
			l.append('D')
			s = s[0] + str(int(s[1]) - 1)
			count += 1
		elif int(s[1]) < int(t[1]):
			l.append('U')
			s = s[0] + str(int(s[1]) + 1)
			count += 1
	elif s[1] == t[1]:
		if s[0] > t[0]:
			l.append('L')
			s = chr(ord(s[0]) - 1) + s[1]
			count += 1
		elif s[0] < t[0]:
			l.append('R')
			s = chr(ord(s[0]) + 1) + s[1]
			count += 1
	elif s[0] > t[0] and int(s[1]) < int(t[1]):
		s = chr(ord(s[0]) - 1) + s[1]
		s = s[0] + str(int(s[1]) + 1)
		l.append('LU')
		count += 1
	elif s[0] > t[0] and int(s[1]) > int(t[1]):
		s = chr(ord(s[0]) - 1) + s[1]
		s = s[0] + str(int(s[1]) - 1)
		l.append('LD')
		count += 1
	elif s[0] < t[0] and int(s[1]) < int(t[1]):
		s = chr(ord(s[0]) + 1) + s[1]
		s = s[0] + str(int(s[1]) + 1)
		l.append('RU')
		count += 1
	elif s[0] < t[0] and int(s[1]) > int(t[1]):
		s = chr(ord(s[0]) + 1) + s[1]
		s = s[0] + str(int(s[1]) - 1)
		l.append('RD')
		count += 1
print(count)
if len(l) != 0:
	print('\n'.join(l))


a = input()
b = input()
x1 = ord(a[0]) - ord('a')
y1 = ord(a[1]) - ord('1')
x2 = ord(b[0]) - ord('a')
y2 = ord(b[1]) - ord('1')
steps = []
while not (x1 == x2 and y1 == y2):
	if x1 != x2 and y1 != y2:
		h = None
		if x1 < x2:
			x1 += 1
			h = 'R'
		else:
			x1 -= 1
			h = 'L'
		if y1 < y2:
			y1 += 1
			v = 'U'
		else:
			y1 -= 1
			v = 'D'
		steps.append(h + v)
	elif x1 != x2:
		if x1 < x2:
			x1 += 1
			steps.append('R')
		else:
			x1 -= 1
			steps.append('L')
	elif y1 < y2:
		y1 += 1
		steps.append('U')
	else:
		y1 -= 1
		steps.append('D')
print(len(steps))
for step in steps:
	print(step)


p = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
s = input()
t = input()
x_dif = p.index(t[0]) - p.index(s[0])
y_dif = int(t[1]) - int(s[1])
(x, y) = (abs(x_dif), abs(y_dif))
count = max(x, y)
print(count)
if x_dif < 0:
	hmove = 'L'
else:
	hmove = 'R'
if y_dif < 0:
	vmove = 'D'
else:
	vmove = 'U'
z = min(x, y)
for i in range(z):
	print(str(hmove) + str(vmove))
if y == count:
	for i in range(count - z):
		print(vmove)
else:
	for i in range(count - z):
		print(hmove)


st = input()
end = input()
hor = ord(end[0]) - ord(st[0])
ver = ord(end[1]) - ord(st[1])
if hor > 0:
	h = 'R'
else:
	h = 'L'
if ver > 0:
	v = 'U'
else:
	v = 'D'
hor = abs(hor)
ver = abs(ver)
n = max(hor, ver)
arr_hor = [h for i in range(hor)]
arr_ver = [v for i in range(ver)]
if ver > hor:
	arr_hor = arr_hor + ['' for i in range(ver - hor)]
else:
	arr_ver = arr_ver + ['' for i in range(hor - ver)]
print(n)
for i in range(n):
	print(arr_hor[i], arr_ver[i], sep='')


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)


def get_pos(s: str):
	x = s[0]
	y = s[1]
	if not x.isdigit():
		x = str(ord(x) - ord('a') + 1)
	if not y.isdigit():
		y = str(ord(y) - ord('a') + 1)
	return (int(x), int(y))

def solve(start, end):
	(start_x, start_y) = get_pos(start)
	(end_x, end_y) = get_pos(end)
	min_val = 100000000
	res = []
	while start_x != end_x or start_y != end_y:
		arr = [(start_x, start_y + 1, 'U'), (start_x, start_y - 1, 'D'), (start_x - 1, start_y, 'L'), (start_x + 1, start_y, 'R'), (start_x - 1, start_y - 1, 'LD'), (start_x - 1, start_y + 1, 'LU'), (start_x + 1, start_y - 1, 'RD'), (start_x + 1, start_y + 1, 'RU')]
		selected_min = None
		for ver in arr:
			if ((ver[0] - end_x) ** 2 + (ver[1] - end_y) ** 2) ** 0.5 < min_val:
				min_val = ((ver[0] - end_x) ** 2 + (ver[1] - end_y) ** 2) ** 0.5
				selected_min = ver
				start_x = ver[0]
				start_y = ver[1]
		res.append(selected_min[2])
	print(len(res))
	print(*res, sep='\n')

def main():
	start = input()
	end = input()
	solve(start, end)
main()


a = input()
b = input()
c = ord(b[0]) - ord(a[0])
d = int(b[1]) - int(a[1])
z = []
while c != 0 or d != 0:
	k = ''
	if c < 0:
		k += 'L'
		c += 1
	elif c > 0:
		k += 'R'
		c -= 1
	if d < 0:
		k += 'D'
		d += 1
	elif d > 0:
		k += 'U'
		d -= 1
	z += [k]
print(len(z))
[print(i) for i in z]


(s, e) = (input(), input())
s = [ord(s[0]) - ord('a') + 1, int(s[1])]
e = [ord(e[0]) - ord('a') + 1, int(e[1])]
res = max(abs(s[0] - e[0]), abs(s[1] - e[1]))
print(res)
while s[0] != e[0] or s[1] != e[1]:
	res = ''
	if s[0] > e[0]:
		res += 'L'
		s[0] -= 1
	elif s[0] < e[0]:
		res += 'R'
		s[0] += 1
	if s[1] > e[1]:
		res += 'D'
		s[1] -= 1
	elif s[1] < e[1]:
		res += 'U'
		s[1] += 1
	print(res)


from itertools import accumulate as ac
from collections import Counter as cc
from bisect import bisect_left as bsl
from bisect import bisect as bs
from math import factorial as f
from collections import *
from itertools import *
from string import *
from bisect import *
from queue import *
from heapq import *
from math import *
from sys import *
from re import *

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

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
WIDTH = 600
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 255, 0)
YELLOW = (255, 255, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
PURPLE = (128, 0, 128)
ORANGE = (255, 165, 0)
GREY = (128, 128, 128)
TURQUOISE = (64, 224, 208)

class Spot:

	def __init__(self, row, col, width, total_rows):
		self.row = row
		self.col = col
		self.x = row * width
		self.y = col * width
		self.color = WHITE
		self.neighbors = []
		self.width = width
		self.total_rows = total_rows

	def get_pos(self):
		return (self.row, self.col)

	def is_closed(self):
		return self.color == RED

	def is_open(self):
		return self.color == GREEN

	def is_barrier(self):
		return self.color == BLACK

	def is_start(self):
		return self.color == ORANGE

	def is_end(self):
		return self.color == TURQUOISE

	def reset(self):
		self.color = WHITE

	def make_start(self):
		self.color = ORANGE

	def make_closed(self):
		self.color = RED

	def make_open(self):
		self.color = GREEN

	def make_barrier(self):
		self.color = BLACK

	def make_end(self):
		self.color = TURQUOISE

	def make_path(self):
		self.color = PURPLE

	def update_neighbors(self, grid):
		self.neighbors = []
		if self.row < self.total_rows - 1:
			self.neighbors.append(grid[self.row + 1][self.col])
		if self.row > 0:
			self.neighbors.append(grid[self.row - 1][self.col])
		if self.row < self.total_rows - 1 and self.col < self.total_rows - 1:
			self.neighbors.append(grid[self.row + 1][self.col + 1])
		if self.row > 0 and self.col > 0:
			self.neighbors.append(grid[self.row - 1][self.col - 1])
		if self.row > 0 and self.col < self.total_rows - 1:
			self.neighbors.append(grid[self.row - 1][self.col + 1])
		if self.row < self.total_rows - 1 and self.col > 0:
			self.neighbors.append(grid[self.row + 1][self.col - 1])
		if self.col < self.total_rows - 1:
			self.neighbors.append(grid[self.row][self.col + 1])
		if self.col > 0:
			self.neighbors.append(grid[self.row][self.col - 1])

	def __lt__(self, other):
		return False

def h(p1, p2):
	(x1, y1) = p1
	(x2, y2) = p2
	return abs(x1 - x2) + abs(y1 - y2)

def reconstruct_path(came_from, current):
	lst = []
	while current in came_from:
		current = came_from[current]
		current.make_path()
		lst.append(current.get_pos())
	return lst

def algorithm(grid, start, end):
	count = 0
	open_set = PriorityQueue()
	open_set.put((0, count, start))
	came_from = {}
	g_score = {spot: float('inf') for row in grid for spot in row}
	g_score[start] = 0
	f_score = {spot: float('inf') for row in grid for spot in row}
	f_score[start] = h(start.get_pos(), end.get_pos())
	open_set_hash = {start}
	while not open_set.empty():
		current = open_set.get()[2]
		open_set_hash.remove(current)
		if current == end:
			lst = reconstruct_path(came_from, end)
			end.make_end()
			return lst
		for neighbor in current.neighbors:
			temp_g_score = g_score[current] + 1
			if temp_g_score < g_score[neighbor]:
				came_from[neighbor] = current
				g_score[neighbor] = temp_g_score
				f_score[neighbor] = temp_g_score + h(neighbor.get_pos(), end.get_pos())
				if neighbor not in open_set_hash:
					count += 1
					open_set.put((f_score[neighbor], count, neighbor))
					open_set_hash.add(neighbor)
					neighbor.make_open()
		if current != start:
			current.make_closed()
	return False

def make_grid(rows, width):
	grid = []
	gap = width // rows
	for i in range(rows):
		grid.append([])
		for j in range(rows):
			spot = Spot(i, j, gap, rows)
			grid[i].append(spot)
	return grid
ROWS = 8
grid = make_grid(ROWS, WIDTH)
one = fast()
spot = grid[ord(one[0]) - 97][int(one[1]) - 1]
start = spot
start.make_start()
two = fast()
spot = grid[ord(two[0]) - 97][int(two[1]) - 1]
end = spot
end.make_end()
for row in grid:
	for spot in row:
		spot.update_neighbors(grid)
res = algorithm(grid, start, end)[::-1]
prev = start.get_pos()
print(len(res))
res = res + [end.get_pos()]
for i in range(len(res)):
	i = res[i]
	if i[0] > prev[0] and i[1] > prev[1]:
		print('RU')
	elif i[0] < prev[0] and i[1] < prev[1]:
		print('LD')
	elif i[0] > prev[0] and i[1] == prev[1]:
		print('R')
	elif i[0] < prev[0] and i[1] == prev[1]:
		print('L')
	elif i[0] == prev[0] and i[1] > prev[1]:
		print('U')
	elif i[0] == prev[0] and i[1] < prev[1]:
		print('D')
	elif i[0] > prev[0] and i[1] < prev[1]:
		print('RD')
	elif i[0] < prev[0] and i[1] > prev[1]:
		print('LU')
	prev = i


start = input()
finish = input()
(start_col, start_row) = start
start_col = ord(start_col) - 96
start_row = int(start_row)
(finish_col, finish_row) = finish
finish_col = ord(finish_col) - 96
finish_row = int(finish_row)
step_col = finish_col - start_col
step_row = finish_row - start_row
steps_count = 0
if abs(step_col) >= abs(step_row):
	steps_count = step_col
else:
	steps_count = step_row
lettet_x = []
if step_col < 0:
	lettet_x = ['L'] * abs(step_col)
if step_col > 0:
	lettet_x = ['R'] * abs(step_col)
lettet_y = []
if step_row < 0:
	lettet_y = ['D'] * abs(step_row)
if step_row > 0:
	lettet_y = ['U'] * abs(step_row)
len_lettet_x = len(lettet_x)
len_lettet_y = len(lettet_y)
if len_lettet_x > len_lettet_y:
	lettet_y = lettet_y + [''] * (len_lettet_x - len_lettet_y)
else:
	lettet_x = lettet_x + [''] * (len_lettet_y - len_lettet_x)
steps = map(lambda x, y: x + y, lettet_x, lettet_y)
print(abs(steps_count))
for s in steps:
	print(s)


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

def sign(x):
	if x < 0:
		return -1
	elif x > 0:
		return 1
	else:
		return 0
start = input()
finish = input()
si = int(start[1])
sj = m[start[0]]
fi = int(finish[1])
fj = m[finish[0]]
di = sign(fi - si)
dj = sign(fj - sj)
(i, j) = (si, sj)
out = ''
count = 0
while i != fi or j != fj:
	buff = ''
	if dj < 0:
		buff += 'L'
	elif dj > 0:
		buff += 'R'
	if di < 0:
		buff += 'D'
	elif di > 0:
		buff += 'U'
	out = out + buff + '\n'
	count += 1
	i += di
	if i == fi:
		di = 0
	j += dj
	if j == fj:
		dj = 0
print(count)
print(out.rstrip())


start = input()
final = input()
count = []
ans = []
l = {'hor': 0, 'ver': 0}
l['hor'] = ord(final[0]) - 96 - (ord(start[0]) - 96)
l['ver'] = int(final[1]) - int(start[1])
if l['hor'] > 0:
	ans.append('R')
else:
	ans.append('L')
if l['ver'] > 0:
	ans.append('U')
else:
	ans.append('D')
l['hor'] = abs(l['hor'])
l['ver'] = abs(l['ver'])
while l['hor'] != 0 or l['ver'] != 0:
	if l['hor'] > 0 and l['ver'] > 0:
		l['hor'] -= 1
		l['ver'] -= 1
		count.append(ans[0] + ans[1])
	elif l['hor'] > 0:
		l['hor'] -= 1
		count.append(ans[0])
	else:
		l['ver'] -= 1
		count.append(ans[1])
print(len(count))
for i in count:
	print(i)


import sys
(x1, y1) = next(sys.stdin).strip()
(x1, y1) = (ord(x1) - 97, int(y1) - 1)
(x2, y2) = next(sys.stdin).strip()
(x2, y2) = (ord(x2) - 97, int(y2) - 1)
(x, y) = (x1, y1)
actions = []
while not (x == x2 and y == y2):
	diag = x != x2 and y != y2
	vert = x == x2 and y != y2
	hori = x != x2 and y == y2
	if diag:
		if x > x2 and y > y2:
			actions.append('LD')
			x -= 1
			y -= 1
		elif x < x2 and y < y2:
			actions.append('RU')
			x += 1
			y += 1
		elif x > x2 and y < y2:
			actions.append('LU')
			x -= 1
			y += 1
		else:
			actions.append('RD')
			x += 1
			y -= 1
	elif vert:
		if y > y2:
			actions.append('D')
			y -= 1
		else:
			actions.append('U')
			y += 1
	elif x > x2:
		actions.append('L')
		x -= 1
	else:
		actions.append('R')
		x += 1
print(len(actions))
for action in actions:
	print(action)


scr = input()
dis = input()
s = [ord(scr[0]), int(scr[1])]
d = [ord(dis[0]), int(dis[1])]
ans = []
k = 0
if s[0] < d[0] and s[1] > d[1]:
	while s[0] < d[0] and s[1] > d[1]:
		k += 1
		ans.append('RD')
		s[0] += 1
		s[1] -= 1
if s[0] > d[0] and s[1] > d[1]:
	while s[0] > d[0] and s[1] > d[1]:
		k += 1
		ans.append('LD')
		s[0] -= 1
		s[1] -= 1
if s[0] > d[0] and s[1] < d[1]:
	while s[0] > d[0] and s[1] < d[1]:
		k += 1
		ans.append('LU')
		s[0] -= 1
		s[1] += 1
if s[0] < d[0] and s[1] < d[1]:
	while s[0] < d[0] and s[1] < d[1]:
		k += 1
		ans.append('RU')
		s[0] += 1
		s[1] += 1
if s[0] == d[0]:
	if s[1] > d[1]:
		k += abs(s[1] - d[1])
		ch = 'D' * abs(s[1] - d[1])
		ans.extend(list(ch))
	if s[1] < d[1]:
		k += abs(s[1] - d[1])
		ch = 'U' * abs(s[1] - d[1])
		ans.extend(list(ch))
if s[1] == d[1]:
	if s[0] > d[0]:
		k += abs(s[0] - d[0])
		ch = 'L' * abs(s[0] - d[0])
		ans.extend(list(ch))
	if s[0] < d[0]:
		k += abs(s[0] - d[0])
		ch = 'R' * abs(s[0] - d[0])
		ans.extend(list(ch))
print(k)
for x in ans:
	print(x)
	print('\n')


final = []
counter = 0
dict = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7}
input1 = input()
input2 = input()
x1 = dict[input1[0]]
x2 = dict[input2[0]]
if int(input1[1]) != 0:
	y1 = int(input1[1]) - 1
else:
	y1 = int(input1[1])
if int(input2[1]) != 0:
	y2 = int(input2[1]) - 1
else:
	y2 = int(input2[1])
while True:
	action1 = ''
	action2 = ''
	if counter == 0:
		if x1 == x2 and y1 == y2:
			break
	if x1 > x2:
		x1 = x1 - 1
		action1 = 'L'
	if x1 < x2:
		x1 = x1 + 1
		action1 = 'R'
	if y1 > y2:
		y1 = y1 - 1
		action2 = 'D'
	if y1 < y2:
		y1 = y1 + 1
		action2 = 'U'
	counter = counter + 1
	final.append(action1 + action2)
	if x1 == x2 and y1 == y2:
		break
print(counter)
for f in final:
	print(f)


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)


a = input()
b = input()
e = ord(b[0]) - ord(a[0])
f = int(b[1]) - int(a[1])
c = abs(e)
d = abs(f)
print(max(c, d))
g = min(c, d)
if e >= 0:
	if f >= 0:
		for i in range(g):
			print('RU')
		if c > d:
			for i in range(c - d):
				print('R')
		if c < d:
			for i in range(d - c):
				print('U')
	if f < 0:
		for i in range(g):
			print('RD')
		if c > d:
			for i in range(c - d):
				print('R')
		if c < d:
			for i in range(d - c):
				print('D')
if e < 0:
	if f >= 0:
		for i in range(g):
			print('LU')
		if c > d:
			for i in range(c - d):
				print('L')
		if c < d:
			for i in range(d - c):
				print('U')
	if f < 0:
		for i in range(g):
			print('LD')
		if c > d:
			for i in range(c - d):
				print('L')
		if c < d:
			for i in range(d - c):
				print('D')


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)
cond1 = 0
cond2 = 0
cond3 = 0
cond4 = 0
if col2 >= col1 and row2 >= row1:
	cond1 = 1
elif col2 <= col1 and row2 >= row1:
	cond2 = 1
elif col2 >= col1 and row2 <= row1:
	cond3 = 1
else:
	cond4 = 1
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 cond2:
			print('D')
		else:
			print('U')


cns = '0abcdefgh'
sp = input()
ep = input()
cs = cns.index(sp[0])
rs = int(sp[1])
ce = cns.index(ep[0])
re = int(ep[1])
path = []
steps = 0
cn = cs
rn = rs
while cn != ce or rn != re:
	if cn < ce:
		if rn < re:
			path.append('RU')
			cn += 1
			rn += 1
		elif rn == re:
			path.append('R')
			cn += 1
		else:
			path.append('RD')
			cn += 1
			rn -= 1
	elif cn > ce:
		if rn < re:
			path.append('LU')
			cn -= 1
			rn += 1
		elif rn == re:
			path.append('L')
			cn -= 1
		else:
			path.append('LD')
			cn -= 1
			rn -= 1
	elif rn < re:
		path.append('U')
		rn += 1
	else:
		path.append('D')
		rn -= 1
	steps += 1
print(steps)
for m in path:
	print(m)


king = input()
visit = input()
part2 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
dist1 = abs(int(king[1]) - int(visit[1]))
dist2 = abs(ord(king[0]) - ord(visit[0]))
true_distance = max(dist1, dist2)
print(true_distance)
while king != visit:
	if ord(king[0]) < ord(visit[0]):
		print('R', end='')
		king = chr(ord(king[0]) + 1) + king[1]
	elif ord(king[0]) > ord(visit[0]):
		print('L', end='')
		king = chr(ord(king[0]) - 1) + king[1]
	if int(king[1]) < int(visit[1]):
		print('U', end='')
		king = king[0] + str(int(king[1]) + 1)
	if int(king[1]) > int(visit[1]):
		print('D', end='')
		king = king[0] + str(int(king[1]) - 1)
	print()


import sys
src = list(sys.stdin.readline())[:2]
dest = list(sys.stdin.readline())[:2]
ans = ''
cnt = 0
while src != dest:
	if dest[0] > src[0]:
		ans += 'R'
		src[0] = chr(ord(src[0]) + 1)
	elif dest[0] < src[0]:
		ans += 'L'
		src[0] = chr(ord(src[0]) - 1)
	if dest[1] > src[1]:
		ans += 'U'
		src[1] = chr(ord(src[1]) + 1)
	elif dest[1] < src[1]:
		ans += 'D'
		src[1] = chr(ord(src[1]) - 1)
	ans += '\n'
	cnt += 1
ans = str(cnt) + '\n' + ans[:-1]
print(ans)


trans = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
a = list(input())
a[0] = trans[a[0]]
a[1] = int(a[1])
b = list(input())
b[0] = trans[b[0]]
b[1] = int(b[1])
if a[0] > b[0]:
	if a[1] > b[1]:
		ans = ['LD'] * min(abs(a[0] - b[0]), abs(a[1] - b[1]))
		if abs(a[0] - b[0]) > abs(a[1] - b[1]):
			ans += ['L'] * (abs(a[0] - b[0]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
		elif abs(a[0] - b[0]) < abs(a[1] - b[1]):
			ans += ['D'] * (abs(a[1] - b[1]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
	else:
		ans = ['LU'] * min(abs(a[0] - b[0]), abs(a[1] - b[1]))
		if abs(a[0] - b[0]) > abs(a[1] - b[1]):
			ans += ['L'] * (abs(a[0] - b[0]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
		elif abs(a[0] - b[0]) < abs(a[1] - b[1]):
			ans += ['U'] * (abs(a[1] - b[1]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
elif a[1] > b[1]:
	ans = ['RD'] * min(abs(a[0] - b[0]), abs(a[1] - b[1]))
	if abs(a[0] - b[0]) > abs(a[1] - b[1]):
		ans += ['R'] * (abs(a[0] - b[0]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
	elif abs(a[0] - b[0]) < abs(a[1] - b[1]):
		ans += ['D'] * (abs(a[1] - b[1]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
else:
	ans = ['RU'] * min(abs(a[0] - b[0]), abs(a[1] - b[1]))
	if abs(a[0] - b[0]) > abs(a[1] - b[1]):
		ans += ['R'] * (abs(a[0] - b[0]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
	elif abs(a[0] - b[0]) < abs(a[1] - b[1]):
		ans += ['U'] * (abs(a[1] - b[1]) - min(abs(a[0] - b[0]), abs(a[1] - b[1])))
print(len(ans))
for i in ans:
	print(i)


(x1, y1) = [ord(i) for i in input()]
(x2, y2) = [ord(i) for i in input()]
lr = 'R' if x2 > x1 else 'L'
ud = 'U' if y2 > y1 else 'D'
r = max(abs(x2 - x1), abs(y2 - y1))
st = str(r) + '\r\n'
for i in range(r):
	if i >= abs(x2 - x1):
		lr = ''
	if i >= abs(y2 - y1):
		ud = ''
	st += lr + ud + '\r\n'
print(st)


import sys
import math
from collections import defaultdict
import heapq
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass

class Graph:

	def __init__(self):
		self.neighbours = defaultdict(list)
		for x in range(1, 9):
			for y in range(1, 9):
				for i in range(-1, 2):
					for j in range(-1, 2):
						pos_x = x + i
						pos_y = y + j
						if self.isValid(pos_x, pos_y):
							self.addEdge([x, y], [pos_x, pos_y])

	def addEdge(self, u, v):
		pos1 = self.ltos(u)
		pos2 = self.ltos(v)
		self.neighbours[pos1].append(pos2)
		self.neighbours[pos2].append(pos1)

	def ltos(self, l):
		return str(l[0]) + ':' + str(l[1])

	def isValid(self, x, y):
		if x < 1 or x > 8:
			return False
		if y < 1 or y > 8:
			return False
		return True

	def stol(self, s):
		return [int(s[0]), int(s[2])]

	def whatMove(self, move1, move2):
		(x1, y1) = self.stol(move1)
		(x2, y2) = self.stol(move2)
		if x1 == x2:
			if y1 < y2:
				return 'U'
			else:
				return 'D'
		elif y1 == y2:
			if x1 < x2:
				return 'R'
			else:
				return 'L'
		elif x2 == x1 - 1 and y2 == y1 - 1:
			return 'LD'
		elif x2 == x1 - 1 and y2 == y1 + 1:
			return 'LU'
		elif x2 == x1 + 1 and y2 == y1 - 1:
			return 'RD'
		elif x2 == x1 + 1 and y2 == y1 + 1:
			return 'RU'

	def BFS(self, source, destination):
		source = self.ltos(source)
		destination = self.ltos(destination)
		visited = defaultdict(lambda : False)
		distance = defaultdict(lambda : float('inf'))
		distance[source] = 0
		visited[source] = True
		queue = [source]
		parent = defaultdict(lambda : None)
		while queue:
			u = queue.pop(0)
			if u == destination:
				break
			for v in self.neighbours[u]:
				if not visited[v]:
					visited[v] = True
					parent[v] = u
					distance[v] = distance[u] + 1
					queue.append(v)
		print(distance[destination])
		ans = []
		start = destination
		while parent[start] != None:
			ans.append(self.whatMove(parent[start], start))
			start = parent[start]
		for a in ans[::-1]:
			print(a)
s = input().strip()
d = input().strip()
ref = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
source = [ref[s[0]], int(s[1])]
destination = [ref[d[0]], int(d[1])]
g = Graph()
g.BFS(source, destination)


s1 = str(input())
s2 = str(input())
(x0, y0) = (ord(s1[0]), int(s1[1]))
(x, y) = (ord(s2[0]), int(s2[1]))
print(max(abs(x0 - x), abs(y0 - y)))
while True:
	if x == x0 and y == y0:
		break
	if x > x0:
		x0 += 1
		print('R', end='')
	if x < x0:
		x0 -= 1
		print('L', end='')
	if y < y0:
		y0 -= 1
		print('D', end='')
	if y > y0:
		y0 += 1
		print('U', end='')
	print('', end='\n')


current_pos = input()
end_pos = input()
(cX, cY) = (int(ord(current_pos[0]) - ord('a')), int(current_pos[1]))
(eX, eY) = (int(ord(end_pos[0]) - ord('a')), int(end_pos[1]))
minMoves = max(abs(cX - eX), abs(cY - eY))
print(minMoves)
dX = cX - eX
dY = cY - eY
if dX >= 0 and dY >= 0:
	dX = abs(dX)
	dY = abs(dY)
	diagonal = min(dX, dY)
	print('LD\n' * diagonal, end='')
	print('L\n' * (dX - dY), end='')
	print('D\n' * (dY - dX), end='')
elif dX >= 0 and dY <= 0:
	dX = abs(dX)
	dY = abs(dY)
	diagonal = min(dX, dY)
	print('LU\n' * diagonal, end='')
	print('L\n' * (dX - dY), end='')
	print('U\n' * (dY - dX), end='')
elif dX <= 0 and dY >= 0:
	dX = abs(dX)
	dY = abs(dY)
	diagonal = min(dX, dY)
	print('RD\n' * diagonal, end='')
	print('R\n' * (dX - dY), end='')
	print('D\n' * (dY - dX), end='')
elif dX <= 0 and dY <= 0:
	dX = abs(dX)
	dY = abs(dY)
	diagonal = min(dX, dY)
	print('RU\n' * diagonal, end='')
	print('R\n' * (dX - dY), end='')
	print('U\n' * (dY - dX), end='')


c = ' abcdefgh'
s = input()
s = [c.index(s[0]), int(s[1])]
t = input()
t = [c.index(t[0]), int(t[1])]
st = ''
if s[0] < t[0] and s[1] < t[1]:
	while s[0] != t[0] and s[1] != t[1]:
		st += 'RU\n'
		s[0] += 1
		s[1] += 1
	if s[0] == t[0]:
		for i in range(t[1] - s[1]):
			st += 'U\n'
	elif s[1] == t[1]:
		for i in range(t[0] - s[0]):
			st += 'R\n'
elif s[0] < t[0] and s[1] == t[1]:
	for i in range(t[0] - s[0]):
		st += 'R\n'
elif s[0] < t[0] and s[1] > t[1]:
	while s[0] != t[0] and s[1] != t[1]:
		st += 'RD\n'
		s[0] += 1
		s[1] -= 1
	if s[0] == t[0]:
		for i in range(s[1] - t[1]):
			st += 'D\n'
	elif s[1] == t[1]:
		for i in range(t[0] - s[0]):
			st += 'R\n'
elif s[0] == t[0] and s[1] < t[1]:
	for i in range(t[1] - s[1]):
		st += 'U\n'
elif s[0] == t[0] and s[1] > t[1]:
	for i in range(s[1] - t[1]):
		st += 'U\n'
elif s[0] > t[0] and s[1] < t[1]:
	while s[0] != t[0] and s[1] != t[1]:
		st += 'LU\n'
		s[0] -= 1
		s[1] += 1
	if s[0] == t[0]:
		for i in range(t[1] - s[1]):
			st += 'U\n'
	elif s[1] == t[1]:
		for i in range(s[0] - t[0]):
			st += 'L\n'
elif s[0] > t[0] and s[1] == t[1]:
	for i in range(s[0] - t[0]):
		st += 'L\n'
elif s[0] > t[0] and s[1] > t[1]:
	while s[0] != t[0] and s[1] != t[1]:
		st += 'LD\n'
		s[0] -= 1
		s[1] -= 1
	if s[0] == t[0]:
		for i in range(s[1] - t[1]):
			st += 'D\n'
	elif s[1] == t[1]:
		for i in range(s[0] - t[0]):
			st += 'L\n'
print(st.count('\n'))
print(st)


s = input()
t = input()
s1 = s[0]
s2 = s[1]
t1 = t[0]
t2 = t[1]
horizontalDistance = abs(ord(s1) - ord(t1))
verticalDistance = abs(int(s2) - int(t2))
minSteps = verticalDistance if verticalDistance > horizontalDistance else horizontalDistance
hdCounter = 0
vdCounter = 0
hd = ord(s1) - ord(t1)
vd = int(s2) - int(t2)
print(minSteps)
for i in range(minSteps):
	step = ''
	if hd > 0 and hd > hdCounter:
		step += 'L'
		hdCounter += 1
	elif hd < 0 and abs(hd) > hdCounter:
		step += 'R'
		hdCounter += 1
	if vd > 0 and vd > vdCounter:
		step += 'D'
		vdCounter += 1
	elif vd < 0 and abs(vd) > vdCounter:
		step += 'U'
		vdCounter += 1
	print(step)


def letter_to_num(letter):
	if letter == 'a':
		return 1
	if letter == 'b':
		return 2
	if letter == 'c':
		return 3
	if letter == 'd':
		return 4
	if letter == 'e':
		return 5
	if letter == 'f':
		return 6
	if letter == 'g':
		return 7
	if letter == 'h':
		return 8
fr = input()
to = input()
x1 = letter_to_num(fr[0])
y1 = int(fr[1])
x2 = letter_to_num(to[0])
y2 = int(to[1])
moves = 0
path = []
while True:
	if x1 < x2:
		if y1 < y2:
			m = 'RU'
			x1 += 1
			y1 += 1
		elif y1 > y2:
			m = 'RD'
			x1 += 1
			y1 -= 1
		else:
			m = 'R'
			x1 += 1
		moves += 1
	elif x1 > x2:
		if y1 < y2:
			m = 'LU'
			x1 -= 1
			y1 += 1
		elif y1 > y2:
			m = 'LD'
			x1 -= 1
			y1 -= 1
		else:
			m = 'L'
			x1 -= 1
		moves += 1
	else:
		if y1 < y2:
			m = 'U'
			y1 += 1
		elif y1 > y2:
			m = 'D'
			y1 -= 1
		else:
			break
		moves += 1
	path.append(m)
print(moves)
for p in path:
	print(p)


from math import sqrt
s = input()
t = input()
x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
r = ''
x1 = x.index(s[0]) + 1
x2 = x.index(t[0]) + 1
y1 = int(s[1])
y2 = int(t[1])
if s == t:
	print(0)
elif x1 == x2:
	print(abs(y1 - y2))
	if y1 > y2:
		r = 'D'
	else:
		r = 'U'
	for i in range(abs(y1 - y2)):
		print(r)
elif y1 == y2:
	print(abs(x1 - x2))
	if x1 > x2:
		r = 'L'
	else:
		r = 'R'
	for i in range(abs(x1 - x2)):
		print(r)
elif x1 + y1 == x2 + y2 or x1 - y1 == x2 - y2:
	print(abs(x1 - x2))
	if x2 > x1:
		r += 'R'
	else:
		r += 'L'
	if y2 > y1:
		r += 'U'
	else:
		r += 'D'
	for i in range(abs(x1 - x2)):
		print(r)
else:
	print(max(abs(x2 - x1), abs(y2 - y1)))
	if x2 > x1:
		r += 'R'
	else:
		r += 'L'
	if y2 > y1:
		r += 'U'
	else:
		r += 'D'
	for i in range(min(abs(x2 - x1), abs(y2 - y1))):
		print(r)
	if abs(x2 - x1) > abs(y2 - y1):
		if x2 > x1:
			r = 'R'
		else:
			r = 'L'
	elif abs(x2 - x1) < abs(y2 - y1):
		if y2 > y1:
			r = 'U'
		else:
			r = 'D'
	for i in range(max(abs(x2 - x1), abs(y2 - y1)) - min(abs(x2 - x1), abs(y2 - y1))):
		print(r)


p0 = input()
p1 = input()
x0 = ord(p0[0]) - 96
y0 = int(p0[1])
x1 = ord(p1[0]) - 96
y1 = int(p1[1])
diagonal_steps = min(abs(x1 - x0), abs(y1 - y0))
if x1 >= x0:
	if y1 >= y0:
		vector1 = 'RU'
	else:
		vector1 = 'RD'
elif y1 >= y0:
	vector1 = 'LU'
else:
	vector1 = 'LD'
not_diagonal_steps = max(abs(x1 - x0), abs(y1 - y0)) - diagonal_steps
if abs(x1 - x0) > abs(y1 - y0):
	if x1 >= x0:
		vector2 = 'R'
	else:
		vector2 = 'L'
elif y1 >= y0:
	vector2 = 'U'
else:
	vector2 = 'D'
print(diagonal_steps + not_diagonal_steps)
for i in range(diagonal_steps):
	print(vector1)
for i in range(not_diagonal_steps):
	print(vector2)


a = input()
b = input()
x = ord(a[0]) - ord(b[0])
y = ord(a[1]) - ord(b[1])
step = max(abs(x), abs(y))
fast = min(abs(x), abs(y))
dx = 'L'
dy = 'D'
dz = 'R'
if x < 0:
	dx = 'R'
if y < 0:
	dy = 'U'
if step == abs(x):
	dz = dx
else:
	dz = dy
print(step)
for i in range(fast):
	print(dx + dy)
for i in range(fast, step):
	print(dz)


from string import ascii_lowercase
s = input()
t = input()
sx = ord(s[0])
sy = ord(s[1])
tx = ord(t[0])
ty = ord(t[1])
LD = 0
RD = 0
LU = 0
RU = 0
D = 0
U = 0
R = 0
L = 0
while tx < sx and ty < sy:
	LD = LD + 1
	sx = sx - 1
	sy = sy - 1
while tx > sx and ty < sy:
	RD = RD + 1
	sx = sx + 1
	sy = sy - 1
while tx < sx and ty > sy:
	LU = LU + 1
	sx = sx - 1
	sy = sy + 1
while tx > sx and ty > sy:
	RU = RU + 1
	sx = sx + 1
	sy = sy + 1
if sy == ty:
	while sx > tx:
		L = L + 1
		sx = sx - 1
	while sx < tx:
		R = R + 1
		sx = sx + 1
if sx == tx:
	while sy > ty:
		D = D + 1
		sy = sy - 1
	while sy < ty:
		U = U + 1
		sy = sy + 1
print(LD + RD + LU + RU + D + U + L + R)
for i in range(0, LD, 1):
	print('LD')
for i in range(0, RD, 1):
	print('RD')
for i in range(0, LU, 1):
	print('LU')
for i in range(0, RU, 1):
	print('RU')
for i in range(0, D, 1):
	print('D')
for i in range(0, U, 1):
	print('U')
for i in range(0, L, 1):
	print('L')
for i in range(0, R, 1):
	print('R')


now = list(input())
end = list(input())
y = []
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
now[0] = alphabet.index(now[0]) + 1
end[0] = alphabet.index(end[0]) + 1
now[1] = int(now[1])
end[1] = int(end[1])
while now != end:
	if now[0] == end[0] or now[1] == end[1]:
		if now[0] < end[0]:
			y.append('R')
			now[0] = now[0] + 1
		if now[0] > end[0]:
			y.append('L')
			now[0] = now[0] - 1
		if now[1] > end[1]:
			y.append('D')
			now[1] = now[1] - 1
		if now[1] < end[1]:
			y.append('U')
			now[1] = now[1] + 1
	else:
		if now[0] < end[0] and now[1] > end[1]:
			y.append('RD')
			now[0] = now[0] + 1
			now[1] = now[1] - 1
		if now[0] < end[0] and now[1] < end[1]:
			y.append('RU')
			now[0] = now[0] + 1
			now[1] = now[1] + 1
		if now[0] > end[0] and now[1] > end[1]:
			y.append('LD')
			now[0] = now[0] - 1
			now[1] = now[1] - 1
		if now[0] > end[0] and now[1] < end[1]:
			y.append('LU')
			now[0] = now[0] - 1
			now[1] = now[1] + 1
print(len(y))
for i in y:
	print(i)


d = {97 + i: i + 1 for i in range(8)}
s = input()
s = [d[ord(s[0])], int(s[1])]
t = input()
t = [d[ord(t[0])], int(t[1])]
answer = []
steps = 0
if s[0] <= t[0] and s[1] >= t[1]:
	while s[0] != t[0] and s[1] != t[1]:
		s[0] += 1
		s[1] -= 1
		answer.append('RD')
		steps += 1
	if s[0] == t[0]:
		while s[1] != t[1]:
			s[1] -= 1
			answer.append('D')
			steps += 1
	else:
		while s[0] != t[0]:
			s[0] += 1
			answer.append('R')
			steps += 1
elif s[0] >= t[0] and s[1] >= t[1]:
	while s[0] != t[0] and s[1] != t[1]:
		s[0] -= 1
		s[1] -= 1
		answer.append('LD')
		steps += 1
	if s[0] == t[0]:
		while s[1] != t[1]:
			s[1] -= 1
			answer.append('D')
			steps += 1
	else:
		while s[0] != t[0]:
			s[0] -= 1
			answer.append('L')
			steps += 1
elif s[0] >= t[0] and s[1] <= t[1]:
	while s[0] != t[0] and s[1] != t[1]:
		s[0] -= 1
		s[1] += 1
		answer.append('LU')
		steps += 1
	if s[0] == t[0]:
		while s[1] != t[1]:
			s[1] += 1
			answer.append('U')
			steps += 1
	else:
		while s[0] != t[0]:
			s[0] -= 1
			answer.append('L')
			steps += 1
else:
	while s[0] != t[0] and s[1] != t[1]:
		s[0] += 1
		s[1] += 1
		answer.append('RU')
		steps += 1
	if s[0] == t[0]:
		while s[1] != t[1]:
			s[1] += 1
			answer.append('U')
			steps += 1
	else:
		while s[0] != t[0]:
			s[0] += 1
			answer.append('R')
			steps += 1
print(steps)
for move in answer:
	print(move)


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)


a = input()
b = input()
a = list(a)
b = list(b)
a[1] = int(a[1])
b[1] = int(b[1])
move = 0
d = 0
j = 0
if a[0] == 'a':
	a[0] = 1
if a[0] == 'b':
	a[0] = 2
if a[0] == 'c':
	a[0] = 3
if a[0] == 'd':
	a[0] = 4
if a[0] == 'e':
	a[0] = 5
if a[0] == 'f':
	a[0] = 6
if a[0] == 'g':
	a[0] = 7
if a[0] == 'h':
	a[0] = 8
if b[0] == 'a':
	b[0] = 1
if b[0] == 'b':
	b[0] = 2
if b[0] == 'c':
	b[0] = 3
if b[0] == 'd':
	b[0] = 4
if b[0] == 'e':
	b[0] = 5
if b[0] == 'f':
	b[0] = 6
if b[0] == 'g':
	b[0] = 7
if b[0] == 'h':
	b[0] = 8
f = a[0]
g = a[1]
h = b[0]
i = b[1]
if b[0] - a[0] >= 0 and b[1] - a[1] >= 0 and (d == 0):
	d = 1
	while b[0] - a[0] > 0 and b[1] - a[1] > 0:
		move += 1
		b[0] -= 1
		b[1] -= 1
	while b[0] - a[0] > 0 and b[1] - a[1] == 0:
		move += 1
		b[0] -= 1
	while b[0] - a[0] == 0 and b[1] - a[1] > 0:
		move += 1
		b[1] -= 1
if b[0] - a[0] <= 0 and b[1] - a[1] >= 0 and (d == 0):
	d = 1
	while b[0] - a[0] < 0 and b[1] - a[1] > 0:
		move += 1
		b[0] += 1
		b[1] -= 1
	while b[0] - a[0] < 0 and b[1] - a[1] == 0:
		move += 1
		b[0] += 1
	while b[0] - a[0] == 0 and b[1] - a[1] > 0:
		move += 1
		b[1] -= 1
if b[0] - a[0] >= 0 and b[1] - a[1] <= 0 and (d == 0):
	d = 1
	while b[0] - a[0] > 0 and b[1] - a[1] < 0:
		move += 1
		b[0] -= 1
		b[1] += 1
	while b[0] - a[0] == 0 and b[1] - a[1] < 0:
		move += 1
		b[1] += 1
	while b[0] - a[0] > 0 and b[1] - a[1] == 0:
		move += 1
		b[0] -= 1
if b[0] - a[0] <= 0 and b[1] - a[1] <= 0 and (d == 0):
	d = 1
	while b[0] - a[0] < 0 and b[1] - a[1] < 0:
		move += 1
		b[0] += 1
		b[1] += 1
	while b[0] - a[0] == 0 and b[1] - a[1] < 0:
		move += 1
		b[1] += 1
	while b[0] - a[0] < 0 and b[1] - a[1] == 0:
		move += 1
		b[0] += 1
print(move)
a[0] = f
a[1] = g
b[0] = h
b[1] = i
if b[0] - a[0] >= 0 and b[1] - a[1] >= 0 and (j == 0):
	j = 1
	while b[0] - a[0] > 0 and b[1] - a[1] > 0:
		move += 1
		b[0] -= 1
		b[1] -= 1
		print('RU')
	while b[0] - a[0] > 0 and b[1] - a[1] == 0:
		move += 1
		b[0] -= 1
		print('R')
	while b[0] - a[0] == 0 and b[1] - a[1] > 0:
		move += 1
		b[1] -= 1
		print('U')
if b[0] - a[0] <= 0 and b[1] - a[1] >= 0 and (j == 0):
	j = 1
	while b[0] - a[0] < 0 and b[1] - a[1] > 0:
		move += 1
		b[0] += 1
		b[1] -= 1
		print('LU')
	while b[0] - a[0] < 0 and b[1] - a[1] == 0:
		move += 1
		b[0] += 1
		print('L')
	while b[0] - a[0] == 0 and b[1] - a[1] > 0:
		move += 1
		b[1] -= 1
		print('U')
if b[0] - a[0] >= 0 and b[1] - a[1] <= 0 and (j == 0):
	j = 1
	while b[0] - a[0] > 0 and b[1] - a[1] < 0:
		move += 1
		b[0] -= 1
		b[1] += 1
		print('RD')
	while b[0] - a[0] == 0 and b[1] - a[1] < 0:
		move += 1
		b[1] += 1
		print('D')
	while b[0] - a[0] > 0 and b[1] - a[1] == 0:
		move += 1
		b[0] -= 1
		print('R')
if b[0] - a[0] <= 0 and b[1] - a[1] <= 0 and (j == 0):
	j = 1
	while b[0] - a[0] < 0 and b[1] - a[1] < 0:
		move += 1
		b[0] += 1
		b[1] += 1
		print('LD')
	while b[0] - a[0] == 0 and b[1] - a[1] < 0:
		move += 1
		b[1] += 1
		print('D')
	while b[0] - a[0] < 0 and b[1] - a[1] == 0:
		move += 1
		b[0] += 1
		print('L')


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


al_num = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
pos1 = input()
pos2 = input()
ans = []
itero = 0
pos1 = [al_num[pos1[0]], int(pos1[1])]
pos2 = [al_num[pos2[0]], int(pos2[1])]
if pos1[0] >= pos2[0]:
	if pos1[1] >= pos2[1]:
		for i in range(min(pos1[0] - pos2[0], pos1[1] - pos2[1])):
			ans.append('LD')
			itero = itero + 1
		save = itero
		if pos1[0] - pos2[0] < pos1[1] - pos2[1]:
			for i in range(max(pos1[0] - pos2[0], pos1[1] - pos2[1]) - save):
				ans.append('D')
				itero = itero + 1
		else:
			for i in range(max(pos1[0] - pos2[0], pos1[1] - pos2[1]) - save):
				ans.append('L')
				itero = itero + 1
	else:
		for i in range(min(pos1[0] - pos2[0], pos2[1] - pos1[1])):
			ans.append('LU')
			itero = itero + 1
		save = itero
		if pos1[0] - pos2[0] < pos2[1] - pos1[1]:
			for i in range(max(pos1[0] - pos2[0], pos2[1] - pos1[1]) - save):
				ans.append('U')
				itero = itero + 1
		else:
			for i in range(max(pos1[0] - pos2[0], pos2[1] - pos1[1]) - save):
				ans.append('L')
				itero = itero + 1
elif pos1[1] >= pos2[1]:
	for i in range(min(pos2[0] - pos1[0], pos1[1] - pos2[1])):
		ans.append('RD')
		itero = itero + 1
	save = itero
	if pos2[0] - pos1[0] < pos1[1] - pos2[1]:
		for i in range(max(pos2[0] - pos1[0], pos1[1] - pos2[1]) - save):
			ans.append('D')
			itero = itero + 1
	else:
		for i in range(max(pos2[0] - pos1[0], pos1[1] - pos2[1]) - save):
			ans.append('R')
			itero = itero + 1
else:
	for i in range(min(pos2[0] - pos1[0], pos2[1] - pos1[1])):
		ans.append('RU')
		itero = itero + 1
	save = itero
	if pos2[0] - pos1[0] < pos2[1] - pos1[1]:
		for i in range(max(pos2[0] - pos1[0], pos2[1] - pos1[1]) - save):
			ans.append('U')
			itero = itero + 1
	else:
		for i in range(max(pos2[0] - pos1[0], pos2[1] - pos1[1]) - save):
			ans.append('R')
			itero = itero + 1
print(itero)
for i in ans:
	print(i)


s = input()
t = input()
row = 'abcdefgh'
(s_col, s_row) = (row.index(s[0]), int(s[1]))
(t_col, t_row) = (row.index(t[0]), int(t[1]))
moves = []
while (s_row, s_col) != (t_row, t_col):
	dir_col = ''
	if s_col < t_col:
		dir_col = 'R'
		s_col += 1
	if s_col > t_col:
		dir_col = 'L'
		s_col -= 1
	dir_row = ''
	if s_row < t_row:
		dir_row = 'U'
		s_row += 1
	if s_row > t_row:
		dir_row = 'D'
		s_row -= 1
	moves.append(dir_col + dir_row)
print(len(moves))
print('\n'.join(moves))


letters_to_number = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
inp = (input(), input())
((pos_x, pos_y), (target_x, target_y)) = map(lambda x: (letters_to_number[x[0]], int(x[1])), inp)
move_table = {(-1, 0): 'L', (1, 0): 'R', (0, 1): 'U', (0, -1): 'D', (-1, -1): 'LD', (1, 1): 'RU', (-1, 1): 'LU', (1, -1): 'RD'}
moves = []
sign = lambda x: 1 if x > 0 else -1 if x < 0 else 0
while pos_x != target_x or pos_y != target_y:
	dir_x = sign(target_x - pos_x)
	dir_y = sign(target_y - pos_y)
	moves.append(move_table[dir_x, dir_y])
	pos_x += dir_x
	pos_y += dir_y
print(len(moves))
for m in moves:
	print(m)


import sys
import math
s = sys.stdin.readline()
t = sys.stdin.readline()
sx = int(ord(s[0]) - 97)
sy = 8 - int(s[1])
tx = int(ord(t[0]) - 97)
ty = 8 - int(t[1])
px = [0] * 64
py = [0] * 64
grid = [[-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1]]
dx = [1, 1, 1, 0, 0, -1, -1, -1]
dy = [1, 0, -1, 1, -1, 1, 0, -1]
d = 0
grid[sy][sx] = 0
while True:
	for y in range(8):
		for x in range(8):
			if grid[y][x] == d:
				for k in range(8):
					iy = y + dy[k]
					ix = x + dx[k]
					if iy >= 0 and iy < 8 and (ix >= 0) and (ix < 8) and (grid[iy][ix] == -1):
						grid[iy][ix] = d + 1
	d += 1
	if grid[ty][tx] != -1:
		break
ln = grid[ty][tx]
x = tx
y = ty
d = ln
while d > 0:
	px[d] = x
	py[d] = y
	d -= 1
	for k in range(8):
		iy = y + dy[k]
		ix = x + dx[k]
		if iy >= 0 and iy < 8 and (ix >= 0) and (ix < 8) and (grid[iy][ix] == d):
			x = x + dx[k]
			y = y + dy[k]
			break
px[0] = sx
py[0] = sy
print(ln)
for i in range(ln):
	x = px[i] - px[i + 1]
	y = py[i] - py[i + 1]
	res = ''
	if x < 0:
		res += 'R'
	elif x > 0:
		res += 'L'
	if y < 0:
		res += 'D'
	elif y > 0:
		res += 'U'
	print(res)


def ver_direction_decider(dis, res):
	if dis > 0:
		return res + 'U'
	elif dis == 0:
		return res
	else:
		return res + 'D'

def hor_direction_decider(dis):
	dire = ''
	if disp[0] > 0:
		dire += 'R'
		return ver_direction_decider(disp[1], dire)
	elif disp[0] == 0:
		return ver_direction_decider(disp[1], dire)
	else:
		dire += 'L'
		return ver_direction_decider(disp[1], dire)
start = input()
end = input()
st = (ord(start[0]) - 97, int(start[1]) - 1)
ed = (ord(end[0]) - 97, int(end[1]) - 1)
disp = (ed[0] - st[0], ed[1] - st[1])
ab_disp = (abs(disp[0]), abs(disp[1]))
n_diag = min(ab_disp)
n_str = max(ab_disp) - n_diag
is_str = n_diag == 0
is_diag = n_str == 0
n_moves = n_str + n_diag
print(n_moves)
str_dir = hor_direction_decider(disp)
if is_str or is_diag:
	for _ in range(n_moves):
		print(str_dir)
else:
	if ab_disp[1] > ab_disp[0]:
		str_comp = str_dir[1]
	else:
		str_comp = str_dir[0]
	for _ in range(n_str):
		print(str_comp)
	for _ in range(n_diag):
		print(str_dir)


s = input()
t = input()
x1 = ord(s[0]) - ord('a') + 1
x2 = ord(t[0]) - ord('a') + 1
y1 = int(s[1])
y2 = int(t[1])
print(max(abs(x1 - x2), abs(y1 - y2)))
while x1 != x2 or y1 != y2:
	if x1 < x2:
		print('R', end='')
		x1 += 1
	if x1 > x2:
		print('L', end='')
		x1 -= 1
	if y1 < y2:
		print('U', end='')
		y1 += 1
	if y1 > y2:
		print('D', end='')
		y1 -= 1
	print()


import sys
start = sys.stdin.readline()
end = sys.stdin.readline()
diff_x = ord(end[0]) - ord(start[0])
diff_y = int(end[1]) - int(start[1])
steps = []
count = 0
while diff_x != 0 or diff_y != 0:
	if diff_x > 0:
		step = 'R'
		if diff_y > 0:
			step += 'U'
			diff_y -= 1
		elif diff_y < 0:
			step += 'D'
			diff_y += 1
		steps.append(step)
		diff_x -= 1
	elif diff_x < 0:
		step = 'L'
		if diff_y > 0:
			step += 'U'
			diff_y -= 1
		elif diff_y < 0:
			step += 'D'
			diff_y += 1
		steps.append(step)
		diff_x += 1
	else:
		step = ''
		if diff_y > 0:
			step += 'U'
			diff_y -= 1
		elif diff_y < 0:
			step += 'D'
			diff_y += 1
		steps.append(step)
	count += 1
print(count)
for move in steps:
	print(move)


s2 = input()
s1 = input()
a = ord(s1[0]) - 96
b = int(s1[1])
x = ord(s2[0]) - 96
y = int(s2[1])
if abs(x - a) < abs(y - b):
	s = abs(y - b)
	print(abs(y - b))
else:
	s = abs(x - a)
	print(abs(x - a))
for i in range(s):
	if x > a and y > b:
		print('LD')
		a += 1
		b += 1
	elif x > a and y < b:
		print('LU')
		a += 1
		b -= 1
	elif x < a and y > b:
		print('RD')
		a -= 1
		b += 1
	elif x < a and y < b:
		print('RU')
		a -= 1
		b -= 1
	elif x > a:
		print('L')
		a += 1
	elif x < a:
		print('R')
		a -= 1
	elif y > b:
		print('D')
		b += 1
	elif y < b:
		print('U')
		b -= 1


current = list(input())
wanted = list(input())
minmovesd = 0
minmoves = 0
moves = []

def parsePosition(toParse):
	toParse[0] = ord(toParse[0]) - 96
	toParse[1] = int(toParse[1])
parsePosition(current)
parsePosition(wanted)
while wanted[0] != current[0] and wanted[1] != current[1]:
	minmovesd += 1
	if wanted[0] > current[0] and wanted[1] > current[1]:
		current[0] += 1
		current[1] += 1
		moves.append('RU')
	elif wanted[0] < current[0] and wanted[1] < current[1]:
		current[0] -= 1
		current[1] -= 1
		moves.append('LD')
	elif wanted[0] > current[0] and wanted[1] < current[1]:
		current[0] += 1
		current[1] -= 1
		moves.append('RD')
	elif wanted[0] < current[0] and wanted[1] > current[1]:
		current[0] -= 1
		current[1] += 1
		moves.append('LU')
if wanted[0] == current[0]:
	if wanted[1] > current[1]:
		minmoves += wanted[1] - current[1]
		for i in range(minmoves):
			moves.append('U')
	elif wanted[1] < current[1]:
		minmoves += current[1] - wanted[1]
		for i in range(minmoves):
			moves.append('D')
elif wanted[1] == current[1]:
	if wanted[0] > current[0]:
		minmoves += wanted[0] - current[0]
		for i in range(minmoves):
			moves.append('R')
	elif wanted[0] < current[0]:
		minmoves += current[0] - wanted[0]
		for i in range(minmoves):
			moves.append('L')
print(minmoves + minmovesd)
for m in moves:
	print(m)


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

def toCoordinate(pos):
	return [dictPos[pos[0]], int(pos[1])]
kingPos = toCoordinate(str(input()))
targetPos = toCoordinate(str(input()))
diffPos = [targetPos[0] - kingPos[0], targetPos[1] - kingPos[1]]
diagonalMove = min(abs(diffPos[0]), abs(diffPos[1]))
hMove = 'R' if diffPos[0] > 0 else 'L'
vMove = 'U' if diffPos[1] > 0 else 'D'
move = ''
nMove = 0
if diagonalMove > 0:
	nMove = diagonalMove
	move = move + diagonalMove * (hMove + vMove + '\n')
if abs(diffPos[0]) > diagonalMove:
	nMove = nMove + abs(diffPos[0]) - diagonalMove
	move = move + (hMove + '\n') * (abs(diffPos[0]) - diagonalMove)
else:
	nMove = nMove + abs(diffPos[1]) - diagonalMove
	move = move + (vMove + '\n') * (abs(diffPos[1]) - diagonalMove)
print(nMove)
print(move[:-1])


x = 'abcdefgh'
y = '12345678'
b = input()
a = input()
m = x.index(a[0]) - x.index(b[0])
n = int(a[1]) - int(b[1])
p = max(abs(m), abs(n))
print(p)
for _ in range(p):
	if m > 0 and n > 0:
		print('RU')
		m -= 1
		n -= 1
	elif m > 0 and n < 0:
		print('RD')
		m -= 1
		n += 1
	elif m < 0 and n < 0:
		print('LD')
		m += 1
		n += 1
	elif m < 0 and n > 0:
		print('LU')
		m += 1
		n -= 1
	elif m == 0 and n > 0:
		print('U')
		n -= 1
	elif m == 0 and n < 0:
		print('D')
		n += 1
	elif m < 0 and n == 0:
		print('L')
		m += 1
	elif m > 0 and n == 0:
		print('R')
		m -= 1


f = input()
t = input()
f = [ord(f[0]) - ord('a'), int(f[1]) - 1]
t = [ord(t[0]) - ord('a'), int(t[1]) - 1]
a = []
while f[0] < t[0] and f[1] < t[1]:
	a.append('RU')
	f[0] += 1
	f[1] += 1
while f[0] > t[0] and f[1] < t[1]:
	a.append('LU')
	f[0] -= 1
	f[1] += 1
while f[0] < t[0] and f[1] > t[1]:
	a.append('RD')
	f[0] += 1
	f[1] -= 1
while f[0] > t[0] and f[1] > t[1]:
	a.append('LD')
	f[0] -= 1
	f[1] -= 1
while f[0] < t[0]:
	a.append('R')
	f[0] += 1
while f[0] > t[0]:
	a.append('L')
	f[0] -= 1
while f[1] < t[1]:
	a.append('U')
	f[1] += 1
while f[1] > t[1]:
	a.append('D')
	f[1] -= 1
print(len(a))
print('\n'.join(a))


init = input()
finis = input()
my_dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
my_list = list('abcdefgh')
a = my_dict[finis[0]] - my_dict[init[0]]
n = int(finis[1]) - int(init[1])
print(max(abs(a), abs(n)))
if a >= 0:
	if n >= a:
		for i in range(a):
			print('RU')
		for i in range(n - a):
			print('U')
	elif n >= 0 and n < a:
		for i in range(n):
			print('RU')
		for i in range(a - n):
			print('R')
	elif n < 0 and n >= -a:
		for i in range(-n):
			print('RD')
		for i in range(a + n):
			print('R')
	elif n < -a:
		for i in range(a):
			print('RD')
		for i in range(-n - a):
			print('D')
elif n < a:
	for i in range(-a):
		print('LD')
	for i in range(-n + a):
		print('D')
elif n <= 0 and n >= a:
	for i in range(-n):
		print('LD')
	for i in range(-a + n):
		print('L')
elif n > 0 and n <= -a:
	for i in range(n):
		print('LU')
	for i in range(-a - n):
		print('L')
elif n > -a:
	for i in range(-a):
		print('LU')
	for i in range(n + a):
		print('U')


a = input()
b = input()
if a[0] == 'a':
	a1 = 1
if a[0] == 'b':
	a1 = 2
if a[0] == 'c':
	a1 = 3
if a[0] == 'd':
	a1 = 4
if a[0] == 'e':
	a1 = 5
if a[0] == 'f':
	a1 = 6
if a[0] == 'g':
	a1 = 7
if a[0] == 'h':
	a1 = 8
if a[1] == '1':
	a2 = 1
if a[1] == '2':
	a2 = 2
if a[1] == '3':
	a2 = 3
if a[1] == '4':
	a2 = 4
if a[1] == '5':
	a2 = 5
if a[1] == '6':
	a2 = 6
if a[1] == '7':
	a2 = 7
if a[1] == '8':
	a2 = 8
if b[0] == 'a':
	b1 = 1
if b[0] == 'b':
	b1 = 2
if b[0] == 'c':
	b1 = 3
if b[0] == 'd':
	b1 = 4
if b[0] == 'e':
	b1 = 5
if b[0] == 'f':
	b1 = 6
if b[0] == 'g':
	b1 = 7
if b[0] == 'h':
	b1 = 8
if b[1] == '1':
	b2 = 1
if b[1] == '2':
	b2 = 2
if b[1] == '3':
	b2 = 3
if b[1] == '4':
	b2 = 4
if b[1] == '5':
	b2 = 5
if b[1] == '6':
	b2 = 6
if b[1] == '7':
	b2 = 7
if b[1] == '8':
	b2 = 8
print(max(abs(a1 - b1), abs(a2 - b2)))
while a1 != b1 or a2 != b2:
	c = ' '
	if a1 > b1:
		c = c + 'L'
		b1 += 1
	if a1 < b1:
		c = c + 'R'
		a1 += 1
	if a2 > b2:
		c = c + 'D'
		b2 += 1
	if a2 < b2:
		c = c + 'U'
		a2 += 1
	print(c)


s1 = input().strip()
s2 = input().strip()
(c1, r1, c2, r2) = (ord(s1[0]) - ord('a') + 1, int(s1[1]), ord(s2[0]) - ord('a') + 1, int(s2[1]))
rDiff = abs(r1 - r2)
cDiff = abs(c1 - c2)
cross = 'R' if c1 < c2 else 'L'
cross += 'U' if r1 < r2 else 'D'
if max(rDiff, cDiff) == rDiff:
	straight = 'U' if r1 < r2 else 'D'
else:
	straight = 'R' if c1 < c2 else 'L'
print(max(rDiff, cDiff))
for i in range(min(rDiff, cDiff)):
	print(cross)
for i in range(max(rDiff, cDiff) - min(rDiff, cDiff)):
	print(straight)


start = input()
end = input()
colst = start[0]
if colst == 'a':
	colst = 1
elif colst == 'b':
	colst = 2
elif colst == 'c':
	colst = 3
elif colst == 'd':
	colst = 4
elif colst == 'e':
	colst = 5
elif colst == 'f':
	colst = 6
elif colst == 'g':
	colst = 7
elif colst == 'h':
	colst = 8
rowst = int(start[1])
cole = end[0]
if cole == 'a':
	cole = 1
elif cole == 'b':
	cole = 2
elif cole == 'c':
	cole = 3
elif cole == 'd':
	cole = 4
elif cole == 'e':
	cole = 5
elif cole == 'f':
	cole = 6
elif cole == 'g':
	cole = 7
elif cole == 'h':
	cole = 8
rowe = int(end[1])
d = []
cnt = 0
while colst != cole or rowst != rowe:
	ans = ''
	if colst < cole:
		ans += 'R'
		colst += 1
	if colst > cole:
		ans += 'L'
		colst -= 1
	if rowst < rowe:
		ans += 'U'
		rowst += 1
	if rowst > rowe:
		ans += 'D'
		rowst -= 1
	cnt += 1
	d.append(ans)
print(cnt)
for i in d:
	print(i)


a = input()
b = input()
s = [ord(a[0]) - ord('a'), ord(a[1]) - ord('1')]
t = [ord(b[0]) - ord('a'), ord(b[1]) - ord('1')]
ans = []
while s != t:
	step = ''
	if s[0] < t[0]:
		step += 'R'
		s[0] += 1
	elif s[0] > t[0]:
		step += 'L'
		s[0] -= 1
	if s[1] < t[1]:
		step += 'U'
		s[1] += 1
	elif s[1] > t[1]:
		step += 'D'
		s[1] -= 1
	ans.append(step)
print(len(ans))
print('\n'.join(ans))


def sign(n):
	if n > 0:
		return 1
	if n < 0:
		return -1
	return 0
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])
	st = 'L' if d0 == -1 else '' if d0 == 0 else 'R'
	st += 'D' if d1 == -1 else '' if d1 == 0 else 'U'
	s[0] += d0
	s[1] += d1
	a.append(st)
print(len(a))
for s in a:
	print(s)


s = input()
a1 = ord(s[0]) - ord('a') + 1
b1 = int(s[1])
s = input()
a2 = ord(s[0]) - ord('a') + 1
b2 = int(s[1])
m = max(abs(a1 - a2), abs(b1 - b2))
print(m)
while a1 != a2 or b1 != b2:
	if a2 > a1:
		if b2 > b1:
			b1 += 1
			a1 += 1
			print('RU')
		elif b2 == b1:
			a1 += 1
			print('R')
		else:
			a1 += 1
			b1 -= 1
			print('RD')
	elif a2 == a1:
		if b2 > b1:
			b1 += 1
			print('U')
		elif b2 < b1:
			b1 -= 1
			print('D')
	elif b2 > b1:
		b1 += 1
		a1 -= 1
		print('LU')
	elif b2 == b1:
		a1 -= 1
		print('L')
	else:
		a1 -= 1
		b1 -= 1
		print('LD')


def kingmoves(j, i, b, a):
	s = ''
	t = 0
	while i < a and j < b:
		i += 1
		j += 1
		s += 'RU\n'
		t += 1
	while i < a and j > b:
		i += 1
		j -= 1
		s += 'LU\n'
		t += 1
	while i > a and j < b:
		i -= 1
		j += 1
		s += 'RD\n'
		t += 1
	while i > a and j > b:
		i -= 1
		j -= 1
		s += 'LD\n'
		t += 1
	while i > a:
		i -= 1
		s += 'D\n'
		t += 1
	while i < a:
		i += 1
		s += 'U\n'
		t += 1
	while j > b:
		j -= 1
		s += 'L\n'
		t += 1
	while j < b:
		j += 1
		s += 'R\n'
		t += 1
	return (t, s[:-1])
x = input()
i = ord(x[0]) - 96
j = int(x[1:])
y = input()
a = ord(y[0]) - 96
b = int(y[1:])
(n, p) = kingmoves(i, j, a, b)
print(n)
print(p)


start = input()
end = input()
rows = [1, 2, 3, 4, 5, 6, 7, 8]
cols = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']
start_row = rows.index(int(start[1:]))
start_col = cols.index(start[:1])
end_row = rows.index(int(end[1:]))
end_col = cols.index(end[:1])
steps = []
diag = min(abs(start_row - end_row), abs(start_col - end_col))
all_steps = max(abs(start_row - end_row), abs(start_col - end_col))
vertical_pref = ''
horiz_pref = ''
if start_row > end_row:
	vertical_pref = 'D'
else:
	vertical_pref = 'U'
if start_col > end_col:
	horiz_pref = 'L'
else:
	horiz_pref = 'R'
print(all_steps)
for _ in range(diag):
	print(horiz_pref + vertical_pref)
if abs(start_row - end_row) != abs(start_col - end_col):
	if abs(start_row - end_row) > abs(start_col - end_col):
		for _ in range(all_steps - diag):
			print(vertical_pref)
	else:
		for _ in range(all_steps - diag):
			print(horiz_pref)


x = input()
y = input()
answer = []
while x != y:
	alpha1 = x[0]
	number1 = int(x[1])
	alpha2 = y[0]
	number2 = int(y[1])
	temp = ''
	if alpha1 < alpha2:
		temp += 'R'
	elif alpha1 > alpha2:
		temp += 'L'
	if number1 < number2:
		temp += 'U'
	elif number1 > number2:
		temp += 'D'
	answer.append(temp)
	nextChar = chr(ord(alpha1) + 1)
	prevChar = chr(ord(alpha1) - 1)
	if temp == 'L':
		x = prevChar + str(number1)
	elif temp == 'R':
		x = nextChar + str(number1)
	elif temp == 'U':
		x = alpha1 + str(number1 + 1)
	elif temp == 'D':
		x = alpha1 + str(number1 - 1)
	elif temp == 'LU':
		x = prevChar + str(number1 + 1)
	elif temp == 'RU':
		x = nextChar + str(number1 + 1)
	elif temp == 'LD':
		x = prevChar + str(number1 - 1)
	elif temp == 'RD':
		x = nextChar + str(number1 - 1)
print(len(answer))
for i in answer:
	print(i)


s = list(input())
f = list(input())
alph = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8}
scol = alph[s[0]]
srow = int(s[1])
fcol = alph[f[0]]
frow = int(f[1])
colM = abs(fcol - scol)
rowM = abs(frow - srow)
low = min(colM, rowM)
high = max(colM, rowM)
print(high)
x = scol
y = srow
for i in range(low):
	if (x < fcol or x == fcol) and (y > frow or y == frow):
		x = x + 1
		y = y - 1
		print('RD')
	elif (x < fcol or x == fcol) and (y < frow or y == frow):
		x = x + 1
		y = y + 1
		print('RU')
	elif (x > fcol or x == fcol) and (y < frow or y == frow):
		x = x - 1
		y = y + 1
		print('LU')
	elif (x > fcol or x == fcol) and (y > frow or y == frow):
		x = x - 1
		y = y - 1
		print('LD')
for i in range(high - low):
	if x == fcol and y > frow:
		print('D')
		y = y - 1
	elif x == fcol and y < frow:
		print('U')
		y = y + 1
	elif x > fcol and y == frow:
		print('L')
		x = x - 1
	elif x < fcol and y == frow:
		print('R')
		x = x + 1


p1 = input()
p2 = input()
gor = ord(p2[0]) - ord(p1[0])
vert = int(p2[1]) - int(p1[1])
com = min(abs(vert), abs(gor))
scom = ''
if gor > 0:
	scom += 'R'
else:
	scom += 'L'
if vert > 0:
	scom += 'U'
else:
	scom += 'D'
print(max(abs(vert), abs(gor)))
for i in range(com):
	print(scom)
if abs(vert) > abs(gor):
	if vert > 0:
		scom = 'U'
	else:
		scom = 'D'
elif gor > 0:
	scom = 'R'
else:
	scom = 'L'
for i in range(abs(abs(vert) - abs(gor))):
	print(scom)


__author__ = 'Eddie'
import sys

def get_filehandler(is_file):
	if is_file:
		return open(file='data')
	else:
		import sys
		return sys.stdin
fh = get_filehandler(is_file=False)
location = [(ord(x) - 96, int(y)) for (x, y) in map(str.rstrip, fh.readlines())]
st = (location[0][0] - location[1][0], location[0][1] - location[1][1])
move = [None] * 2
move[0] = 'L' if st[0] > 0 else 'R'
move[1] = 'D' if st[1] > 0 else 'U'
st = list(map(abs, st))
oblique = min(st)
print(sum(st) - oblique)
for _i in range(oblique):
	print(''.join(move))
for _i in range(st[0] - oblique):
	print(move[0])
for _i in range(st[1] - oblique):
	print(move[1])


def read():
	s = input()
	return (ord(s[0]) - ord('a'), ord(s[1]) - ord('1'))

def move(r, m, d=''):
	if r:
		print(*(m, d, '\n') * r, sep='', end='')

def main():
	(sx, sy) = read()
	(gx, gy) = read()
	dx = gx - sx
	if dx < 0:
		h = 'L'
		dx = -dx
	else:
		h = 'R'
	dy = gy - sy
	if dy < 0:
		v = 'D'
		dy = -dy
	else:
		v = 'U'
	if dx < dy:
		print(dy)
		move(dx, h, v)
		move(dy - dx, v)
	else:
		print(dx)
		move(dy, h, v)
		move(dx - dy, h)
main()


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