import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int count=0; static StringBuilder str = new StringBuilder(""); static void printShortestPathU(int n, int i_start, int j_start, int i_end, int j_end){ printShortestPath(n, i_start, j_start, i_end, j_end); if(count==0) System.out.println(str); else{ System.out.println(count-1); System.out.println(str); } } static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int di=i_end-i_start; int dj=j_end-j_start; if((i_end-i_start)%2!=0){ //System.out.println("Impossible"); str.append("Impossible"); return; //return "Impossible"; }else if((di/2)%2==0 && dj%2!=0){ str.append("Impossible"); return; } else if((di/2)%2!=0 && dj%2==0){ str.append("Impossible"); return; } else{ count++; if(di<0 && dj<0){ // System.out.print("UL "); str.append("UL "); printShortestPath(n, i_start-2, j_start-1, i_end, j_end); } if(di<0 && dj==0){ if(j_start-1>=0){ //System.out.print("UL "); str.append("UL "); printShortestPath(n, i_start-2, j_start-1, i_end, j_end); }else{ // System.out.print("UR "); str.append("UR "); printShortestPath(n, i_start-2, j_start+1, i_end, j_end); } } if(di<0 && dj>0){ //System.out.print("UR "); str.append("UR "); printShortestPath(n, i_start-2, j_start+1, i_end, j_end); } if(di==0 && dj>0){ if(dj%2!=0){ count=0; str.append("Impossible"); return; } else if(dj>=2){ //System.out.print("R "); str.append("R "); printShortestPath(n, i_start, j_start+2, i_end, j_end); } else{ if(i_start-2>=0){ //System.out.print("UR "); str.append("UR "); printShortestPath(n, i_start-2, j_start+1, i_end, j_end); }else{ //System.out.print("LR "); str.append("LR "); printShortestPath(n, i_start+2, j_start+1, i_end, j_end); } } } if(di==0 && dj<0){ if(dj%2!=0){ count=0; str.append("Impossible"); return; } else if(dj<=-2){ //System.out.print("L "); str.append("L "); printShortestPath(n, i_start, j_start-2, i_end, j_end); } else{ if(i_start-2>=0){ // System.out.print("UL "); str.append("UL "); printShortestPath(n, i_start-2, j_start-1, i_end, j_end); }else if(i_start+20 && dj<0){ // System.out.print("LL "); str.append("LL "); printShortestPath(n, i_start+2, j_start-1, i_end, j_end); } if(di>0 && dj==0){ if(j_start+1=0){ // System.out.print("LL "); str.append("LL "); printShortestPath(n, i_start+2, j_start-1, i_end, j_end); } } if(di>0 && dj>0){ //System.out.print("LR "); if(2*dj>di){ str.append("R "); printShortestPath(n, i_start, j_start+2, i_end, j_end); }else{ str.append("LR "); printShortestPath(n, i_start+2, j_start+1, i_end, j_end); } } } return ; } 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(); printShortestPathU(n, i_start, j_start, i_end, j_end); // in.close(); } }