import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static class Point { int row; int col; public Point(int row, int col) { this.row = row; this.col = col; } } static class Node { Point point; int depth; public Node(Point point, int depth) { this.point = point; this.depth = depth; } } public static void main(String[] arg) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] scan = br.readLine().split(" "); Point s = new Point(Integer.parseInt(scan[0]), Integer.parseInt(scan[1])); Point d = new Point(Integer.parseInt(scan[2]), Integer.parseInt(scan[3])); boolean[][] unvisited = new boolean[n][n]; Point[][] parent = new Point[n][n]; for (int i = 0; i < n; i++) { Arrays.fill(unvisited[i], true); } Queue q = new LinkedList<>(); q.add(new Node(s, 0)); unvisited[s.row][s.col] = false; parent[s.row][s.col] = s; Point found = null; int depth = -1; while (!q.isEmpty()) { Node u = q.remove(); //UL if (u.point.row - 2 >= 0 && u.point.col - 1 >= 0 && unvisited[u.point.row - 2][u.point.col - 1]) { parent[u.point.row - 2][u.point.col - 1] = u.point; if (u.point.row - 2 == d.row && u.point.col - 1 == d.col) { found = new Point(u.point.row - 2, u.point.col - 1); depth = u.depth + 1; break; } q.add(new Node(new Point(u.point.row - 2, u.point.col - 1), u.depth + 1)); unvisited[u.point.row - 2][u.point.col - 1] = false; } //UR if (u.point.row - 2 >= 0 && u.point.col + 1 < n && unvisited[u.point.row - 2][u.point.col + 1]) { parent[u.point.row - 2][u.point.col + 1] = u.point; if (u.point.row - 2 == d.row && u.point.col + 1 == d.col) { found = new Point(u.point.row - 2, u.point.col + 1); depth = u.depth + 1; break; } q.add(new Node(new Point(u.point.row - 2, u.point.col + 1), u.depth + 1)); unvisited[u.point.row - 2][u.point.col + 1] = false; } //R if (u.point.col + 2 < n && unvisited[u.point.row][u.point.col + 2]) { parent[u.point.row][u.point.col + 2] = u.point; if (u.point.row == d.row && u.point.col + 2 == d.col) { found = new Point(u.point.row, u.point.col + 2); depth = u.depth + 1; break; } q.add(new Node(new Point(u.point.row, u.point.col + 2), u.depth + 1)); unvisited[u.point.row][u.point.col + 2] = false; } //LR if (u.point.row + 2 < n && u.point.col + 1 < n && unvisited[u.point.row + 2][u.point.col + 1]) { parent[u.point.row + 2][u.point.col + 1] = u.point; if (u.point.row + 2 == d.row && u.point.col + 1 == d.col) { found = new Point(u.point.row + 2, u.point.col + 1); depth = u.depth + 1; break; } q.add(new Node(new Point(u.point.row + 2, u.point.col + 1), u.depth + 1)); unvisited[u.point.row + 2][u.point.col + 1] = false; } //LL if (u.point.row + 2 < n && u.point.col - 1 >= 0 && unvisited[u.point.row + 2][u.point.col - 1]) { parent[u.point.row + 2][u.point.col - 1] = u.point; if (u.point.row + 2 == d.row && u.point.col - 1 == d.col) { found = new Point(u.point.row + 2, u.point.col - 1); depth = u.depth + 1; break; } q.add(new Node(new Point(u.point.row + 2, u.point.col - 1), u.depth + 1)); unvisited[u.point.row + 2][u.point.col - 1] = false; } //L if (u.point.col - 2 >= 0 && unvisited[u.point.row][u.point.col - 2]) { parent[u.point.row][u.point.col - 2] = u.point; if (u.point.row == d.row && u.point.col - 2 == d.col) { found = new Point(u.point.row, u.point.col - 2); depth = u.depth + 1; break; } q.add(new Node(new Point(u.point.row, u.point.col - 2), u.depth + 1)); unvisited[u.point.row][u.point.col - 2] = false; } } if (found == null) { System.out.println("Impossible"); } else { System.out.println(depth); printPath(parent, s, d, d); } } static void printPath(Point[][] parent, Point s, Point d, Point cur) { if (cur.row == s.row && cur.col == s.col) { return; } printPath(parent, s, d, parent[cur.row][cur.col]); System.out.print(step(cur, parent[cur.row][cur.col])+" "); } static String step(Point cur, Point parent) { //UL if (parent.row - 2 == cur.row && parent.col - 1 == cur.col) { return "UL"; } //UR if (parent.row - 2 == cur.row && parent.col + 1 ==cur.col) { return "UR"; } //R if (parent.col + 2 ==cur.col && parent.row==cur.row) { return "R"; } //LR if (parent.row + 2 ==cur.row && parent.col + 1 ==cur.col) { return "LR"; } //LL if (parent.row + 2 ==cur.row && parent.col - 1 == cur.col) { return "LL"; } //L if (parent.col - 2 == cur.col && parent.row==cur.row) { return "L"; } return ""; } }