import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.InputMismatchException; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; import java.util.Stack; class Main implements Runnable { static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; private BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars==-1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if(numChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = read(); while(isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if(c<'0'||c>'9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } public static void main(String args[]) throws Exception { new Thread(null, new Main(),"Main",1<<26).start(); } public void run() { InputReader sc= new InputReader(System.in); PrintWriter w= new PrintWriter(System.out); 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); } 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. boolean[][] visited= new boolean[n][n]; Pair[][] parent = new Pair[n][n]; int[][] level = new int[n][n]; Queue l = new LinkedList(); Pair p = new Pair(); p.a = i_start; p.b = j_start; l.add(p); visited[p.a][p.b] = true; level[p.a][p.b] = 0; while(!l.isEmpty()){ Pair p1 = l.poll(); int a = p1.a; int b= p1.b; if(a - 2 >= 0 && b - 1 >= 0){ if(!visited[a-2][b-1]){ Pair x = new Pair(); x.a = a-2; x.b = b-1; l.add(x); visited[x.a][x.b] = true; level[x.a][x.b] = level[p1.a][p1.b] + 1; parent[x.a][x.b] = p1; } }if(a - 2 >= 0 && b + 1 < n){ if(!visited[a-2][b+1]){ Pair x = new Pair(); x.a = a-2; x.b = b+1; l.add(x); visited[x.a][x.b] = true; level[x.a][x.b] = level[p1.a][p1.b] + 1; parent[x.a][x.b] = p1; } }if(b + 2 < n){ if(!visited[a][b+2]){ Pair x = new Pair(); x.a = a; x.b = b+2; l.add(x); visited[x.a][x.b] = true; level[x.a][x.b] = level[p1.a][p1.b] + 1; parent[x.a][x.b] = p1; } }if(a + 2 < n && b + 1 < n){ if(!visited[a+2][b+1]){ Pair x = new Pair(); x.a = a+2; x.b = b+1; l.add(x); visited[x.a][x.b] = true; level[x.a][x.b] = level[p1.a][p1.b] + 1; parent[x.a][x.b] = p1; } }if(a + 2 < n && b - 1 >= 0){ if(!visited[a+2][b-1]){ Pair x = new Pair(); x.a = a+2; x.b = b-1; l.add(x); visited[x.a][x.b] = true; level[x.a][x.b] = level[p1.a][p1.b] + 1; parent[x.a][x.b] = p1; } }if(b - 2 >= 0){ if(!visited[a][b-2]){ Pair x = new Pair(); x.a = a; x.b = b-2; l.add(x); visited[x.a][x.b] = true; level[x.a][x.b] = level[p1.a][p1.b] + 1; parent[x.a][x.b] = p1; } } } if(!visited[i_end][j_end]){ System.out.println("Impossible"); }else{ System.out.println(level[i_end][j_end]); int i = i_end; int j = j_end; Stack st = new Stack(); while(i != p.a || j != p.b){ int temp = i; int temp2 = j; i = parent[i][j].a; j = parent[temp][j].b; if(i-2==temp && j-1==temp2){ st.push("UL"); }if(i-2==temp && j+1==temp2){ st.push("UR"); }if(i==temp && j+2==temp2){ st.push("R"); }if(i+2==temp && j+1==temp2){ st.push("LR"); }if(i+2==temp && j-1==temp2){ st.push("LL"); }if(i == temp && j-2==temp2){ st.push("L"); } } while(!st.isEmpty()){ System.out.print(st.pop() + " "); } } } static class Pair implements Comparable{ int a; int b; Pair(){ } Pair(int a,int b) { this.a = a; this.b = b; } public boolean equals(Object o) { Pair p = (Pair)o; return p.a==a && p.b==b; } public int compareTo(Pair p){ if(p.b == this.b){ return Integer.compare(this.a,p.a); }else{ return Integer.compare(p.b,this.b); } } public int hashCode() { return new Long(a).hashCode()*31 + new Long(a).hashCode(); } } }