#!/bin/python3 import sys from queue import Queue def print_path(i_start, j_start, i_end, j_end, parent): path = [] i, j = (i_end, j_end) while (i, j) != (i_start, j_start): i, j, m = parent[(i, j)] path.append(m) print(' '.join(m for m in path[::-1])) def printShortestPath(n, i_start, j_start, i_end, j_end): row = [-2, -2, 0, 2, 2, 0] col = [-1, 1, 2, 1, -1, -2] move_names = ['UL', 'UR', 'R', 'LR', 'LL', 'L'] parent = {} q = Queue() marked = {(i_start, j_start)} q.put((i_start, j_start, 0)) while not q.empty(): i_root, j_root, d = q.get() if (i_root, j_root) == (i_end, j_end): print(d) print_path(i_start, j_start, i_end, j_end, parent) return for k in range(6): i, j = (i_root + row[k], j_root + col[k]) if 0 <= i < n and 0 <= j < n and (i, j) not in marked: marked.add((i, j)) parent[(i, j)] = (i_root, j_root, move_names[k]) q.put((i, j, d + 1)) 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)