#!/bin/python import sys from collections import deque def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. moves = ["UL", "UR", "R", "LR", "LL", "L"] coords = [(-2, -1), (-2, 1), (0, 2), (2, 1), (2, -1), (0, -2)] parent = dict() queue = deque([(i_start, j_start)]) visited = [[0] * n for _ in range(n)] while queue: x, y = queue.popleft() if not visited[x][y]: visited[x][y] = 1 else: continue if (x, y) == (i_end, j_end): i, j = x, y path = [] while (i, j) in parent: i, j, move = parent[i, j] path.append(move) print len(path) print ' '.join(path[::-1]) return for move, (dx, dy) in zip(moves, coords): nx, ny = x + dx, y + dy if 0 <= nx < n and 0 <= ny < n and not visited[nx][ny]: if (nx, ny) not in parent: parent[nx, ny] = (x, y, move) queue.append((nx, ny)) 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)