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 minDist = 0; List moves = new LinkedList(); Boolean found = false; Boolean impossible = false; while(found == false && impossible == false){ if((i_start == i_end) && (j_start == j_end)){ found = true; } // same i if(i_start == i_end){ if(Math.abs(j_start - j_end) == 1){ impossible = true; } else if(j_start > j_end){ moves.add("L"); j_start = j_start - 2; minDist++; } else if(j_start < j_end){ moves.add("R"); j_start = j_start + 2; minDist++; } } // same j else if(j_start == j_end){ if(Math.abs(i_start - i_end) == 1){ impossible = true; } else if(j_start == 0){ if(i_start > i_end){ moves.add("UR"); j_start = j_start + 1; i_start = i_start - 2; minDist++; } else if(i_start < i_end){ moves.add("LR"); j_start = j_start + 1; i_start = i_start + 2; minDist++; } } else if(j_start == n-1){ if(i_start > i_end){ moves.add("UL"); j_start = j_start - 1; i_start = i_start - 2; minDist++; } else if(i_start < i_end){ moves.add("LL"); j_start = j_start - 1; i_start = i_start + 2; minDist++; } } else if(i_start > i_end){ moves.add("UL"); j_start = j_start - 1; i_start = i_start - 2; minDist++; } else if(i_start < i_end){ moves.add("LR"); j_start = j_start + 1; i_start = i_start + 2; minDist++; } } // greater i else if(i_start > i_end){ if(Math.abs(i_start - i_end) == 1 ){ impossible = true; } else if(j_start > j_end){ moves.add("UL"); i_start = i_start - 2; j_start = j_start - 1; minDist++; } else if(j_start < j_end){ moves.add("UR"); i_start = i_start - 2; j_start = j_start + 1; minDist++; } } // smaller i else if(i_start < i_end){ if(Math.abs(i_start - i_end) == 1 ){ impossible = true; } else if(j_start < j_end){ moves.add("LR"); i_start = i_start + 2; j_start = j_start + 1; minDist++; } else if(j_start > j_end){ moves.add("LL"); i_start = i_start + 2; j_start = j_start - 1; minDist++; } } } //UL, UR, R, LR, LL, L if(impossible == true){ System.out.println("Impossible"); // for(String i: moves){ // System.out.print(i + ' '); // } } if(found == true){ System.out.println(minDist); for(String i: moves){ System.out.print(i + ' '); } } } 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(); } }