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) { int iDistance = Math.abs(i_end - i_start); int jDistance = Math.abs(j_end - j_start); /* - The i distance must be even - If i distance is 0, the j distance must be even - If j distance is even, the i distance must be multiple of 4 - If j distance are odd, the i distance must be multiple of 4 + 2 */ if ((iDistance % 2 != 0) || (iDistance == 0 && jDistance % 2 != 0) || (jDistance % 2 == 0 && iDistance % 4 != 0) || (jDistance % 2 != 0 && (iDistance - 2) % 4 != 0)) { System.out.println("Impossible"); return; } int moves = 0; String track = ""; int i = i_start; int j = j_start; while (i != i_end || j != j_end) { if (i_end > i) { if (j_end < j) { i += 2; j -= 1; moves++; track += "LL "; } else { i += 2; j += 1; moves++; track += "LR "; } } else if (i_end < i) { if (j_end > j) { i -= 2; j += 1; moves++; track += "UR "; } else { i -= 2; j -= 1; moves++; track += "UL "; } } else { if (j_end > j) { j += 2; moves++; track += "R "; } else if (j_end < j) { j -= 2; moves++; track += "L "; } } } System.out.println(moves); System.out.println(track); } 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(); } }