import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static class Node{ int x; int y; String key; int color; int count = 0; String type; Node prev; Node(int x, int y){ this.x = x; this.y = y; this.key = x + "-"+y; } } private static Set set = new HashSet<>(); public static String solveKnight(int n, int i_start, int j_start, int i_end, int j_end){ //System.out.println("Solving knights"); Queue q = new LinkedList(); Node s = new Node(i_start, j_start); set.add(s.key); q.add(s); while(!q.isEmpty()){ Node u = (Node)q.peek(); //System.out.println("peeking: (" + u.x + ", " + u.y +") Count: " + u.count); for(Node node : getList(n, u.x, u.y)){ if(node.color == 0){ node.count = u.count +1; node.prev = u; if(node.x == i_end && node.y == j_end){ System.out.println(node.count); Node next = node; String res = ""; while(next.prev != null){ res = next.type + " " + res ; next = next.prev; } return res.trim(); } node.color = 1; q.add(node); } } q.poll(); u.color = 2; } return "Impossible"; } public static List getList(int n, int x, int y){ List nodeList = new ArrayList<>(); //UL if(x-2 > -1 && y-1 > -1){ Node node = new Node(x-2, y-1); node.type = "UL"; if(!set.contains(node.key)){ set.add(node.key); nodeList.add(node); } } //UR if(x -2 > -1 && y+1 < n){ Node node = new Node(x-2, y+1); node.type = "UR"; if(!set.contains(node.key)){ set.add(node.key); nodeList.add(node); } } //R if(y + 2 < n ){ Node node = new Node(x, y +2); node.type = "R"; if(!set.contains(node.key)){ set.add(node.key); nodeList.add(node); } } //LR if(x + 2 < n && y+1 < n){ Node node = new Node(x+2, y+1); node.type = "LR"; if(!set.contains(node.key)){ set.add(node.key); nodeList.add(node); } } //LL if(x + 2 < n && y-1 > -1){ Node node = new Node(x+2, y-1); node.type = "LL"; if(!set.contains(node.key)){ set.add(node.key); nodeList.add(node); } } //L if(y - 2 > -1 ){ Node node = new Node(x, y-2); node.type = "L"; if(!set.contains(node.key)){ set.add(node.key); nodeList.add(node); } } return nodeList; } 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(); System.out.println(solveKnight(n, i_start, j_start, i_end, j_end)); in.close(); } }