#!/bin/python3 import sys moves = { 'UL': lambda i, j: (i - 2, j - 1), 'UR': lambda i, j: (i - 2, j + 1), 'LL': lambda i, j: (i + 2, j - 1), 'LR': lambda i, j: (i + 2, j + 1), 'L': lambda i, j: (i, j - 2), 'R': lambda i, j: (i, j + 2), } def is_closer(a, b, c): ac = abs(a[0] - c[0]) + abs(a[1] - c[1]) bc = abs(b[0] - c[0]) + abs(b[1] - c[1]) if bc <= ac: return True return False def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. if abs(i_end - i_start) % 2 != 0: print("Impossible") return res = [('', (i_start, j_start))] found = False while not found: x, current_point = res[-1] closest_point = res[-1] for move, f in moves.items(): new_point = moves[move](*current_point) if new_point == (i_end, j_end): found = True closest_point = (move, new_point) break if is_closer(closest_point[1], new_point, (i_end, j_end)): closest_point = (move, new_point) res.append(closest_point) print(len(res[1:])) print(' '.join([x[0] for x in res[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)] printShortestPath(n, i_start, j_start, i_end, j_end)