import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import java.util.stream.IntStream; public class Solution { private static final int MAXN = 201; private static final int[][] delta = {{-2,1}, {-2, -1},{0, 2}, {2, 1}, {2, -1}, {0, -2}}; static int N; private static class Position { int cost; int px, py; }; static Position[][] grid = new Position[MAXN][MAXN]; private static void solve(final int cost, final int x, final int y) { Position pp; IntStream.range(0, 6).forEach( i -> { int xx = x + delta[i][0]; int yy = y + delta[i][1]; if(xx >= 0 && yy >= 0 && xx < N && yy < N) { if(cost + 1 < grid[xx][yy].cost) { grid[xx][yy].cost = cost + 1; grid[xx][yy].px = x; grid[xx][yy].py = y; solve(grid[xx][yy].cost, xx, yy); } } }); } // x -> L or R // y -> U or L(if pos -> L) public static void printRec(int x, int y, int xx, int yy){ if(x != xx || y != yy) { // System.out.println(grid[x][y].px +" "+ grid[x][y].py +" "+x+" "+y); printRec(grid[x][y].px, grid[x][y].py, xx, yy); if(grid[x][y].px != xx && grid[x][y].py != yy) System.out.print(" "); if(grid[x][y].px - x == 0) { if(grid[x][y].py - y > 0) System.out.print("L"); else System.out.print("R"); } else if(grid[x][y].px - x > 0) { if(grid[x][y].py - y > 0) System.out.print("UL"); else System.out.print("UR"); } else { if(grid[x][y].py - y > 0) System.out.print("LL"); else System.out.print("LR"); } } } 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. grid[i_start][j_start].px = i_start; grid[i_start][j_start].py = j_start; solve(0, i_start, j_start); if(grid[i_end][j_end].cost == Integer.MAX_VALUE) { System.out.println("Impossible"); } else { System.out.println(grid[i_end][j_end].cost); printRec(i_end, j_end, i_start, j_start); } } //init static void init(){ IntStream.range(0, MAXN).forEach( i -> { IntStream.range(0, MAXN).forEach( j -> { grid[i][j] = new Position(); grid[i][j].cost = Integer.MAX_VALUE; } ); } ); } public static void main(String[] args) { Scanner in = new Scanner(System.in); N = in.nextInt(); int i_start = in.nextInt(); int j_start = in.nextInt(); int i_end = in.nextInt(); int j_end = in.nextInt(); init(); printShortestPath(N, i_start, j_start, i_end, j_end); in.close(); } }