import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static final String[] MOVES = {"UL", "UR", "R", "LR", "LL", "L"}; static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int[][][] track = new int[n][n][4]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) Arrays.fill(track[i][j], -1); } Queue q = new ArrayDeque<>(36); q.add(new int[]{i_start, j_start}); track[i_start][j_start][3] = 0; while (!q.isEmpty()) { int[] cur = q.poll(); int curX = cur[0]; int curY = cur[1]; if (curX == i_end && curY == j_end) break; if (curX - 2 >= 0) { if (curY - 1 >= 0 && track[curX - 2][curY - 1][3] == -1) { q.add(new int[]{curX - 2, curY - 1}); track[curX - 2][curY - 1][0] = curX; track[curX - 2][curY - 1][1] = curY; track[curX - 2][curY - 1][2] = 0; track[curX - 2][curY - 1][3] = 0; } if (curY + 1 < n && track[curX - 2][curY + 1][3] == -1) { q.add(new int[]{curX - 2, curY + 1}); track[curX - 2][curY + 1][0] = curX; track[curX - 2][curY + 1][1] = curY; track[curX - 2][curY + 1][2] = 1; track[curX - 2][curY + 1][3] = 0; } } if (curY + 2 < n && track[curX][curY + 2][3] == -1) { q.add(new int[]{curX, curY + 2}); track[curX][curY + 2][0] = curX; track[curX][curY + 2][1] = curY; track[curX][curY + 2][2] = 2; track[curX][curY + 2][3] = 0; } if (curX + 2 < n) { if (curY + 1 < n && track[curX + 2][curY + 1][3] == -1) { q.add(new int[]{curX + 2, curY + 1}); track[curX + 2][curY + 1][0] = curX; track[curX + 2][curY + 1][1] = curY; track[curX + 2][curY + 1][2] = 3; track[curX + 2][curY + 1][3] = 0; } if (curY - 1 >= 0 && track[curX + 2][curY - 1][3] == -1) { q.add(new int[]{curX + 2, curY - 1}); track[curX + 2][curY - 1][0] = curX; track[curX + 2][curY - 1][1] = curY; track[curX + 2][curY - 1][2] = 4; track[curX + 2][curY - 1][3] = 0; } } if (curY - 2 >= 0 && track[curX][curY - 2][3] == -1) { q.add(new int[]{curX, curY - 2}); track[curX][curY - 2][0] = curX; track[curX][curY - 2][1] = curY; track[curX][curY - 2][2] = 5; track[curX][curY - 2][3] = 0; } } if (track[i_end][j_end][0] == -1) { System.out.println("Impossible"); } else { int x = i_end; int y = j_end; int moves = 0; List b = new ArrayList<>(128); do { moves++; b.add(MOVES[track[x][y][2]]); int x2 = track[x][y][0]; int y2 = track[x][y][1]; x = x2; y = y2; } while (track[x][y][0] != -1); System.out.println(moves); StringBuilder sb = new StringBuilder(128); for (int i = b.size() - 1; i >= 0; i--) sb.append(b.get(i)).append(" "); System.out.println(sb.toString()); } } 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(); } }