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) { if(Math.abs(i_end - i_start) % 2 != 0){ System.out.println("Impossible"); } else { if((Math.abs(i_end - i_start) % 4 == 0 && Math.abs(j_end - j_start) % 2 != 0) || (Math.abs(i_end - i_start) % 4 != 0 && Math.abs(i_end - i_start) % 2 == 0 && Math.abs(j_end - j_start) % 2 == 0)){ System.out.println("Impossible"); } else { List movements = new LinkedList(); double currDistance = 0; double newDistance = 0; String shortestMove = ""; while (i_start != i_end || j_start != j_end){ currDistance = Math.pow(i_end - i_start, 2) + Math.pow(j_end - j_start, 2); newDistance = Math.pow(i_end - (i_start - 2), 2) + Math.pow(j_end - (j_start - 1), 2); if(newDistance < currDistance && (i_start - 2) >= 0 && (j_start - 1) >= 0){ currDistance = newDistance; shortestMove = "UL"; } newDistance = Math.pow(i_end - (i_start - 2), 2) + Math.pow(j_end - (j_start + 1), 2); if(newDistance < currDistance && (i_start - 2) >= 0 && (j_start + 1) < n){ currDistance = newDistance; shortestMove = "UR"; } newDistance = Math.pow(i_end - (i_start), 2) + Math.pow(j_end - (j_start + 2), 2); if(newDistance < currDistance && (j_start + 2) < n){ currDistance = newDistance; shortestMove = "R"; } newDistance = Math.pow(i_end - (i_start + 2), 2) + Math.pow(j_end - (j_start + 1), 2); if(newDistance < currDistance && (i_start + 2) < n && (j_start + 1) < n){ currDistance = newDistance; shortestMove = "LR"; } newDistance = Math.pow(i_end - (i_start + 2), 2) + Math.pow(j_end - (j_start - 1), 2); if(newDistance < currDistance && (i_start + 2) < n && (j_start - 1) >= 0){ currDistance = newDistance; shortestMove = "LL"; } newDistance = Math.pow(i_end - (i_start), 2) + Math.pow(j_end - (j_start - 2), 2); if(newDistance < currDistance && (j_start - 2) >= 0){ currDistance = newDistance; shortestMove = "L"; } switch (shortestMove) { case "UL": i_start -= 2; j_start -= 1; break; case "UR": i_start -= 2; j_start += 1; break; case "R": j_start += 2; break; case "LR": i_start += 2; j_start += 1; break; case "LL": i_start += 2; j_start -= 1; break; case "L": j_start -= 2; break; default: break; } movements.add(shortestMove); System.err.println(i_start+ ", "+ j_start); } System.out.println(movements.size()); for(String s: movements){ System.out.print(s + " "); } } } } 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(); } }