import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { if(Math.abs(i_start-i_end)%2 != 0){ System.out.println("Impossible"); return; } int count = 0; count += Math.abs(i_start-i_end)/2; int diffc = Math.abs(j_start-j_end); if(diffc > count){ diffc -= count; if (diffc%2!=0){ System.out.println("Impossible"); return; }else{ count += diffc/2; } }else if (diffc < count){ diffc = count - diffc; if (diffc%2!=0){ System.out.println("Impossible"); return; } } System.out.println(count); System.out.println(buildPath(i_start, j_start, i_end, j_end)); } public static String buildPath(int i_start, int j_start, int i_end, int j_end){ int i = i_start; int j = j_start; String ret = ""; HashMap frequency = new HashMap(); frequency.put("UL ",0); frequency.put("UR ",0); frequency.put("LL ",0); frequency.put("LR ",0); frequency.put("L ",0); frequency.put("R ",0); while (i != i_end || j != j_end){ if(i > i_end){ if(j > j_end){ //ret += "UL "; frequency.put("UL ",frequency.get("UL ")+1); i-=2; j-=1; }else{ //ret += "UR "; frequency.put("UR ",frequency.get("UR ")+1); i-=2; j+=1; } }else if (i < i_end){ if(j > j_end){ //ret += "LL "; frequency.put("LL ",frequency.get("LL ")+1); i+=2; j-=1; }else{ //ret += "LR "; frequency.put("LR ",frequency.get("LR ")+1); i+=2; j+=1; } }else{ if(j > j_end){ //ret += "L "; frequency.put("L ",frequency.get("L ")+1); j-=2; }else{ //ret += "R "; frequency.put("R ",frequency.get("R ")+1); j+=2; } } } //UL, UR, R, LR, LL, L. ret+= repeatVal("UL ",frequency.get("UL ")); ret+= repeatVal("UR ",frequency.get("UR ")); ret+= repeatVal("R ",frequency.get("R ")); ret+= repeatVal("LR ",frequency.get("LR ")); ret+= repeatVal("LL ",frequency.get("LL ")); ret+= repeatVal("L ",frequency.get("L ")); return ret; } public static String repeatVal(String s, int n){ String ret = ""; for (int q =0 ; q < n; q++){ ret += s; } return ret; } 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(); } }