import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int DIM; static Integer[][] DISTS; static String[][] MOVES; static void printShortestPath(int i, int j, int i_end, int j_end, int distance, String moveTo) { if (i < 0 || i >= DIM || j < 0 || j >= DIM) { return; } // Check distances if (DISTS[i][j] != null && distance >= DISTS[i][j]) { return; } DISTS[i][j] = distance; MOVES[i][j] = moveTo; printShortestPath(i - 2, j - 1, i_end, j_end, distance + 1, "UL"); printShortestPath(i - 2, j + 1, i_end, j_end, distance + 1, "UR"); printShortestPath(i, j + 2, i_end, j_end, distance + 1, "R"); printShortestPath(i + 2, j + 1, i_end, j_end, distance + 1, "LR"); printShortestPath(i + 2, j - 1, i_end, j_end, distance + 1, "LL"); printShortestPath(i, j - 2, i_end, j_end, distance + 1, "L"); } static void dump() { for (int i = 0; i < DIM; i++) { for (int j = 0; j < DIM; j++) { System.out.print(MOVES[i][j] + " "); } System.out.println(""); } } public static void main(String[] args) { Scanner in = new Scanner(System.in); DIM = in.nextInt(); DISTS = new Integer[DIM][DIM]; MOVES = new String[DIM][DIM]; int i_start = in.nextInt(); int j_start = in.nextInt(); int i_end = in.nextInt(); int j_end = in.nextInt(); printShortestPath(i_start, j_start, i_end, j_end, 0, null); Integer dist = DISTS[i_end][j_end]; if (dist == null) { System.out.println("Impossible"); } else { System.out.println(dist); printChain(i_end, j_end); } in.close(); } private static void printChain(int i, int j) { Stack elems = new Stack<>(); while (MOVES[i][j] != null) { final String move = MOVES[i][j]; elems.add(move); switch (move) { case "UL": i += 2; j += 1; break; case "UR": i += 2; j -= 1; break; case "LL": i -= 2; j += 1; break; case "LR": i -= 2; j -= 1; break; case "L": j += 2; break; case "R": j -= 2; break; default: System.out.println("Nothing"); } } while(!elems.isEmpty()) { System.out.print(elems.pop() + " "); } System.out.println(""); } }