#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. shortestPaths = {(i_start, j_start) : []} moves = {'UL' : (-2, -1), 'UR' : (-2, 1), 'LL' : (2, -1), 'LR' : (2, 1), 'L' : (0, -2), 'R' : (0, 2)} moveorder = ['UL', 'UR', 'R', 'LR', 'LL', 'L'] new = [(i_start, j_start)] while len(new) > 0: curr = new.pop(0) for m in moveorder: next_pos = (curr[0] + moves[m][0], curr[1] + moves[m][1]) if next_pos not in shortestPaths and min(next_pos) >= 0 and max(next_pos) < n: shortestPaths[next_pos] = shortestPaths[curr] + [m] new.append(next_pos) if (i_end, j_end) in shortestPaths: print( len(shortestPaths[(i_end, j_end)]) ) print( ' '.join(shortestPaths[(i_end, j_end)]) ) else: print('Impossible') 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)