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 solution = new ArrayList(); if ((i_start - i_end) % 2 != 0){ System.out.println("Impossible"); return; } else if (((Math.abs(i_start - i_end))/2 + (j_start - j_end) ) % 2 != 0) { System.out.println("Impossible"); return; } else { while ( i_start != i_end || j_start != j_end){ if (i_start >=n || j_start >=n){ System.out.print("Impossible"); return; } if (i_start > i_end){ if (j_start >= j_end) { solution.add("UL"); j_start--; i_start-=2; } else if (j_start < j_end) { solution.add("UR"); j_start++; i_start-=2; } } else if (i_start < i_end){ if (((Math.abs(i_start - i_end))/2 + j_start+2 ) <= j_end){ solution.add("R"); j_start+=2; } else if (j_start <= j_end) { solution.add("LR"); j_start++; i_start+=2; } else if (j_start > j_end) { solution.add("LL"); j_start--; i_start+=2; } } else { if (j_start > j_end) { solution.add("L"); j_start-=2; } else if (j_start < j_end) { solution.add("R"); j_start+=2; } } } } System.out.println(solution.size()); solution = srt(solution); for (int i = 0; i < solution.size();i++){ System.out.print(solution.get(i)); if (i != (solution.size()-1)) System.out.print(" ");} // Print the distance along with the sequence of moves. } static ArrayList srt(ArrayList s){ ArrayList result = new ArrayList(); for (int i = 0 ; i < s.size();i++){ if (s.get(i).equals("UL")){ result.add(s.get(i)); } } for (int i = 0 ; i < s.size();i++){ if (s.get(i).equals("UR")){ result.add(s.get(i)); } } for (int i = 0 ; i < s.size();i++){ if (s.get(i).equals("R")){ result.add(s.get(i)); } } for (int i = 0 ; i < s.size();i++){ if (s.get(i).equals("LR")){ result.add(s.get(i)); } } for (int i = 0 ; i < s.size();i++){ if (s.get(i).equals("LL")){ result.add(s.get(i)); } } for (int i = 0 ; i < s.size();i++){ if (s.get(i).equals("L")){ result.add(s.get(i)); } } return result; } 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(); } }