n = int(raw_input()) x1,y1,x2,y2 = map(int,raw_input().split()) queue = [[[x1,y1],"",0]] visited = set([(x1,y1)]) goal_reached = False def getNextPosition(curr): nextPositions = [] if curr[0]-2 >= 0: # UL if curr[1]-1 >= 0 and (curr[0]-2,curr[1]-1) not in visited: nextPositions.append([[curr[0]-2,curr[1]-1],"UL"]) #UR if curr[1]+1 < n and (curr[0]-2,curr[1]+1) not in visited: nextPositions.append([[curr[0] - 2, curr[1] + 1], "UR"]) #R if curr[1]+2 < n and (curr[0],curr[1]+2) not in visited: nextPositions.append([[curr[0],curr[1]+2],"R"]) if curr[0]+2 < n: #LR if curr[1]+1=0 and (curr[0]+2,curr[1]-1) not in visited: nextPositions.append([[curr[0] + 2, curr[1] - 1], "LL"]) #L if curr[1]-2 >= 0 and (curr[0],curr[1]-2) not in visited: nextPositions.append([[curr[0],curr[1]-2],"L"]) return nextPositions while queue != []: #print "q",queue #print "visited",visited curr = queue[0][0] moves = queue[0][1] level = queue[0][2] for position,move in getNextPosition(curr): temp = [position,moves+move+" ",level+1] if position == [x2,y2]: print temp[2] print temp[1] goal_reached = True queue.append(temp) visited.update({tuple(position)}) if goal_reached: break del queue[0] if not goal_reached: print "Impossible"