import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end,int count,) { if((i_start%2==0&&i_end%2!=0)||(i_start%2!=0&&i_end%2==0)) { System.out.println("Impossible"); return; } else { if((Math.abs(i_start-i_end)/2)%2==0&&(j_start+j_end)%2==0)//when 2 layer above/below but in odd columns { System.out.println("Impossible"); return; } if((Math.abs(i_start-i_end)/2)%2!=0&&(j_start+j_end)%2!=0)//when one layer above/below but in odd columns { System.out.println("Impossible"); return; } String answer=""; int count=0; if(i_start==i_end)//when in same row either move left or right { int no=(int)(Math.abs(j_start-j_end)/2); if(j_start>j_end)//go left { while(no>0) { answer+="L "; count++; no--; } } else//go right { while(no>0) { answer+="R "; count++; no--; } } } else if(i_start>i_end)//mela po { if(j_start==j_end)//upwards { int no=(int)((Math.abs(j_start-j_end)/2)/2); if(j_start-1<0)//cannot move to UL { while(no>0) { answer+="UR UL"; count+=2; no--; } } else//normal moves { while(no>0) { answer+="UR UL"; count+=2; no--; } } } else if(j_start>j_end)//go up left IInd quadrant { int width_dif=Math.abs(j_end-j_start);//in 1 units from 1 units dist int height_dif=(Math.abs(i_end-i_start)/2);//in 1 units from 2 units dist if(width_dif==height_dif)//its on diagonal { while(width_dif>0) { answer+="UL "; count++; width_dif--; } } else if(widht_dif>height_dif)//its below diag to the left { while(width_dif!=height_dif) { answer+="UL "; count++; width_dif--; } while(width_dif>0) { answer+="L "; count++; width_dif--; } } else//its above diag { int posj=j_start; while(height_dif!=width_dif) { answer+="UL "; posj--; count++; height_dif--; } height_dif/=2; int no=height_dif; if(posj-1<0)//cannot move to UL { while(no>0) { answer+="UR UL"; count+=2; no--; } } else//normal moves { while(no>0) { answer+="UR UL"; count+=2; no--; } } } } else//go up right I quadrant { int width_dif=Math.abs(j_end-j_start);//in 1 units from 1 units dist int height_dif=(Math.abs(i_end-i_start)/2);//in 1 units from 2 units dist if(width_dif==height_dif)//its on diagonal { while(width_dif>0) { answer+="UR "; count++; width_dif--; } } else if(widht_dif>height_dif)//its below diag to right { while(width_dif!=height_dif) { answer+="UR "; count++; width_dif--; } while(width_dif>0) { answer+="R "; count++; width_dif--; } } else//its above diag to right { int posj=j_start; int pos1=i_start; if(i_start-2*(height_dif-width_dif)>=0&&j_start-(height_dif-width_dif)>=0)//possible to go to diagonal of end { while(height_dif!=width_dif) { answer+="UL "; count++; height_dif--; } while(width_dif>0) { answer+="UR "; count++; width_dif--; } } else//not possible/partially possible { while(posj>=0) { answer+="UL "; count++; height_dif--; posj--; posi-=2; } printShortestPath(n, posi, posj, i_end, j_end,count,answer); } } } } else//kela po { } } // Print the distance along with the sequence of moves. } 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(); } }