using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; 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. string path = ""; if (Math.Abs(i_start - i_end) % 2 == 1) { path = "Impossible"; } else { int yMove = i_start - i_end; int xMove = j_end - j_start; int crossMove = Math.Abs(yMove / 2); for (int i = 0; i < crossMove; i++) { if (yMove > 0) { if (xMove >= 0) { path += "UR "; xMove--; } else { path += "UL "; xMove++; } } else { if (xMove >= 0) { path += "LR "; xMove--; } else { path += "LL "; xMove++; } } } if (Math.Abs(xMove) % 2 == 1) { path = "Impossible"; } else { for (int i = 0; i < Math.Abs(xMove) / 2; i++) { if (xMove>0) { path += "R "; } else { path += "L "; } } } } if(path != "Impossible") Console.WriteLine(Regex.Matches(path, " ").Count); Console.WriteLine(path); } 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); } }