import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static final int UL=1, UR=2, R=3, LR=4, LL=5, L=6; static final String Impossible="Impossible"; static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. int steps=0,vdiff=0,hdiff=0; String path=""; //Same V-Axis if(j_start==j_end){ vdiff=Math.abs(i_start-i_end); if(vdiff%4!=0){ path=Impossible; } else{ if(i_start>i_end){ //Towards Up while(vdiff>0){ steps+=2; path="UL UR "; vdiff-=4; } } else{ //Towards Down steps+=2; path="LR LL "; vdiff-=4; } } } //Same H-Axis else if(i_start==i_end){ //Destination on Right if(j_starti_end && j_start>j_end){ vdiff=Math.abs(i_end-i_start); hdiff=Math.abs(j_end-j_start); if(vdiff%2!=0){ path=Impossible; } else{ while(vdiff>0){ path+="UL "; vdiff-=2; hdiff-=1; steps++; } while(hdiff>0){ path+="L "; hdiff-=2; steps++; } } } //Towards Upper Right Path else if(i_start>i_end && j_start0){ path+="UR "; vdiff-=2; hdiff-=1; steps++; } while(hdiff>0){ path+="R "; hdiff-=2; steps++; } } } //Towards Lower Left Path else if(i_startj_end){ vdiff=Math.abs(i_end-i_start); hdiff=Math.abs(j_end-j_start); if(vdiff%2!=0){ path=Impossible; } else{ while(vdiff>0){ path+="LL "; vdiff-=2; hdiff-=1; steps++; } while(hdiff>0){ path+="L "; hdiff-=2; steps++; } } } //Towards Lower Right Path else if(i_start0){ path+="LR "; vdiff-=2; hdiff-=1; steps++; } while(hdiff>0){ path+="R "; hdiff-=2; steps++; } } } if(steps!=0){ System.out.println(steps); } System.out.println(path); } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int i_start = in.nextInt(); int j_start = in.nextInt(); int i_end = in.nextInt(); int j_end = in.nextInt(); printShortestPath(n, i_start, j_start, i_end, j_end); in.close(); } }