import java.io.*; import java.util.*; public class Main { private static final int mod = (int) 1E9 + 0, bufsize = (1 << 13); private static int iNextByte, iNextIndex, iReadByteCount, oNextIndex; private static final byte ibuf[] = new byte[bufsize], obuf[] = new byte[bufsize]; private static InputStream input = System.in; private static OutputStream output = System.out; private static PrintStream err = System.err; private Main() throws Exception { if (ilocal) input = new FileInputStream(new File("").getAbsolutePath() + "/src/zzz/input.txt"); if (olocal) output = new FileOutputStream(new File("").getAbsolutePath() + "/src/zzz/output.txt"); readByte(); solve(); input.close(); flushOutBuf(); } public static void main(String[] args) { try { new Main(); } catch (Exception e) { e.printStackTrace(); } } private int readByte() throws IOException { if (iNextIndex >= iReadByteCount) { iReadByteCount = input.read(ibuf, 0, bufsize); if (iReadByteCount == -1) return (iNextByte = -1); iNextIndex = 0; } return (iNextByte = ibuf[iNextIndex++]); } private char nextChar() throws IOException { while (iNextByte <= ' ') readByte(); char res = (char) iNextByte; readByte(); return res; } private int nextInt() throws IOException { int res = 0; while (iNextByte <= ' ') readByte(); boolean minus = (iNextByte == '-'); if (minus) readByte(); if (iNextByte < '0' || iNextByte > '9') throw new RuntimeException(); do {res = (res << 1) + (res << 3) + iNextByte - '0';} while (readByte() >= '0' && iNextByte <= '9'); return minus ? -res : res; } private long nextLong() throws IOException { long res = 0; while (iNextByte <= ' ') readByte(); boolean minus = (iNextByte == '-'); if (minus) readByte(); if (iNextByte < '0' || iNextByte > '9') throw new RuntimeException(); do {res = (res << 1) + (res << 3) + iNextByte - '0';} while (readByte() >= '0' && iNextByte <= '9'); return minus ? -res : res; } private double nextDouble() throws IOException { double pre = 0, suf = 0, div = 1; while (iNextByte <= ' ') readByte(); boolean minus = (iNextByte == '-'); if (minus) readByte(); if (iNextByte < '0' || iNextByte > '9') throw new RuntimeException(); do {pre = 10 * pre + (iNextByte - '0');} while (readByte() >= '0' && iNextByte <= '9'); if (iNextByte == '.') while (readByte() >= '0' && iNextByte <= '9') suf += (iNextByte - '0') / (div *= 10); return minus ? -(pre + suf) : (pre + suf); } private String nextString() throws IOException { while (iNextByte <= ' ') readByte(); StringBuilder sb = new StringBuilder(); while (iNextByte > ' ') { sb.append((char) iNextByte); readByte(); } return sb.toString(); } private char[] nextChar(int n) throws IOException { char a[] = new char[n]; for (int i = 0; i < n; ++i) a[i] = nextChar(); return a; } private char[][] nextChar(int r, int c) throws IOException { char a[][] = new char[r][c]; for (int i = 0; i < r; ++i) a[i] = nextChar(c); return a; } private int[] nextInt(int n) throws IOException { int a[] = new int[n]; for (int i = 0; i < n; ++i) a[i] = nextInt(); return a; } private int[][] nextInt(int r, int c) throws IOException { int a[][] = new int[r][c]; for (int i = 0; i < r; ++i) a[i] = nextInt(c); return a; } private long[] nextLong(int n) throws IOException { long a[] = new long[n]; for (int i = 0; i < n; ++i) a[i] = nextLong(); return a; } private long[][] nextLong(int r, int c) throws IOException { long a[][] = new long[r][c]; for (int i = 0; i < r; ++i) a[i] = nextLong(c); return a; } private double[] nextDouble(int n) throws IOException { double a[] = new double[n]; for (int i = 0; i < n; ++i) a[i] = nextDouble(); return a; } private double[][] nextDouble(int r, int c) throws IOException { double a[][] = new double[r][c]; for (int i = 0; i < r; ++i) a[i] = nextDouble(c); return a; } private String[] nextString(int n) throws IOException { String a[] = new String[n]; for (int i = 0; i < n; ++i) a[i] = nextString(); return a; } private String[][] nextString(int r, int c) throws IOException { String a[][] = new String[r][c]; for (int i = 0; i < r; ++i) a[i] = nextString(c); return a; } private void flushOutBuf() { try { if (oNextIndex <= 0) return; output.write(obuf, 0, oNextIndex); output.flush(); oNextIndex = 0; } catch (Exception e) { e.printStackTrace(); } } private void print(T ob) { String s = ob + ""; for (int i = 0, N = s.length(); i < N; ++i) { obuf[oNextIndex++] = (byte) s.charAt(i); if (oNextIndex >= bufsize) flushOutBuf(); } } private void println(T ob) { print(ob + "\n"); } int N; Node[][] board; private void solve() throws Exception { N = nextInt(); int sx = nextInt(), sy = nextInt(), ex = nextInt(), ey = nextInt(); board = new Node[N][N]; for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) board[i][j] = new Node(i, j); LinkedList que = new LinkedList<>(); Node source = board[sx][sy], sink = board[ex][ey]; que.addLast(source); source.mark = true; boolean found = false; while (que.size() > 0) { Node u = que.removeFirst(); for (Node v : neighbors(u)) { if (v.mark) continue; v.parent = u; v.mark = true; if (v.equals(sink)) { found = true; break; } que.addLast(v); } if (found) break; } if (!found) println("Impossible"); else { List path = new ArrayList<>(); Node node = sink; while (node != null) { path.add(0, node); node = node.parent; } println(path.size() - 1); for (int i = 0, CNT = path.size(); i < CNT - 1; ++i) { print(cmdFromTo(path.get(i), path.get(i + 1)) + " "); } } } String cmdFromTo(Node u, Node v) { int dx = v.x - u.x, dy = v.y - u.y; for (int i = 0; i < this.dx.length; ++i) { if (this.dx[i] == dx && this.dy[i] == dy) return name[i]; } return "XXX"; } int dx[] = {-2, -2, 0, 2, 2, 0}; int dy[] = {-1, 1, 2, 1, -1, -2}; String name[] = {"UL", "UR", "R", "LR", "LL", "L"}; List neighbors(Node u) { List res = new ArrayList<>(); int x = u.x, y = u.y; for (int i = 0; i < dx.length; ++i) { int xx = x + dx[i], yy = y + dy[i]; try { res.add(board[xx][yy]); } catch (Exception ignored) {} } return res; } class Node { int x, y; boolean mark; Node parent; Node(int i, int j) { x = i; y = j; } @Override public boolean equals(Object obj) { if (obj == null) return false; Node other = (Node) obj; return this.x == other.x && this.y == other.y; } } private static final boolean ilocal = false, olocal = false; }