import sys class Path: def __init__(self, row, col, path): self.row = row self.col = col self.path = path def print_shortest_path(n, i_start, j_start, i_end, j_end): # UL, UR, R, LR, LL, L # BFS queue = [Path(i_start, j_start, [])] while queue: loc = queue.pop(0) if loc.row >= n or loc.row < 0 or loc.col >= n or loc.col < 0: continue if loc.row == i_end and loc.col == j_end: return '{}\n'.format(len(loc.path)) + ' '.join(loc.path) visited[loc.row][loc.col] = True # UL try: if not visited[loc.row - 2][loc.col - 1]: queue.append(Path(loc.row - 2, loc.col - 1, loc.path + ['UL'])) except: pass # UR try: if not visited[loc.row - 2][loc.col + 1]: queue.append(Path(loc.row - 2, loc.col + 1, loc.path + ['UR'])) except: pass # R try: if not visited[loc.row][loc.col + 2]: queue.append(Path(loc.row, loc.col + 2, loc.path + ['R'])) except: pass # LR try: if not visited[loc.row + 2][loc.col + 1]: queue.append(Path(loc.row + 2, loc.col + 1, loc.path + ['LR'])) except: pass # LL try: if not visited[loc.row + 2][loc.col - 1]: queue.append(Path(loc.row + 2, loc.col - 1, loc.path + ['LL'])) except: pass # L try: if not visited[loc.row][loc.col - 2]: queue.append(Path(loc.row, loc.col - 2, loc.path + ['L'])) except: pass return 'Impossible' n = int(raw_input().strip()) visited = [[False for j in xrange(n)] for i in xrange(n)] i_start, j_start, i_end, j_end = map(int, raw_input().strip().split(' ')) print print_shortest_path(n, i_start, j_start, i_end, j_end)