import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { private static class Node { final private int i, j; final private int d; final private int move; final Node parent; private Node(int i, int j, Node parent, int move) { this.i = i; this.j = j; this.parent = parent; this.move = move; this.d = parent == null ? 0 : (parent.d + 1); } } private static boolean isValid(int i, int j, int n) { if (i < 0 || j < 0) return false; if (i >= n || j >= n) return false; return true; } public static void main(String[] args) { int[] moves = new int[] { -2, -1, -2, +1, 0, +2, +2, +1, +2, -1, 0, -2 }; String[] names = new String[] { "UL", "UR", "R", "LR", "LL", "L" }; try (Scanner in = new Scanner(System.in)) { int n = in.nextInt(); Node[][] b = new Node[n][n]; int is = in.nextInt(); int js = in.nextInt(); int ie = in.nextInt(); int je = in.nextInt(); Queue queue = new LinkedList<>(); queue.add(new Node(is, js, null, 0)); while (!queue.isEmpty()) { Node node = queue.poll(); if (node.i == ie && node.j == je) break; for (int m = 0; m < moves.length; m += 2) { int i = node.i + moves[m + 0]; int j = node.j + moves[m + 1]; if (isValid(i, j, n) && b[i][j] == null) queue.add(b[i][j] = new Node(i, j, node, m / 2)); } } if (b[ie][je] == null) System.out.println("Impossible"); else { System.out.println(b[ie][je].d); Stack path = new Stack<>(); Node p = b[ie][je]; while (p != null) { path.push(p); p = p.parent; } path.pop(); StringJoiner sj = new StringJoiner(" "); while (!path.isEmpty()) sj.add(names[path.pop().move]); System.out.println(sj.toString()); } } } }