#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. fromdict = {} tovisit = [(i_start, j_start)] while len(tovisit) > 0: i, j = tovisit.pop(0) if (i,j) == (i_end, j_end): break if i > 1 and j > 0 and (i-2,j-1) not in fromdict: tovisit.append((i-2,j-1)) fromdict[(i-2,j-1)] = ('UL',i,j) if i > 1 and j < n-1 and (i-2,j+1) not in fromdict: tovisit.append((i-2,j+1)) fromdict[(i-2,j+1)] = ('UR',i,j) if j < n-2 and (i,j+2) not in fromdict: tovisit.append((i,j+2)) fromdict[(i,j+2)] = ('R',i,j) if i < n-2 and j < n-1 and (i+2,j+1) not in fromdict: tovisit.append((i+2,j+1)) fromdict[(i+2,j+1)] = ('LR',i,j) if i < n-2 and j > 0 and (i+2,j-1) not in fromdict: tovisit.append((i+2,j-1)) fromdict[(i+2,j-1)] = ('LL',i,j) if j > 1 and (i,j-2) not in fromdict: tovisit.append((i,j-2)) fromdict[(i,j-2)] = ('L',i,j) if (i_end, j_end) not in fromdict: print("Impossible") else: ans = [] i,j = i_end, j_end while (i,j) != (i_start,j_start): dr, i_n, j_n = fromdict[(i,j)] ans.append(dr) i,j = i_n, j_n ans=ans[::-1] print(len(ans)) print(' '.join(ans)) 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)