using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; class Solution { static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int iCurrent = i_start; int jCurrent = j_start; int verticalMovement = i_start - i_end; if (verticalMovement % 2 != 0) { Console.WriteLine("Impossible"); return; } int numberOfMoves = 0; StringBuilder moveList = new StringBuilder(); while (iCurrent != i_end || jCurrent != j_end) { numberOfMoves++; if (iCurrent < i_end) { iCurrent += 2; if (jCurrent <= j_end) { jCurrent += 1; moveList.Append("LR "); } else if (jCurrent > j_end) { jCurrent -= 1; moveList.Append("LL "); } } else if (iCurrent > i_end) { iCurrent -= 2; if (jCurrent <= j_end) { jCurrent += 1; moveList.Append("UR "); } else if (jCurrent > j_end) { jCurrent -= 1; moveList.Append("UL "); } } else { if (jCurrent < j_end) { jCurrent += 2; moveList.Append("R "); } else if (jCurrent > j_end) { jCurrent -= 2; moveList.Append("L "); } } } Console.WriteLine(numberOfMoves); Console.WriteLine(moveList.ToString().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); } }