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) { // Print the distance along with the sequence of moves. int count = 0; String countstr=""; if(Math.abs(i_end-i_start)%2 == 0 ){ if(i_start == i_end){ if(j_start > j_end){ int num = (j_start-j_end)/2; System.out.println(num); for(int i=0;i i_end){ int num = (i_start-i_end)/2; System.out.println(num); for(int i=1;i<=num;i++){ if(i%2 == 1){ System.out.print("UL "); }else{ System.out.print("UR "); } } }else if(i_start < i_end){ int num = (i_end-i_start)/2; System.out.println(num); for(int i=1;i<=num;i++){ if(i%2 == 1){ System.out.print("LR "); }else{ System.out.print("LL "); } } } }else{ if(i_end j_end){ for(int k=i_start,m=j_start;k>=i_end && m>=j_end;){ if(k>i_end && m>=j_end){ k=k-2; m=m-1; countstr += "UL "; count++; } else if(k == i_end){ if(m >= j_end){ int num = (m-j_end)/2; count = count+num; for(int i=1;i<=num;i++){ countstr += "L "; } } break; } } System.out.println(count); System.out.println(countstr); } else if(i_end>i_start && j_start>j_end){ for(int k=i_start,m=j_start;k<=i_end && m>=j_end;){ if(m!=i_end && m>=i_end){ countstr += "LL "; k=k+2; m=m-1; count++; } else if(k == i_end){ if(m >= j_end){ int num = (m-j_end)/2; count = count+num; for(int i=1;i<=num;i++){ countstr += "L "; } } break; } } System.out.println(count); System.out.println(countstr); } else if(i_start>i_end && j_start=i_end && m<=j_end;){ if(m!=i_end && m>=i_end){ countstr += "UR "; k=k-2; m=m+1; count++; } else if(k == i_end){ if(m <= j_end){ int num = (j_end-m)/2; count = count+num; for(int i=1;i<=num;i++){ countstr += "R "; } } break; } } System.out.println(count); System.out.println(countstr); } else if(i_start=i_end){ countstr += "LR "; k=k+2; m=m+1; count++; } else if(k == i_end){ if(m <= j_end){ int num = (j_end-m)/2; count = count+num; for(int i=1;i<=num;i++){ countstr += "R "; } } break; } } System.out.println(count); System.out.println(countstr); } } }else{ System.out.println("Impossible"); } } 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(); } }