#!/bin/python3 import sys def printShortestPath(n, starty, startx, i_end, j_end): # Print the distance along with the sequence of moves. visited=[[False for x in range(n)]for y in range(n)] parent=[[[-1,-1] for x in range(n)]for y in range(n)] queue=[] queue.append([starty,startx]) visited[starty][startx]=True while(queue): if queue[0]==[i_end,j_end]: break s = queue.pop(0) if s[1] >= 1 and s[0] >= 2 and not visited[s[0]-2][s[1]-1]: queue.append([s[0]-2,s[1]-1]) visited[s[0]-2][s[1]-1]=True parent[s[0]-2][s[1]-1]=s if s[1] <= n - 2 and s[0] >= 2 and not visited[s[0]-2][s[1]+1]: queue.append([s[0]-2,s[1]+1]) visited[s[0]-2][s[1]+1]=True parent[s[0] - 2][s[1] + 1] = s if s[1]<=n-3 and not visited[s[0]][s[1]+2]: queue.append([s[0], s[1] + 2]) visited[s[0]][s[1] + 2] = True parent[s[0]][s[1] + 2] = s if s[1] <= n - 2 and s[0] <= n-3 and not visited[s[0]+2][s[1]+1]: queue.append([s[0]+2,s[1]+1]) visited[s[0]+2][s[1]+1]=True parent[s[0]+2][s[1]+1]=s if s[1] >= 1 and s[0] <= n-3 and not visited[s[0]+2][s[1]-1]: queue.append([s[0]+2,s[1]-1]) visited[s[0]+2][s[1]-1]=True parent[s[0] + 2][s[1] - 1] = s if s[1] >= 2 and not visited[s[0]][s[1]-2]: queue.append([s[0],s[1]-2]) visited[s[0]][s[1]-2]=True parent[s[0]][s[1]-2]=s if not visited[i_end][j_end]: print('Impossible') return path=[[i_end,j_end]] tmp=path[0] while tmp!=[starty, startx]: tmp=parent[tmp[0]][tmp[1]] path.append(tmp) path=path[::-1] print(len(path)-1) for i in range(len(path)-1): if path[i][1]>path[i+1][1]: if path[i][0]path[i+1][0]: print('UL',end=' ') else: print('L',end=' ') else: if path[i][0]path[i+1][0]: print('UR',end=' ') else: print('R',end=' ') print() if __name__ == "__main__": n = int(input().strip()) i_start, j_start, i_end, j_end = 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)