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 vertical = i_end - i_start; int horizontal = j_end - j_start; if ((vertical != 0 && vertical % 2 != 0) || (horizontal % 2 != 0 && vertical % 4 == 0)){ System.out.print("Impossible"); return; } int currentVert = 0, currentHor = 0; int moves = 0; String steps = ""; // UL (-1, -2), UR, R, LR, LL, L while (currentVert != vertical || currentHor != horizontal){ moves++; int dirHor = currentHor - horizontal; int dirVert = currentVert - vertical; if (dirVert > 0){ if (dirHor >= 0){ steps = steps.concat("UL "); currentHor -= 1; currentVert -= 2; continue; } steps = steps.concat("UR "); currentHor += 1; currentVert -= 2; continue; } if (dirVert < 0) { if (dirHor <= 0){ steps = steps.concat("LR "); currentHor += 1; currentVert += 2; continue; } steps = steps.concat("LL "); currentHor -= 1; currentVert += 2; continue; } if (dirHor > 0){ steps = steps.concat("L "); currentHor -= 2; continue; } steps = steps.concat("R "); currentVert += 2; } System.out.println(moves); System.out.print(steps); } 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(); } }