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 (Math.abs(i_end - i_start) % 2 == 1) { System.out.println("Impossible"); return; } if ((Math.abs(i_end - i_start) / 2 + Math.abs(j_end - j_start)) % 2 == 1) { System.out.println("Impossible"); return; } int i = i_start; int j = j_start; List steps = new ArrayList<>(); while (i != i_end || j != j_end) { if (i > i_end && j >= j_end && i >= 2 && j >= 1) { i-=2; j-=1; //sb.append("UL "); steps.add(0); } else if (i > i_end && j <= j_end && i >= 2 && j <= n - 2) { i-=2; j+=1; //sb.append("UR "); steps.add(1); } else if (i == i_end && j < j_end && j <= n - 3) { j+=2; //sb.append("R "); steps.add(2); } else if (i < i_end && j <= j_end && i <= n -3 && j <=n-2) { i+=2; j+=1; //sb.append("LR "); steps.add(3); } else if (i < i_end && j >= j_end && i<=n-3 && j>=1) { i+=2; j-=1; //sb.append("LL "); steps.add(4); } else if (i == i_end && j > j_end && j>=2) { j-=2; //sb.append("L "); steps.add(5); } } System.out.println(steps.size()); StringBuilder sb = new StringBuilder(); Collections.sort(steps); for (int step : steps) { switch(step) { case 0: sb.append("UL "); break; case 1: sb.append("UR "); break; case 2: sb.append("R "); break; case 3: sb.append("LR "); break; case 4: sb.append("LL "); break; case 5: sb.append("L "); break; } } sb.setLength(sb.length() - 1); System.out.println(sb.toString()); } 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(); } }