import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static class Node { int x; int y; int distance; String path = ""; public Node(int x, int y, int distance, String path) { this.x = x; this.y = y; this.distance = distance; this.path = path; } public boolean equals(Node node) { return (this.x == node.x && this.y == node.y); } } static boolean insideTheBoard(int n, int x, int y) { return x >= 0 && x < n && y >= 0 && y < n; } 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. if(!insideTheBoard(n, i_start, j_start) || !insideTheBoard(n, i_end, j_end) ) { System.out.print("Impossible"); } else { int dx[] = {-2, -2, 0, 2, 2, 0}, dy[] = {-1, 1, 2, 1, -1, -2}; String moves[] = {"UL", "UR", "R", "LR", "LL", "L"}; boolean[][] visited = new boolean[n][n]; Node startNode = new Node(i_start, j_start, 0, ""); Node endNode = new Node(i_end, j_end, 0, ""); Queue queue = new LinkedList<>(); queue.add(startNode); visited[startNode.x][startNode.y] = true; boolean solutionFound = false; while(!queue.isEmpty()) { Node currentNode = queue.poll(); if(currentNode.equals(endNode)) { solutionFound = true; System.out.println(currentNode.distance); System.out.println(currentNode.path); } else { for(int i = 0; i < 6; i++) { int newX = currentNode.x + dx[i]; int newY = currentNode.y + dy[i]; if(insideTheBoard(n, newX, newY) && !visited[newX][newY]) { visited[newX][newY] = true; queue.add(new Node(newX, newY, currentNode.distance + 1, currentNode.path.isEmpty() ? moves[i] : currentNode.path + " " + moves[i])); } } } } if(!solutionFound) { System.out.print("Impossible"); } } } 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(); } }