#!/bin/python import sys def can_visit(n, i, j, visited): return i >= 0 and j >= 0 and i < n and j < n and (i, j) not in visited def visit(n, i, j, i_end, j_end, directional, visited, best_path=None): if i == i_end and j == j_end: return True, directional UL_i = i - 2 UL_j = j - 1 UR_i = i - 2 UR_j = j + 1 R_i = i R_j = j + 2 LR_i = i + 2 LR_j = j + 1 LL_i = i + 2 LL_j = j - 1 L_i = i L_j = j - 2 order = ['UL', 'UR', 'R', 'LR', 'LL', 'L'] try_visiting = {'UL':(UL_i, UL_j), 'UR':(UR_i, UR_j), 'R':(R_i, R_j), 'LR':(LR_i, LR_j), 'LL':(LL_i, LL_j), 'L':(L_i, L_j)} has_visits = False for direction in order: to_visit = try_visiting[direction] i = to_visit[0] j = to_visit[1] if (best_path is None or len(visited) < len(best_path)) and can_visit(n, i, j, visited): done, path = visit(n, i, j, i_end, j_end, directional[:] + [direction], visited[:] + [to_visit], best_path) if done: if best_path is None or len(best_path) > len(path): best_path = path return best_path is not None, best_path def printShortestPath(n, i_start, j_start, i_end, j_end): finished, best_path = visit(n, i_start, j_start, i_end, j_end, [], [(i_start, j_start)]) if finished and best_path: print len(best_path) print ' '.join(best_path) else: print 'Impossible' 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)