import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static String[] sym = {"UR", "UL", "R", "LR", "LL", "L"}; static int[] di = {-2, -2, 0, 2, 2, 0}; static int[] dj = {1, -1, 2, 1, -1, -2}; 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. Path[][] pathto = new Path[n][n]; Queue pq = new LinkedList(); Path startpath = new Path(i_start, j_start, "", 0); pathto[i_start][j_start] = startpath; pq.add(startpath); while (!pq.isEmpty()) { Path p = pq.poll(); for (int k = 0; k < 6; k++) if (valid(n, p.i + di[k], p.j + dj[k]) && pathto[p.i + di[k]][p.j + dj[k]] == null) { Path newpath = new Path(p.i + di[k], p.j + dj[k], p.path + sym[k] + " ", p.len + 1); pq.add(newpath); pathto[p.i + di[k]][p.j + dj[k]] = newpath; } } if (pathto[i_end][j_end] == null) System.out.println("Impossible"); else { System.out.println(pathto[i_end][j_end].len); System.out.println(pathto[i_end][j_end].path); } } static boolean valid(int n, int i, int j) { return i >= 0 && i < n && j >= 0 && j < n; } static class Path { String path; int i, j; int len; Path(int i, int j, String path, int len) { this.i = i; this.j = j; this.path = path; this.len = len; } } 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(); } }