#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): cnt=0 chk=0 l=[] d1=i_start-i_end #print("d1 is ",d1) d2=j_start-j_end #print("d2 is ",d2) while(d1!=0 or d2!=0): if(d1%2!=0): print("Impossible") chk+=1 break else: if(d1>0): x=int(d1/2) #print("Value of x is ",x) if(d2>0): d2-=x #print("Value of d2 becomes ",d2) d1=0 #print("Value of d1 becomes ",d1) cnt+=x for i in range(x): l.append("UL") #print(l) else: if(d2==0): if(d1%4!=0 or j_start==0 or j_start==n-1): print("Impossible") chk+=1 break else: d1=0 #print("Value of d1 becomes ",d1) #print("Value of d2 is ",d2) cnt+=x for i in range(int(x/2)): l.append("UL") l.append("UR") #print(l) else: d2+=x #print("Value of d2 is ",d2) d1=0 #print("Value of d1 is ",d1) cnt+=x for i in range(x): l.append("UR") #print(l) else: if(d1==0): if(d2%2!=0): print("Impossible") chk+=1 break else: if(d2>0): x=int(d2/2) #print("Value of x is ",x) cnt+=x for i in range(x): l.append("L") #print(l) d2=0 #print("Value of d2 is ",d2) else: x=int(abs(d2/2)) #print("Value of x is ") cnt+=x for i in range(x): l.append("R") #print(l) d2=0 #print("Value of d2 is ",d2) else: x=int(abs(d1/2)) #print("Value of x is ",x) if(d2>0): d2-=x #print("Value of d2 is ",d2) d1=0 #print("Value of d1 is ",d1) cnt+=x for i in range(x): l.append("LL") #print(l) else: if(d2==0): if(d1%4!=0): print("Impossible") chk+=1 break else: d1=0 #print("Value of d1 is ",d1) cnt+=x for i in range(int(x/2)): l.append("LL") l.append("LR") #print(l) else: d2+=x d1=0 #print("Value of d1 is ",d1) cnt+=x for i in range(x): l.append("LR") l.sort(reverse=True) if(chk==0): print(cnt) for i in l: print(i,end=" ") 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)] c=0 lc=[i_start,i_end,j_start,j_end] for i in lc: if(i<0 or i>=n): c+=1 if((n>=5 and n<=200) and c==0): printShortestPath(n, i_start, j_start, i_end, j_end)