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 i = i_start; int j = j_start; float bestDistance = 0; String turnName = "UL"; String allTurns = ""; int count = 0; boolean impossible = false; do { bestDistance = Float.MAX_VALUE; int i2 = 0; int j2 = 0; //This is just a simple estimate if (count > n * 2) { impossible = true; break; } //UL if (getDistance(i - 2, j - 1, i_end, j_end) < bestDistance) { turnName = "UL"; bestDistance = getDistance(i - 2, j - 1, i_end, j_end); i2 = i - 2; j2 = j - 1; } //UR if (getDistance(i - 2, j + 1, i_end, j_end) < bestDistance) { turnName = "UR"; bestDistance = getDistance(i - 2, j + 1, i_end, j_end); i2 = i - 2; j2 = j + 1; } //R if (getDistance(i, j + 2, i_end, j_end) < bestDistance) { turnName = "R"; bestDistance = getDistance(i, j + 2, i_end, j_end); i2 = i; j2 = j + 2; } //LR if (getDistance(i + 2, j + 1, i_end, j_end) < bestDistance) { turnName = "LR"; bestDistance = getDistance(i + 2, j + 1, i_end, j_end); i2 = i + 2; j2 = j + 1; } //LL if (getDistance(i + 2, j - 1, i_end, j_end) < bestDistance) { turnName = "LL"; bestDistance = getDistance(i + 2, j - 1, i_end, j_end); i2 = i + 2; j2 = j - 1; } //L if (getDistance(i, j - 2, i_end, j_end) < bestDistance) { turnName = "L"; bestDistance = getDistance(i, j - 2, i_end, j_end); i2 = i; j2 = j - 2; } count = count + 1; allTurns = allTurns + turnName + " "; i = i2; j = j2; } while (i != i_end || j != j_end); if (impossible == false) { System.out.println(count); System.out.println(allTurns); } 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(); } public static float getDistance(int p0_x, int p0_y, int p1_x, int p1_y) { float distance = (p0_x - p1_x) * (p0_x - p1_x) + (p0_y - p1_y) * (p0_y - p1_y); return distance; } }