#!/bin/python3 import sys d = {1:"UL", 2:"UR", 3:"R", 4:"LR", 5:"LL", 6:"L"} def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. moves = [] counter = 0 if (i_start - i_end) % 2 == 1: print("Impossible") elif (i_start - i_end) % 4 == 2 and (j_start - j_end) % 2 == 0: print("Impossible") elif (i_start - i_end) % 4 == 0 and (j_start - j_end) % 2 == 1: print("Impossible") else: while abs(i_start - i_end) + abs(j_start - j_end) > 0: counter +=1 if i_start == i_end: if j_start > j_end: moves.append(6) j_start -= 2 else: moves.append(3) j_start += 2 elif i_end > i_start: i_start += 2 if j_start <= j_end and j_start != (n-1): moves.append(4) j_start += 1 else: moves.append(5) j_start -= 1 else: i_start -= 2 if j_start >= j_end and j_start != 0: moves.append(1) j_start -= 1 else: moves.append(2) j_start += 1 moves = sorted(moves) print(counter) for m in moves: print(d[m], end=" ") 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)