import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static Map moves = new LinkedHashMap(); static List ls = new ArrayList(); static int c; static List seq = new ArrayList(); static void init() { moves.put("UL", new int[] {-2, -1}); ls.add("UL"); moves.put("UR", new int[] {-2, 1}); ls.add("UR"); moves.put("R", new int[] {0, 2}); ls.add("R"); moves.put("LR", new int[] {2, 1}); ls.add("LR"); moves.put("LL", new int[] {2, -1}); ls.add("LL"); moves.put("L", new int[] {0, -2}); ls.add("L"); } static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { if (i_start == i_end && j_start == j_end) { System.out.println(c); Collections.sort(seq); for (int i = 0; i < seq.size(); i++) { System.out.print(ls.get(seq.get(i)) + " "); } System.exit(0); } /*if ((i_end - i_start) % 2 != 0 || (j_end - j_start) % 2 != 0 && Math.abs((i_end - i_start) % 4) != 2) System.out.println("Impossible");*/ double min = distance(i_start, j_start, i_end, j_end); int i_min = 0; //index of possible move resulting in lowest distance for (int i = 0; i < ls.size(); i++) { int[] move = moves.get(ls.get(i)); int i_f = i_start + move[0], j_f = j_start + move[1]; if (distance(i_f, j_f, i_end, j_end) < min && 0 <= i_f && i_f < n && 0 <= j_f && j_f < n) { min = distance(i_f, j_f, i_end, j_end); i_min = i; } } int[] move = moves.get(ls.get(i_min)); i_start += move[0]; j_start += move[1]; //System.out.println(ls.get(i_min)); seq.add(i_min); c++; printShortestPath(n, i_start, j_start, i_end, j_end); } static double distance(int x1, int y1, int x2, int y2) { return Math.sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)); } 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(); init(); if ((i_end - i_start) % 2 != 0 || (j_end - j_start) % 2 != 0 && Math.abs((i_end - i_start) % 4) != 2) System.out.println("Impossible"); else printShortestPath(n, i_start, j_start, i_end, j_end); in.close(); } }