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 startRow, int startCol, int endRow, int endCol) { //Vertical movement can only ever be in increments of 2. If the vertical movement is not a multiple of 2 = impossible //Horizontal movement, once doing the vertical movement, must be a multiple of 2, otherwise = impossible int vertDistance = endRow-startRow; int horizontalDistance = endCol-startCol; int vertSteps = 0; int horizontalDistanceRemaining = 0; int horizontalSteps = 0; boolean isPossible = true; if(Math.abs(vertDistance) % 2 != 0){ isPossible = false; } else{ vertSteps = Math.abs(vertDistance)/2; horizontalDistanceRemaining = Math.abs(horizontalDistance) - vertSteps; if (horizontalDistance != 0){ if (horizontalDistanceRemaining % 2 != 0){ isPossible = false; } else{ horizontalSteps = horizontalDistanceRemaining/2; } } } if (isPossible){ System.out.println(vertSteps + horizontalSteps); if (horizontalDistance == 0){ //Handle the stacked config first if(vertDistance > 0){ for(int i = 0; i < vertSteps/2; i ++){ System.out.print("LR "); System.out.print("LL "); } } else{ for(int i = 0; i < vertSteps/2; i ++){ System.out.print("UR "); System.out.print("UL "); } } } else{ if(vertDistance > 0 && horizontalDistance > 0){ //Down && Right for(int i = 0; i < vertSteps; i ++){ System.out.print("LR "); } } else if(vertDistance < 0 && horizontalDistance > 0){ //Up && Right for(int i = 0; i < vertSteps; i ++){ System.out.print("UR "); } } else if(vertDistance > 0 && horizontalDistance < 0){ //Down && Left for(int i = 0; i < vertSteps; i ++){ System.out.print("LL "); } } else{ //Up && Left for(int i = 0; i < vertSteps; i ++){ System.out.print("UL "); } } if (horizontalDistance > 0){ for(int i = 0; i < horizontalSteps; i ++){ System.out.print("R "); } } else{ for(int i = 0; i < horizontalSteps; i ++){ System.out.print("L "); } } } } else{ System.out.println("Impossible"); } } 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(); } }