#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): if ((i_start % 2) != (i_end % 2)): print("Impossible") elif (i_start % 4 == i_end % 4) and (j_start % 2 != j_end % 2): print("Impossible") elif (i_start % 4 != i_end % 4) and (j_start % 2 == j_end % 2): print("Impossible") else: numMoves = 0 moveStr = "" while ((i_start != i_end) or (j_start != j_end)): #print("Current position:" + str(i_start) + " " + str(j_start)) if (((i_start - i_end) > max(((j_end - j_start)*2),0)) and (j_start > 0)): moveStr+="UL " i_start-=2 j_start-=1 elif ((i_start > i_end) and (j_start >= j_end) and (j_start > 0)): moveStr+="UL " i_start-=2 j_start-=1 elif ((i_start > i_end) and (j_start <= j_end)) and (j_start < (n-1)): moveStr+="UR " i_start-=2 j_start+=1 elif (j_end > j_start) and (((j_end - j_start)*2) > (i_end - i_start)) and (j_start < (n-2)): moveStr+="R " j_start+=2 elif (((i_end - i_start) > max(((j_start - j_end)*2),0)) and (j_start < (n-1))): moveStr+="LR " i_start+=2 j_start+=1 elif ((i_start < i_end) and (j_start <= j_end) and (j_start < (n-1))): moveStr+="LR " i_start+=2 j_start+=1 elif ((i_start < i_end) and (j_start >= j_end)) and (j_start > 0): moveStr+="LL " i_start+=2 j_start-=1 elif ((i_start == i_end) and (j_start > j_end)) and (j_start > 1): moveStr+="L " j_start-=2 numMoves+=1 #print("Ending position:" + str(i_start) + " " + str(j_start)) print(numMoves) print(moveStr.strip()) if __name__ == "__main__": n = int(input().strip()) i_start, j_start, i_end, j_end = input().strip().split(' ') i_start, j_start, i_end, j_end = [int(i_start), int(j_start), int(i_end), int(j_end)] printShortestPath(n, i_start, j_start, i_end, j_end)