#!/bin/python import sys def is_valid(x, y, movx, movy, n): if x + movx >= 0 and x + movx < n and y+movy >= 0 and y+movy < n: return True return False def printShortestPath(n, i_start, j_start, i_end, j_end): #print n, i_start, j_start, i_end, j_end , "n, i_start, j_start, i_end, j_end" # Print the distance along with the sequence of moves. # UL, UR, R, LR, LL, L. moves = [(-2,-1, "UL"), (-2, 1, "UR"), (0,2 , "R"), ( 2, 1, "LR"), ( 2, -1 , "LL") , ( 0, -2, "L") ] start = (i_start, j_start) dic = {} dic[start] = (-1, -1, "") lis = [start] found = False while len(lis) and (not found): pop = lis.pop(0) for mov in moves: if is_valid(pop[0], pop[1], mov[0], mov[1], n): x = pop[0] + mov[0] y = pop[1] + mov[1] if x == i_end and y == j_end: found = True if not (x,y) in dic: dic[(x,y)] = (pop[0], pop[1], mov[2]) lis.append((x,y)) #print dic if not found: print "Impossible" return else: ans = [] while True: parent = dic[(i_end, j_end)] ans.append(parent[2]) if parent[0] == i_start and parent[1] == j_start: break i_end = parent[0] j_end = parent[1] ans.reverse() print len(ans) for a in ans: print a, print " " if __name__ == "__main__": n = int(raw_input().strip()) i_start, j_start, i_end, j_end = raw_input().strip().split(' ') i_start, j_start, i_end, j_end = [int(i_start), int(j_start), int(i_end), int(j_end)] printShortestPath(n, i_start, j_start, i_end, j_end)