#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. #bfs search visited = [[0 for i in range (n)] for k in range(n)] prev = [[0 for i in range(n)] for k in range(n)] q = [] q.append((i_start, j_start)) move_list = [(-2, -1), (-2, 1), (0, 2), (2, 1), (2, -1), (0, -2)] name_list = ["UL", "UR", "R", "LR", "LL", "L"] flag = True visited[i_start][j_start] = 1 while q: (x, y) = q.pop(0) #print("move", (x, y)) if (x, y) == (i_end, j_end): path = [] node = (x, y) while prev[x][y] != 0: x, y, t = prev[x][y] path.append(t) path.reverse() print(len(path)) print(" ".join(path)) #print(" ".join(map(str, path2))) flag = False break visited[x][y] = 1 for idx, (dx, dy) in enumerate(move_list): new_x, new_y = x + dx, y + dy if 0 <= new_x < n and 0 <= new_y < n: if visited[new_x][new_y] == 1: continue else: q.append((new_x, new_y)) prev[new_x][new_y] = (x, y, name_list[idx]) visited[new_x][new_y] = 1 #print("Visiting", (new_x, new_y), "from", (x, y)) if flag: print("Impossible") if __name__ == "__main__": n = int(input().strip()) i_start, j_start, i_end, j_end = 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)