#!/bin/python import sys global minpath, minsteps def recursivestep(posx, posy, path,i_end, j_end, visited, n, minpath, minsteps): if len(path) > n: return if posx < 0 or posx > n-1 or posy < 0 or posy > n-1: return if (posx, posy) in visited: return if posx == i_end and posy == j_end: if len(path) < minsteps[0]: minpath[0] = path minsteps[0] = len(path) return else: recursivestep(posx-2, posy-1, path+['UL'], i_end, j_end, visited, n, minpath, minsteps) recursivestep(posx-2, posy+1, path+['UR'], i_end, j_end, visited, n, minpath, minsteps) recursivestep(posx, posy+2, path+['R'], i_end, j_end, visited, n, minpath, minsteps) recursivestep(posx+2, posy+1, path+['LR'], i_end, j_end, visited, n, minpath, minsteps) recursivestep(posx+2, posy-1, path+['LL'], i_end, j_end, visited, n, minpath, minsteps) recursivestep(posx, posy-2,path+['L'], i_end, j_end, visited, n, minpath, minsteps) return def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. visited = set() minpath = [[]] minsteps = [float('inf')] recursivestep(i_start, j_start,[], i_end, j_end,visited, n, minpath, minsteps) if minsteps[0] == float('inf'): print 'Impossible' else: print minsteps[0] for el in minpath[0]: print el, 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)