import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Solution { private static List sequence = Arrays.asList("UL", "UR", "R", "LR", "LL", "L"); private static int N = 0; static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { LinkedList linkedList = new LinkedList(); if (Math.abs(i_start - i_end) % 2 != 0) { System.out.println("Impossible"); return; } if (evaluate(i_start, j_start, i_end, j_end, linkedList)) { StringBuilder sb = new StringBuilder(); linkedList.descendingIterator().forEachRemaining((String s) -> sb.append(s).append(" ")); sb.deleteCharAt(sb.length() - 1); System.out.println(linkedList.size()); System.out.println(sb.toString()); } else { System.out.println("Impossible"); } } static boolean evaluate(int i_start, int j_start, int i_end, int j_end, LinkedList l) { if (i_start == i_end && j_start == j_end) { return true; } for (String seq : sequence) { int temp_i; int temp_j; if ("UL".equals(seq)) { if (isValid(temp_i = i_start - 2, temp_j = j_start - 1) && i_start > i_end && j_start >= j_end) { if (evaluate(temp_i, temp_j, i_end, j_end, l)) { l.add(seq); return true; } } } else if ("UR".equals(seq)) { if (isValid(temp_i = i_start - 2, temp_j = j_start + 1) && i_start > i_end && j_start <= j_end) { if (evaluate(temp_i, temp_j, i_end, j_end, l)) { l.add(seq); return true; } } } else if ("R".equals(seq)) { if (isValid(temp_i = i_start, temp_j = j_start + 2) && j_start < j_end) { if (evaluate(temp_i, temp_j, i_end, j_end, l)) { l.add(seq); return true; } } } else if ("LR".equals(seq)) { if (isValid(temp_i = i_start + 2, temp_j = j_start + 1) && i_start < i_end && j_start <= j_end) { if (evaluate(temp_i, temp_j, i_end, j_end, l)) { l.add(seq); return true; } } } else if ("LL".equals(seq)) { if (isValid(temp_i = i_start + 2, temp_j = j_start - 1) && i_start < i_end && j_start >= j_end) { if (evaluate(temp_i, temp_j, i_end, j_end, l)) { l.add(seq); return true; } } } else if ("L".equals(seq)) { if (isValid(temp_i = i_start, temp_j = j_start - 2) && j_start > j_end) { if (evaluate(temp_i, temp_j, i_end, j_end, l)) { l.add(seq); return true; } } } } return false; } static boolean isValid(int i, int j) { return i >= 0 && i < N && j >= 0 && j < N; } 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(); N = n; printShortestPath(n, i_start, j_start, i_end, j_end); in.close(); } }