#!/bin/python import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. mem = [[(i_start, j_start)]] memt = [[]] while mem: path, patht, mem, memt = mem[0], memt[0], mem[1:], memt[1:] i, j = path[-1] if i==i_end and j==j_end: return patht if i > 1 and j > 0 : mem.append(path + [(i-2,j-1)]) memt.append(patht + ['UL']) if i > 1 and j < n-1 : mem.append(path + [(i-2,j+1)]) memt.append(patht + ['UR']) if j < n-2 : mem.append(path + [(i ,j+2)]) memt.append(patht + ['R']) if i < n-2 and j < n-1 : mem.append(path + [(i+2,j+1)]) memt.append(patht + ['LR']) if i < n-2 and j > 0 : mem.append(path + [(i+2,j-1)]) memt.append(patht + ['LL']) if j > 1 : mem.append(path + [(i ,j-2)]) memt.append(patht + ['L']) #UL, UR, R, LR, LL, L. 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)] p = printShortestPath(n, i_start, j_start, i_end, j_end) print len(p) print ' '.join(p)