import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end, int num, ArrayList moves) { // Print the distance along with the sequence of moves. int distH = j_start - j_end; int distV = i_start - i_end; if (distV % 2 == 1) { System.out.println("Impossible"); return; } //makes sure destination is not off board if ((i_start < 0 || j_start < 0 || i_end < 0 || j_end < 0) || (i_start >= n || j_start >= n || i_end >= n || j_end >= n)) { System.out.println("Impossible"); return; } if (moves == null) { moves = new ArrayList(); } //have to go up or down if (distV == 0 && distH == 0) { System.out.println(num); for (String cur: moves) { System.out.print(cur + " "); } return; } if (Math.abs(distV) >= 2) { if (distV > 0) { if (distH >= 0) { num++; moves.add("UL"); printShortestPath(n, i_start - 2, j_start - 1, i_end, j_end, num, moves); } else { num++; moves.add("UR"); printShortestPath(n, i_start - 2, j_start + 1, i_end, j_end, num, moves); } } else if (distV < 0) { if (distH > 0) { num++; moves.add("LL"); printShortestPath(n, i_start + 2, j_start - 1, i_end, j_end, num, moves); } else { num++; moves.add("LR"); printShortestPath(n, i_start + 2, j_start + 1, i_end, j_end, num, moves); } } } else { if (distH % 2 == 0) { if (distH < 0) { num++; moves.add("R"); printShortestPath(n, i_start, j_start + 2, i_end, j_end, num, moves); } else { num++; moves.add("L"); printShortestPath(n, i_start, j_start - 2, i_end, j_end, num, moves); } } } } 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, 0, null); in.close(); } }