N = int(raw_input()) sr,sc,tr,tc = map(int, raw_input().split()) NOPE = "Impossible" from collections import OrderedDict dirs = OrderedDict() #UL, UR, R, LR, LL, L dirs['UL'] = -2, -1 dirs['UR'] = -2, 1 dirs['R'] = 0, 2 dirs['LR'] = 2, 1 dirs['LL'] = 2, -1 dirs['L'] = 0, -2 def go(): from collections import deque q = deque([(tr, tc, 0)]) dist = {(tr, tc): 0} while q: r, c, depth = q.popleft() for d in dirs: dr, dc = dirs[d] cr = r+dr; cc = c+dc if 0 <= cr < N and 0 <= cc < N and (cr, cc) not in dist: q.append((cr, cc, depth+1)) dist[cr,cc] = depth+1 if (sr,sc) not in dist: return [] path = [] r,c = sr,sc while r != tr or c != tc: for d in dirs: dr,dc = dirs[d] cr,cc = r+dr,c+dc if (cr,cc) in dist and dist[r,c] - dist[cr, cc] == 1: r,c=cr,cc path.append(d) break return path path = go() if not path: print NOPE else: print len(path) for x in path: print x,