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. if(Math.abs(i_start - i_end) % 2 != 0) { System.out.print("Impossible"); return; } if (Math.abs(i_start - i_end) % 4 == 0 && Math.abs(j_start - j_end)%2 != 0) { System.out.print("Impossible"); return; } if (Math.abs(i_start - i_end) % 4 != 0 && Math.abs(j_start - j_end)%2 == 0) { System.out.print("Impossible"); return; } StringBuilder result = new StringBuilder(); int paceCount = 0; if (i_start <= i_end && j_start <= j_end) { while(i_start < i_end) { result.append("LR "); i_start += 2; j_start += 1; paceCount++; if(j_start == j_end + 1 && i_start < i_end) { result.append("LL "); paceCount++; i_start += 2; j_start -= 1; } } int pace = (Math.abs(j_start - j_end)/2) + 1; for(int i = 1; i < pace; i++) { result.append("R "); paceCount++; } } if (i_start > i_end && j_start <= j_end) { while(i_start > i_end) { result.append("UR "); i_start -= 2; j_start += 1; paceCount++; if(j_start == j_end && i_start > i_end) { result.append("UL "); paceCount++; i_start -= 2; j_start -= 1; } } int pace = (Math.abs(j_start - j_end)/2) + 1; for(int i = 1; i < pace; i++) { result.append("R "); paceCount++; } } if (i_start <= i_end && j_start > j_end) { while(i_start < i_end) { result.append("LL "); i_start += 2; j_start -= 1; paceCount++; if(j_start == j_end && i_start < i_end) { result.append("LR "); paceCount++; i_start += 2; j_start += 1; } } int pace = (Math.abs(j_start - j_end)/2) + 1; for(int i = 1; i < pace; i++) { result.append("L "); paceCount++; } } if (i_start > i_end && j_start > j_end) { while(i_start > i_end) { result.append("UL "); i_start -= 2; j_start -= 1; paceCount++; if(j_start == j_end - 1 && i_start > i_end) { result.append("UR "); paceCount++; i_start -= 2; j_start += 1; } } int pace = (Math.abs(j_start - j_end)/2) + 1; for(int i = 1; i < pace; i++) { result.append("L "); paceCount++; } } System.out.println(paceCount); System.out.println(result); } 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(); } }