#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # order to print: UL, UR, R, LR, LL, L if i_start & 1 != i_end & 1 or (abs(i_start - i_end)&3 != 0 and j_start == j_end): print("Impossible") return # try to find shortest path. First try to get up res = [] pos_i = i_start pos_j = j_start # special case for speed up: if j_start == j_end: if i_start > i_end: # we need to go up # can we go left first? if j_start > 0: order = ["UL", "UR"] else: order = ["LR", "LL"] else: if j_start < n: order = ["LR", "LL"] else: order = ["UL", "UR"] res = order * (abs(i_start - i_end) // 4) else: # calculat max numbers of possible UL/UR operations: if pos_i > i_end: if pos_j > j_end: max_num = (pos_i - i_end) // 2 res.extend(["UL"]*max_num) pos_i -= 2 * max_num pos_j -= max_num else: max_num = (pos_i - i_end) // 2 res.extend(["UR"]*max_num) pos_i -= 2 * max_num pos_j += max_num # next we go for R and LR operations. For this we need to make sure that we can still go up as much as needed if pos_j < j_end: max_lr = min((i_end - pos_i) // 2, j_end - pos_j) max_r = (j_end - pos_j - max_lr) // 2 res.extend(["R"] * max_r) res.extend(["LR"] * max_lr) pos_i += 2 * max_lr pos_j += max_lr + 2 * max_r # at this point we only need to go left, so first we move up as much as possible if pos_i < i_end: max_num = (i_end - pos_i) // 2 res.extend(["LL"]*max_num) pos_i += 2 * max_num pos_j += max_num # now all thats left: max_num = (pos_j - j_end) // 2 res.extend(["L"] * max_num) print(len(res)) print(*res) 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)