#!/bin/python import sys def isIn(x, y, n): return False if x < 0 or x >=n or y < 0 or y >= n else True order = ["UL", "UR", "R", "LR", "LL", "L"] moves = { "UL": (-2, -1), "UR": (-2, 1), "R": (0, 2), "LR": (2, 1), "LL": (2, -1), "L": (0, -2), # UL, UR, R, LR, LL, L } def printShortestPath(n, si, sj, ei, ej): h = {} m = [[False] * n for i in range(n)] q = [(si, sj)] while len(q) > 0: p = q.pop(0) for name in order: u = moves[name] #print(name, u) x,y = p[0] + u[0], p[1] + u[1] #print(x,y) if isIn(x, y, n) and not m[x][y]: h[(x,y)] = (name, p) if x == ei and y == ej: break else: q.append((x,y)) m[x][y] = True else: #print(h) #print("-=----") continue break if x != ei or y != ej: print "Impossible" return steps = 0 path = [] while (x!=si or y!=sj) and (x,y) in h: steps += 1 path.insert(0,h[(x,y)][0]) x,y = h[(x,y)][1] print(steps) print(" ".join(path)) 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)