#!/bin/python import sys def UL(x,y,n): if x - 1 < 0: return -1 if y - 2 < 0: return -1 return (x-1,y-2) def UR(x,y,n): if x + 1 >= n: return -1 if y - 2 < 0: return -1 return (x+1,y-2) def R(x,y,n): if x + 2 >= n: return -1 return (x+2,y) def LR(x,y,n): if x + 1 >= n: return -1 if y + 2 >= n: return -1 return(x+1,y+2) def LL(x,y,n): if x - 1 < 0: return -1 if y + 2 >= n: return -1 return (x-1,y+2) def L(x,y,n): if x - 2 < 0: return -1 return (x-2,y) class Node: def __init__(self,coor,move,father): self.coor = coor self.move = move self.father = father; self.x = coor[0] self.y = coor[1] def BFS(start,end,n): start = Node(start,None,None); queue = [start] visited = set([start.coor]) while len(queue) != 0: current = queue.pop(0) if current.coor == end: return current j = UL(current.x,current.y,n) if j != -1: node = Node((j[0],j[1]),'UL',current) if node.coor not in visited: queue.append(node) visited.add(node.coor) j = UR(current.x,current.y,n) if j != -1: node = Node((j[0],j[1]),'UR',current) if node.coor not in visited: queue.append(node) visited.add(node.coor) j = R(current.x,current.y,n) if j != -1: node = Node((j[0],j[1]),'R',current) if node.coor not in visited: queue.append(node) visited.add(node.coor) j = LR(current.x,current.y,n) if j != -1: node = Node((j[0],j[1]),'LR',current) if node.coor not in visited: queue.append(node) visited.add(node.coor) j = LL(current.x,current.y,n) if j != -1: node = Node((j[0],j[1]),'LL',current) if node.coor not in visited: queue.append(node) visited.add(node.coor) j = L(current.x,current.y,n) if j != -1: node = Node((j[0],j[1]),'L',current) if node.coor not in visited: queue.append(node) visited.add(node.coor) return -1 def printShortestPath(n, i_start, j_start, i_end, j_end): start = (j_start,i_start) end = (j_end,i_end) res = BFS(start,end,n) moves = [] if res == -1: print("Impossible") else: while res != None: moves.append(res.move) res = res.father print(len(moves)-1) print(" ".join(moves[:len(moves)-1][::-1])) # Print the distance along with the sequence of moves. 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)