#!/bin/python import sys dirs = [(-2, -1), (-2, +1), (0, +2), (+2, +1), (+2, -1), (0, -2)] m = ['UL', 'UR', 'R', 'LR', 'LL', 'L'] class Node(object): def __init__(self, ns, value=0): self.ns = ns self.value = value def check(ss, n, visited): is_in = ss[0] < n and ss[0] > -1 and ss[1] < n and ss[1] > -1 not_visited = ss not in visited return not_visited and is_in def get_ns(s, visited, n, dist=0): return [((s[0] + d[0], s[1] + d[1]), m[i], dist + 1) for i, d in enumerate(dirs) if check((s[0] + d[0], s[1] + d[1]), n, visited)] def get_path(d, x): if x not in d: return list() return get_path(d, d[x][2]) + [d[x]] def bfs(s, e, n): visited = {s,} ns = get_ns(s, visited, n) for key in ns: visited.add(key[0]) d = {x[0]: (x[2], x[1], s) for x in ns} while len(ns) > 0: x, _, dist = ns.pop(0) visited.add(x) if x[0] == e[0] and x[1] == e[1]: p = get_path(d, x) dd = str(p[-1][0]) pp = ' '.join([x[1] for x in p]) return '\n'.join([dd, pp]) nns = get_ns(x, visited, n, dist) for key in nns: visited.add(key[0]) d[key[0]] = (key[2], key[1], x) ns.extend(nns) return 'Impossible' def printShortestPath(n, a, b, c, d): r = bfs((a, b), (c, d), n) print(r) 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)] printShortestPath(n, i_start, j_start, i_end, j_end)