#!/bin/python3 import sys class Node(): def __init__(self, i, j, d, p): self.i = i self.j = j self.d = d self.p = p def printShortestPath(n, ist, jst, ind, jnd): if n <= 3: print("Impossible") return mps = [[-2, -1], [-2, 1], [0, 2], [2, 1], [2, -1], [0, -2]] nts = ["UL", "UR", "R", "LR", "LL", "L"] pts = [Node(ist, jst, None, None)] visited = [ist * n + jst + 1] no = 0 nn = None is_continue = True while is_continue: tpts = [] no += 1 for p in pts: for mp, nt in zip(mps, nts): ni = p.i + mp[0] nj = p.j + mp[1] idx = ni * n + nj + 1 if (ni < 0) or (ni >= n) or (nj < 0) or (nj >= n) or (idx in visited): continue else: nn = Node(ni, nj, nt, p) if ni == ind and nj == jnd: print(no) tnn = nn pns = [] while tnn.p: pns.append(tnn.d) tnn = tnn.p print(" ".join(reversed(pns))) return else: tpts.append(nn) visited.append(idx) if not tpts: print("Impossible") return else: pts = tpts 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)