using System; using System.Collections.Generic; using System.IO; using System.Linq; 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_start - i_end) % 2 == 1 ){ Console.WriteLine("Impossible"); return; } if(Math.Abs(i_start - i_end) % 4 != 0 && Math.Abs(j_start - j_end) % 2 != 1) { Console.WriteLine("Impossible"); return; } string result = ""; int count = 0; do{ if(i_start < i_end) { i_start += 2; if(j_start < j_end) { j_start++; result += "LR "; } else if(j_start > j_end) { j_start--; result += "LL "; } else { if(j_start == n - 1) { result += "LL "; j_start--; } else { result += "LR "; j_start++; } } } else if(i_start > i_end) { i_start -= 2; if(j_start < j_end) { j_start++; result += "UR "; } else if(j_start > j_end) { j_start--; result += "UL "; } else { if(j_start == n - 1) { result += "UL "; j_start--; } else { result += "UR "; j_start++; } } } else { if(j_start < j_end) { j_start+=2; result += "R "; } else if(j_start > j_end) { j_start-=2; result += "L "; } else { break; } } count++; } while(i_start != i_end || j_start != j_end); Console.WriteLine(count); Console.WriteLine(result.Trim()); } static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] tokens_i_start = Console.ReadLine().Split(' '); int i_start = Convert.ToInt32(tokens_i_start[0]); int j_start = Convert.ToInt32(tokens_i_start[1]); int i_end = Convert.ToInt32(tokens_i_start[2]); int j_end = Convert.ToInt32(tokens_i_start[3]); printShortestPath(n, i_start, j_start, i_end, j_end); } }