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) { // Print the distance along with the sequence of moves. /* 7 6 6 0 1 4 UL UL UL L */ List moves = new ArrayList(); int ydif = i_start - i_end ; // 6-0 int xdif = j_start - j_end; // 6-1 int currentLocationX = j_start; int currentLocationY = i_start; // up and left are - while(ydif != 0 || xdif != 0) { //System.out.println("ydif :" + ydif + "xdif: " + xdif); if(ydif == 0) { // xdif can't be 0 here if(xdif % 2 != 0) { System.out.println("Impossible"); return; } else { if(xdif > 0) { int numberOfLefts = xdif / 2; for(int i = 0; i < numberOfLefts;i++) { moves.add("L"); } xdif = 0; } else { int numberOfRights = -xdif / 2; for(int i = 0; i < numberOfRights;i++) { moves.add("R"); } xdif = 0; } } } else if (xdif == 0) { if(ydif % 2 != 0) { System.out.println("Impossible"); return; } else { if(ydif > 0) { if(currentLocationX == n-1) { // UL currentLocationX--; currentLocationY-=2; ydif -= 2; xdif = -1; moves.add("UL"); } else { currentLocationX++; currentLocationY-=2; ydif -= 2; xdif = 1; moves.add("UR"); } } else { if(currentLocationX == n-1) { currentLocationX--; currentLocationY+=2; ydif += 2; xdif = -1; moves.add("LL"); } else { currentLocationX++; currentLocationY+=2; ydif += 2; xdif = 1; moves.add("LR"); } } } } else { int absXDifference = Math.abs(xdif); int absYDifference = Math.abs(ydif); int numberOfXRelatedMoves = absXDifference; int numberOfYRelatedMoves = absYDifference / 2; int maxMoves = Math.min(numberOfXRelatedMoves,numberOfYRelatedMoves); if(maxMoves == 0) { System.out.println("Impossible"); return; } if(ydif > 0 && xdif > 0) { // up and left ydif = ydif - maxMoves*2; xdif = xdif - maxMoves; currentLocationX = currentLocationX - maxMoves; currentLocationY = currentLocationY - maxMoves*2; //System.out.println("ydif :" + ydif + "xdif: " + xdif); for(int i = 0; i < maxMoves;i++) { moves.add("UL"); } } else if(ydif > 0 && xdif < 0) { ydif = ydif - maxMoves*2; xdif = xdif + maxMoves; currentLocationX = currentLocationX + maxMoves; currentLocationY = currentLocationY - maxMoves*2; for(int i = 0; i < maxMoves;i++) { moves.add("UR"); } } else if(ydif < 0 && xdif > 0) { ydif = ydif + maxMoves*2; xdif = xdif - maxMoves; currentLocationX = currentLocationX - maxMoves; currentLocationY = currentLocationY + maxMoves*2; for(int i = 0; i < maxMoves;i++) { moves.add("LL"); } } else { ydif = ydif + maxMoves*2; xdif = xdif + maxMoves; currentLocationX = currentLocationX + maxMoves; currentLocationY = currentLocationY + maxMoves*2; for(int i = 0; i < maxMoves;i++) { moves.add("LR"); } } } } System.out.println(moves.size()); for(int i = 0; i < moves.size();i++) { System.out.print(moves.get(i)+" "); } } 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(); } }