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[] pre = new int[n * n]; Arrays.fill(pre, -1); int start = i_start * n + j_start; int end = i_end * n + j_end; pre[start] = start; Queue queue = new LinkedList<>(); queue.add(start); int[][] moves = new int[][] {{-2, -1}, {-2, 1}, {0, 2}, {2, 1}, {2, -1}, {0, -2}}; String[] strings = new String[] {"UL", "UR", "R", "LR", "LL", "L"}; int count = 0; boolean findEnd = false; while (!queue.isEmpty() && !findEnd) { count++; int m = queue.size(); for (int k = 0; k < m; k++) { int cur = queue.poll(); for (int[] move : moves) { int i = cur / n + move[0]; int j = cur % n + move[1]; int next = i * n + j; if (i < 0 || i >= n || j < 0 || j >= n || pre[next] >= 0) { continue; } pre[next] = cur; if (next == end) { findEnd = true; break; } queue.offer(next); } } } if (pre[end] < 0) { System.out.println("Impossible"); } else { System.out.println(count); StringBuilder builder = new StringBuilder(); while (pre[end] != end) { int[] diff = new int[] {end / n - pre[end] / n, end % n - pre[end] % n}; for (int i = 0; i < moves.length; i++) { int[] move = moves[i]; if (move[0] == diff[0] && move[1] == diff[1]) { builder.insert(0, strings[i] + " "); } } end = pre[end]; } System.out.println(builder.toString()); } } 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(); } }