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. bool upperLeft, upperRight, lowerLeft, lowerRight, left, right; List moveSeq = new List(); while (!(i_start == i_end && j_start == j_end)) { upperLeft = false; upperRight = false; left = false; right = false; lowerLeft = false; lowerRight = false; if (i_start - i_end >= 2) { if (j_start - j_end >= 1) upperLeft = true; else upperRight = true; } else if (i_end - i_start >= 2) { if (j_start - j_end >= 1) lowerLeft = true; else lowerRight = true; } else if (j_start - j_end >= 2) left = true; else if (j_end - j_start >= 2) right = true; if (upperLeft) { moveSeq.Add("UL"); i_start -= 2; j_start -= 1; } else if (upperRight) { moveSeq.Add("UR"); i_start -= 2; j_start += 1; } else if (lowerLeft) { moveSeq.Add("LL"); i_start += 2; j_start -= 1; } else if (lowerRight) { moveSeq.Add("LR"); i_start += 2; j_start += 1; } else if (left) { moveSeq.Add("L"); j_start -= 2; } else if (right) { moveSeq.Add("R"); j_start += 2; } else { Console.Write("Impossible"); return; } } Console.WriteLine(moveSeq.Count); Console.Write(string.Join(" ", moveSeq)); } 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); } }