import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int[][] length; static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { length = new int[n][n]; for (int i = 0; i < n; i++) { Arrays.fill(length[i], 100000); } length[i_end][j_end] = 0; LinkedList next = new LinkedList<>(); next.addFirst(new int[]{i_end, j_end}); int[][] ops = new int[][]{ new int[]{-2, -1}, new int[]{-2, 1}, new int[]{0, 2}, new int[]{2, 1}, new int[]{2, -1}, new int[]{0, -2}}; while (next.size() > 0) { int[] cur = next.removeFirst(); if (cur[0] == i_start && cur[1] == j_start) { break; } int l = length[cur[0]][cur[1]]; for (int[] tt : ops) { if (up(cur[0] + tt[0], cur[1] + tt[1], l + 1)) { next.addLast(new int[]{cur[0] + tt[0], cur[1] + tt[1]}); } } } if (length[i_start][j_start] == 100000) { System.out.println("Impossible"); return; } System.out.println(length[i_start][j_start]); String[] xx = new String[]{"UL", "UR", "R", "LR", "LL", "L"}; while (length[i_start][j_start] > 0) { String op = null; int k1 = 0, k2 = 0; int p = 10000000; for (int l = 0; l < 6; l++) { if (v(i_start + ops[l][0], j_start + ops[l][1]) < p) { p = v(i_start + ops[l][0], j_start + ops[l][1]); op = xx[l]; k1 = ops[l][0]; k2 = ops[l][1]; } } i_start += k1; j_start += k2; System.out.print(op + " "); } } private static boolean up(int i, int j, int val) { int ov = v(i, j); if (ov == 100000000) return false; if (ov > val) { length[i][j] = val; return true; } return false; } static int v(int i1, int j) { if (i1 < 0 || j < 0 || i1 >= length.length || j >= length.length) { return 100000000; } return length[i1][j]; } 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(); int[][] visited = new int[n][n]; visited[i_start][j_start] = 1; printShortestPath(n, i_start, j_start, i_end, j_end); in.close(); } }