import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { //creating moves UL, UR, R, LR, LL, L 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. String path =""; int i_move = i_start; int j_move = j_start; int moveCounter = 0; while(true){ if(i_move==i_end && j_move==j_end){ break; } else if(i_move<0 || j_move<0 || i_move>n || j_move>n || moveCounter > n/2){ System.out.println("Impossible"); return; } moveCounter++; if(i_movei_end && j_move>j_end || i_move>i_end && j_move==j_end){ i_move-=2; j_move--; //System.out.println("Entered ul"); path = path.concat("UL "); } else if(i_move==i_end && j_movej_end){ j_move-=2; //System.out.println("Entered l"); path = path.concat("L "); } else if(i_move>i_end && j_movej_end){ i_move+=2; j_move--; //System.out.println("Entered ll"); path = path.concat("LL "); } //System.out.println(i_move+":"+j_move); } System.out.println(moveCounter); System.out.println(path); } 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(); } }