import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { 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. Queue q = new LinkedList<>(); TreeNode root = new TreeNode(i_start, j_start, null, ""); q.add(root); TreeNode ans = null; boolean visited[][] = new boolean[n][n]; visited[i_start][j_start] = true; while(!q.isEmpty()) { TreeNode curr = q.poll(); int i = curr.x; int j = curr.y; visited[i][j] = true; if(i == i_end && j == j_end) { ans = curr; break; } if(i - 2 >= 0 && j - 1 >= 0 && !visited[i - 2][j - 1]) { TreeNode next = new TreeNode(i - 2, j - 1, curr, "UL"); q.add(next); } if(i - 2 >= 0 && j + 1 < n && !visited[i - 2][j + 1]) { TreeNode next = new TreeNode(i - 2, j + 1, curr, "UR"); q.add(next); } if(j + 2 < n && !visited[i][j + 2]) { TreeNode next = new TreeNode(i, j + 2, curr, "R"); q.add(next); } if(i + 2 < n && j + 1 < n && !visited[i + 2][j + 1]) { TreeNode next = new TreeNode(i + 2, j + 1, curr, "LR"); q.add(next); } if(i + 2 < n && j - 1 >= 0 && !visited[i + 2][j - 1]) { TreeNode next = new TreeNode(i + 2, j - 1, curr, "LL"); q.add(next); } if(j - 2 >= 0 && !visited[i][j - 2]) { TreeNode next = new TreeNode(i, j - 2, curr, "L"); q.add(next); } } if(ans == null) { System.out.println("Impossible"); } else { List list = new ArrayList<>(); while(ans != null) { list.add(ans.move); ans = ans.parent; } Collections.reverse(list); StringBuilder br = new StringBuilder(); for(String a : list) { br.append(a + " "); } System.out.println(list.size() - 1); System.out.println(br.toString().trim()); } } 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(); } } class TreeNode { int x; int y; TreeNode parent; String move; TreeNode(int x, int y, TreeNode p, String move) { this.x = x; this.y = y; this.parent = p; this.move = move; } public String toString() { return "[" + x + " , " + y + "]"; } }