#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. height = abs(i_end-i_start) s = "" count = 0 if height%2 != 0: s = "Impossible" elif i_start > i_end: if j_end < j_start: #print(j_start - height//2) if j_start - height//2 < n: if (j_end - j_start + height//2)%2 == 0: for i in range(0, height//2): s += "UL " count+=height//2 for i in range(0, abs(j_end - j_start) - height//2 - 1): s += "L " count += abs(j_end - j_start) - height//2 - 1 else: s = "Impossible" else: if (height//2)%2 != 0: s = "Impossible" else: count += height//2 for i in range(0, height//2): if i % 2 == 0: s += "LR " else: s +="LL " else: if (j_end - j_start - height//2)%2 == 0: for i in range(0, height//2): s += "UR " count+=height//2 for i in range(0, abs(j_end - j_start) - height//2 - 1): s += "R " count += abs(j_end - j_start) - height//2 - 1 else: if (height//2)%2 != 0: s = "Impossible" else: count += height//2 for i in range(0, height//2): if i % 2 == 0: s += "UR " else: s +="UL " elif i_start < i_end: if j_end < j_start: print(j_start - height//2) if j_start - height//2 < n: if (j_end - j_start + height//2)%2 == 0: for i in range(0, height//2): s += "LL " count+=height//2 for i in range(0, abs(j_end - j_start) - height//2 - 1): s += "L " count += j_end - j_start + height//2 else: s = "Impossible" elif j_start != j_end: if (j_end - j_start - height//2)%2 == 0: for i in range(0, height//2): s += "LR " count+=height//2 for i in range(0, abs(j_end - j_start) - height//2 - 1): s += "R " count += j_end - j_start + height//2 else: if (height//2)%2 != 0: s = "Impossible" else: count += height//2 for i in range(0, height//2): if i % 2 == 0: s += "LR " else: s +="LL " if s != "Impossible": print(count) print(s) 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)