import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static int[][] DELTAS = new int[][] {{-2, -1}, {-2, 1}, {0, 2}, {2, 1}, {2, -1}, {0, -2}}; public static String[] MOVES = new String[] { "UL", "UR", "R", "LR", "LL", "L"}; public static class Parent { public String move; public int[] parent; public Parent(String move, int[] parent) { this.move = move; this.parent = parent; } } static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { LinkedList queue = new LinkedList<>(); boolean[][] visited = new boolean[n][n]; Parent[][] parents = new Parent[n][n]; queue.offer(new int[] {i_start, j_start}); visited[i_start][j_start] = true; while (!queue.isEmpty()) { int[] pos = queue.poll(); if (pos[0] == i_end && pos[1] == j_end) { break; } for (int i = 0; i < DELTAS.length; i++) { offer(queue, n, pos, DELTAS[i], MOVES[i], visited, parents); } } if (visited[i_end][j_end]) { int[] pos = new int[] { i_end, j_end }; int moves = 0; LinkedList path = new LinkedList<>(); while (parents[pos[0]][pos[1]] != null) { path.addFirst(parents[pos[0]][pos[1]].move); pos = parents[pos[0]][pos[1]].parent; moves++; } System.out.println(moves); for (String move : path) { System.out.print(move); System.out.print(" "); } System.out.println(); } else { System.out.println("Impossible"); } } static void offer(LinkedList queue, int n, int[] pos, int[] delta, String move, boolean[][] visited, Parent[][] parents) { int[] next = new int[] {pos[0] + delta[0], pos[1] + delta[1]}; if (next[0] >= 0 && next[0] < n && next[1] >= 0 && next[1] < n && !visited[next[0]][next[1]]) { visited[next[0]][next[1]] = true; parents[next[0]][next[1]] = new Parent(move, pos); queue.offer(next); } } 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(); } }