#!/bin/python import sys def printShortestPath(n, i_start, j_start, i_end, j_end): if abs(i_start-i_end)%2 != 0 or (j_start+abs(i_start-i_end)/2-j_end)%2 !=0: print("Impossible") elif i_start < 0 or i_end < 0 or j_start < 0 or j_end <0 or i_start>=n or i_end>=n or j_start>=n or j_end>=n or n<=0: print("Impossible") else: deplacements=abs(i_end-i_start)/2 string="" tot=[] up=[] down=[] right=[] left=[] posj = j_start ny = 0 if i_start > i_end: up = ["U"]*((i_start-i_end)/2) elif i_start < i_end: down = ["L"]*((i_end-i_start)/2) if j_start+abs(i_start-i_end)/2 < j_end: right = ["R"]*((j_end-(j_start+abs(i_start-i_end)/2))/2) deplacements+=(j_end-(j_start+abs(i_start-i_end)/2))/2 elif j_start-abs(i_start-i_end)/2 > j_end: left = ["L"]*((j_start-abs(i_start-i_end)/2-j_end)/2) deplacements+=(j_start-abs(i_start-i_end)/2-j_end)/2 count = len(up) for i in range(len(up)): if posj+count > j_end and posj!=0: up[i]=up[i]+"L" posj-=1 else: up[i]=up[i]+"R" posj+=1 count-=1 count = len(down) for ii in range(len(down)): if posj-count < j_end and posj!=(n-1): down[ii]=down[ii]+"R" posj+=1 else: down[ii]=down[ii]+"L" posj-=1 count-=1 tot = up+right+down+left for t in tot: if string!="": string+=" " string+=t print deplacements print string if __name__ == "__main__": n = int(raw_input().strip()) i_start, j_start, i_end, j_end = raw_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)