def printShortestPath(n, i_start, j_start, i_end, j_end): x_moves = [-1, 1, 2, 1, -1, -2] y_moves = [-2, -2, 0, 2, 2, 0] actions = ["UL", "UR", "R", "LR", "LL", "L"] target = (j_end, i_end) done = False visited = {(j_start, i_start): (j_start, i_start, -1)} frontier = [(j_start, i_start)] steps = 0 while len(frontier) != 0: steps += 1 new_frontier = [] for i in frontier: for j in range(6): x = i[0] + x_moves[j] y = i[1] + y_moves[j] if x < 0 or x > n - 1 or y < 0 or y > n - 1: continue if (x, y) in visited: continue visited[(x, y)] = (i[0], i[1], j) if (x, y) == target: done = True break new_frontier.append((x, y)) if done: new_frontier = [] break frontier = new_frontier if done: print(steps) pos = (j_end, i_end, -1) r = [] while not(pos[0] == j_start and pos[1] == i_start): pos = visited[(pos[0], pos[1])] r += [actions[pos[2]]] print(" ".join(r[::-1])) else: print("Impossible") 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)