import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; class Cell{ int x; int y; int dis; String direc; public Cell(int x, int y, int dis, String direc) { this.x= x; this.y = y; this.dis = dis; this.direc = direc; } } public class Solution { static boolean isInside(int x, int y, int n) { if(x >=0 && x=0 && y hm = new HashMap<>(); hm.put(0, "UL"); hm.put(1,"UR"); hm.put(2, "R"); hm.put(3, "LR"); hm.put(4, "LL"); hm.put(5, "L"); int flag = 1; Queue q = new LinkedList<>(); q.add(new Cell(xst, yst, 0, "") ); Cell t; int x, y; boolean v[][] = new boolean[n][n]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) v[i][j] = false; v[xst][yst] = true; while(!q.isEmpty()) { t= q.remove(); // v[t.x][t.y] = true; // System.out.println(t.x + "m" + t.y + "y"); if (t.x == xend && t.y == yend) { System.out.println(t.dis); flag = 0; System.out.println(t.direc); break; } for(int i = 0;i<6;i++) { x= t.x + dx[i]; y = t.y + dy[i]; if(isInside(x,y,n) && !v[x][y]) { // System.out.println(x+ " "+ y+ "pushed"); v[x][y] = true; String dir = hm.get(i); // System.out.println(x+ " "+ y+ "pushed" + dir); q.add(new Cell(x,y, t.dis + 1, t.direc + dir+ " ")); } } } if(flag == 1) { System.out.println("Impossible"); } } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int yst = in.nextInt(); int xst = in.nextInt(); int yend = in.nextInt(); int xend = in.nextInt(); printShortestPath(n, xst, yst, xend, yend); in.close(); } }