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. if((i_start - i_end) % 2 != 0){ System.out.println("Impossible"); return; } int gain = (Math.abs(i_start-i_end) + Math.abs(j_start-j_end)); int ind_row[] = {-2, -2, 0, 2, 2, 0}; int ind_col[] = {-1, 1, 2, 1, -1, -2}; String moves[] = {"UL", "UR", "R", "LR", "LL", "L"}; int i_curr = i_start, j_curr = j_start, new_gain; int save_i = 0; //String curr_move = ""; boolean changed = true; ArrayList my_moves = new ArrayList(); while(changed){ changed = false; for(int i = 0; i < 6; i++){ i_curr = i_start + ind_row[i]; j_curr = j_start + ind_col[i]; if(i_curr >= n || i_curr < 0){ continue; } if(j_curr >= n || j_curr < 0){ continue; } new_gain = Math.abs(i_curr-i_end) + Math.abs(j_curr-j_end); if (gain > new_gain) { gain = new_gain; //curr_move = moves[i]; save_i = i; changed = true; } } if(changed){ i_start = i_start + ind_row[save_i]; j_start = j_start + ind_col[save_i]; my_moves.add(moves[save_i]); } //System.out.println(gain + ", " + i_start + ", " + j_start); } if(gain == 0){ System.out.println(my_moves.size()); for(int i = 0; i < my_moves.size(); i++){ System.out.print(my_moves.get(i) + " "); } System.out.println(); }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(); } }