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) { ArrayList a = new ArrayList(); int c=0; int temp_i = i_start,temp_j =j_start; while(temp_i != i_end){ if(temp_i > i_end){ if (temp_j > j_end) { temp_i = temp_i-2; temp_j = temp_j-1; if((temp_i < 0)||(temp_j < 0)){ System.out.println("Impossible"); return ; } else { c++; a.add("UL"); } } else{ if ((temp_j < j_end) || (temp_j == j_end) ){ temp_i = temp_i-2; temp_j = temp_j+1; if((temp_i < 0) ||(temp_j >= n)){ System.out.println("Impossible"); return ; } else{ c++; a.add("UR"); } } } } if (temp_i < i_end){ if (temp_j > j_end) { temp_i = temp_i+2; temp_j = temp_j-1; if((temp_i >= n)||(temp_j < 0)){ System.out.println("Impossible"); return ; } else{ c++; a.add("LL"); } } else{ if ((temp_j < j_end )|| (temp_j == j_end)) { temp_i = temp_i+2; temp_j = temp_j+1; if((temp_i >= n)||(temp_j >= n)){ System.out.println("Impossible"); return ; } else{ c++; a.add("LR"); } } } } if (temp_i == i_end) { if (temp_j > j_end) { temp_i = temp_i; temp_j = temp_j-2; if(temp_j < 0){ System.out.println("Impossible"); return ; } else{ c++; a.add("L"); } } else{ if (temp_j < j_end) { temp_i = temp_i; temp_j = temp_j+2; if(temp_j >= n){ System.out.println("Impossible"); return ; } else { c++; a.add("R"); } } } } } System.out.println(c); Object[] objects = a.toArray(); for (Object obj : objects){ System.out.print(obj+ " "); } } 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(); } }