#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. movs = [] if (i_end - i_start) % 2 != 0: print("Impossible") return v_hops = abs(i_end - i_start) // 2 if (v_hops % 2 == 0) and ((j_end - j_start) % 2 != 0): print("Impossible") return if (v_hops % 2 != 0) and ((j_end - j_start) % 2 == 0): print("Impossible") return for i in range(v_hops): v_dir = i_end > i_start and 'L' or 'U' if j_start > j_end or j_start == (n-1): movs.append(v_dir + 'L') j_start -= 1 else: movs.append(v_dir + 'R') j_start += 1 if j_start != j_end: h_dir = j_end > j_start and 'R' or 'L' for i in range(abs(j_end - j_start)//2): movs.append(h_dir) return movs def find_move(movs, m): try: return movs.index(m) except ValueError: return -1 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)] movs = printShortestPath(n, i_start, j_start, i_end, j_end) if movs: print(len(movs)) ord_movs = [] while(movs): idx = False for m in ['UL', 'UR', 'R', 'LR', 'LL', 'L']: idx = find_move(movs, m) if idx >= 0: break ord_movs.append(movs[idx]) movs.remove(movs[idx]) print(" ".join(ord_movs))