#!/bin/python3 import sys,math def printShortestPath(n, i_start, j_start, i_end, j_end): #print("called") # Print the distance along with the sequence of moves. if(abs(i_start-i_end)%2!=0): return "Impossible" if(i_start!=i_end): if(abs(j_start-j_end)%2==0 and (j_start!=j_end)): return "Impossible" if(abs(j_start-j_end)==1): if(abs(i_start-i_end)%6!=0): return "Impossible" else: if(abs(j_start-j_end)%2!=0): return "Impossible" #if the point is in the same y axis if(j_start == j_end): if(abs(i_start-i_end)%4!=0): return "Impossible" #if the point is above it if(i_start>i_end): ans = "" cnt = 0 #if point is in first col if(j_start==0): for i in range( (i_start-i_end)//4 ): ans+="UR UL " cnt += 2 return str(cnt) + "\n" +ans #if point is on last col # elif(j_start==n-1): # for i in range( (i_start>i_end)/4 ): # ans.append("UL UR ") # return ans else: for i in range( (i_start-i_end)//4 ): ans+="UL UR " cnt += 2 return str(cnt) + "\n" +ans #return ans #else if the point is below it else: ans = "" cnt = 0 #if point is in last col if(j_start==n-1): for i in range( (i_end-i_start)//4 ): ans+="LL LR " cnt += 2 return str(cnt) + "\n" +ans #return ans else: for i in range( (i_end-i_start)//4 ): ans+="LR LL " cnt += 2 return str(cnt) + "\n" +ans #return ans #if the dest point is to the left of it elif(j_start>j_end): #if the dest point is just one col away if((j_start-j_end)==1): #if the dest point is above it if(i_start>i_end): #if the start point is in 2nd col if(j_start==1): ans = "" cnt = 0 for i in range((i_start-i_end)//6): ans+="UL UR UL " cnt += 3 return str(cnt) + "\n" +ans #return ans else: ans = "" cnt = 0 for i in range((i_start-i_end)//6): ans+="UL UL UR " cnt += 3 return str(cnt) + "\n" +ans #return ans #else if the point is below it else: #if the start point is in last col if(j_start==n-1): ans = "" cnt = 0 for i in range((i_start-i_end)//6): ans+="LL LR LL " cnt += 3 return str(cnt) + "\n" +ans #return ans else: ans = "" for i in range((i_start-i_end)//6): ans+="LR LL LR " cnt += 3 return str(cnt) + "\n" +ans #return ans else: if(i_start>i_end): ans = "" cnt = 0 temp = (i_start-i_end)//2 for i in range(temp): ans+="UL " cnt +=1 for i in range((j_start-j_end-temp)//2): ans+="L " cnt += 1 return str(cnt) + "\n" +ans #return ans else: ans = "" cnt = 0 temp = (i_end-i_start)//2 for i in range(temp): ans+="LL " cnt +=1 for i in range((j_start-j_end-temp)//2): ans+="L " cnt +=1 return str(cnt) + "\n" +ans #return ans #else if the point is on the right else: #if the dest point is just one col away if((j_end-j_start)==1): #if the dest point is above it if(i_start>i_end): #if the start point is in 1st col if(j_start==0): ans = "" cnt = 0 for i in range((i_start-i_end)//6): ans+="UR UL UR " cnt +=3 return str(cnt) + "\n" +ans #return ans else: ans = "" cnt = 0 for i in range((i_start-i_end)//6): ans+="UL UR UR " cnt +=3 return str(cnt) + "\n" +ans #return ans #else if the point is below it else: #if the start point is in 2nd last col if(j_start==n-2): ans = "" cnt = 0 for i in range((i_start-i_end)//6): ans+="LR LL LR " cnt += 3 return str(cnt) + "\n" +ans #return ans else: ans = "" cnt = 0 for i in range((i_start-i_end)//6): ans+="LR LR LL " cnt += 3 return str(cnt) + "\n" +ans #return ans else: if(i_start>i_end): ans = "" cnt = 0 temp = (i_start-i_end)//2 for i in range(temp): ans+="UR " cnt +=1 for i in range((j_start-j_end-temp)//2): ans+="R " cnt +=1 return str(cnt) + "\n" +ans #return ans else: ans = "" cnt = 0 temp = (i_end-i_start)//2 for i in range(temp): ans+="LR " cnt += 1 for i in range((j_start-j_end-temp)//2): ans+="R " cnt += 1 return str(cnt) + "\n" +ans #return ans # 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)] print(printShortestPath(n, i_start, j_start, i_end, j_end))