#!/bin/python import sys from collections import OrderedDict n = 7 p_start = (0, 3) p_end = (4, 3) def possible(s, e): # End must be in even row relative to the start if (e[0] - s[0]) % 2: return False # If row distance is on odd jump, column distance must be odd if (e[0] - s[0]) % 4 == 2 and (e[1] - s[1]) % 2 != 1: return False # If row distance is on even jump, column distance must be even if (e[0] - s[0]) % 4 == 0 and (e[1] - s[1]) % 2 != 0: return False return True moves = OrderedDict() moves['UL'] = (-2, -1) moves['UR'] = (-2, 1) moves['R' ] = (0, 2) moves['LR'] = (2, 1) moves['LL'] = (2, -1) moves['L' ] = (0, -2) def move(s, step): return (s[0] + moves[step][0], s[1] + moves[step][1]) def distance(s, e): return abs((e[0] - s[0]) + (e[1] - s[1])) def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. p_start = (i_start, j_start) p_end = (i_end, j_end) if not possible(p_start, p_end): print "Impossible" else: p = p_start min_steps = [] while True: distances = [] for step in moves: new_p = move(p, step) if 0 < new_p[0] < n and 0 < new_p[1] < n: distances.append(distance(new_p, p_end)) else: distances.append((sys.maxint, sys.maxint)) distances = [distance(move(p, step), p_end) for step in moves] min_dist = min(distances) min_step = moves.keys()[distances.index(min_dist)] p = move(p, min_step) min_steps.append(min_step) if min_dist == 0: break print len(min_steps) print ' '.join(min_steps) if __name__ == "__main__": n = int(raw_input().strip()) i_start, j_start, i_end, j_end = raw_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)