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. int id = Math.abs(i_start - i_end); int istepsCount = id >> 1; boolean eveniSteps = istepsCount << 1 == id; if (!eveniSteps){ System.out.println("Impossible"); return; } boolean evenjd = (istepsCount & 1) == 0; int jd = Math.abs(j_start - j_end); if (((jd & 1) == 0) != evenjd){ System.out.println("Impossible"); return; } int count = 0; String[] path = new String[id + jd]; if (istepsCount > jd){ int r = (j_end - j_start + istepsCount) >> 1; int l = istepsCount - r; count = istepsCount; if (i_start > i_end){ for (int i = 0; i < count; i++) { if (l > 0 && j_start > 0){ l--; j_start--; path[i] = "UL"; } else { r--; j_start++; path[i] = "UR"; } } } else { for (int i = 0; i < count; i++) { if (r > 0 && j_start + 1 < n){ r--; j_start++; path[i] = "LR"; } else { l--; j_start--; path[i] = "LL"; } } } } else { while(i_start != i_end || j_start != j_end){ if (i_start > i_end){ //go up if (j_start > j_end){ //go up left path[count++] = "UL"; i_start -=2; j_start--; } else if (j_start < j_end){ //go up right path[count++] = "UR"; i_start -=2; j_start++; } else { //same column, go up with left priority i_start -=2; if (j_start > 0){ //go up left cause can path[count++] = "UL"; j_start--; } else { //go up right path[count++] = "UR"; j_start++; } } } else if (i_start < i_end){ //go down if (j_start > j_end){ //go down left path[count++] = "LL"; i_start += 2; j_start--; } else if (j_start < j_end){ //go down right with right priority if ((j_end - j_start) << 1 > i_end - i_start){ //go down left path[count++] = "R"; j_start += 2; } else { path[count++] = "LR"; i_start += 2; j_start++; } } else { // same column, go down with right priority i_start +=2; if (j_start + 1 < n){ //go down right cause can path[count++] = "LR"; j_start++; } else { //go down left path[count++] = "LL"; j_start--; } } } else { //go horizontally if (j_start > j_end){ //go horizontally left path[count++] = "L"; j_start -= 2; } else { //go horizontally right path[count++] = "R"; j_start += 2; } } } } System.out.println(count); for (int i = 0; i < count; i++) { System.out.print(path[i]); System.out.print(' '); } } 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(); } }