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. int i_result = i_start - i_end; int j_result = j_start - j_end; int i_current = i_start; int j_current = j_start; string answer = ""; int count = 0; if (i_result < 0){ i_result = -i_result; } if (j_result < 0){ j_result = -j_result; } if ((i_start + i_end) % 2 == 1){ Console.WriteLine("Impossible"); return; } else if (i_result % 4 != 0 && j_result % 2 == 0){ Console.WriteLine("Impossible"); return; } while(i_current != i_end || j_current != j_end){ if ((i_end < i_current && j_end < j_current) || (i_end < i_current && j_end == j_current)){ i_current -= 2; j_current--; answer += "UL "; } else if((i_end < i_current && j_end > j_current) ){ i_current -= 2; j_current++; answer += "UR "; } else if (i_end == i_current && j_end > j_current){ j_current += 2; answer += "R "; } else if ((i_end > i_current && j_end > j_current)|| (i_end > i_current && j_end == j_current)){ i_current += 2; j_current++; answer += "LR "; } else if (i_end > i_current && j_end < j_current){ i_current += 2; j_current--; answer += "LL "; } else if (i_end == i_current && j_end < j_current){ j_current -= 2; answer += "L "; } count++; } Console.WriteLine(count); Console.WriteLine(answer); } 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); } }