n = int(input()) u,v,x,y = list(map(int,input().split())) level = [[-1 for i in range(n)] for j in range(n)] parent = [['' for i in range(n)] for j in range(n)] parent2 = [[-1 for i in range(n)] for j in range(n)] frontier = [(u,v)] level[u][v] = 0 while len(frontier) > 0: new_frontier = [] for f in frontier: i = f[0] j = f[1] if i - 2 >= 0 and j - 1 >= 0 and level[i-2][j-1] == -1: level[i-2][j-1] = level[i][j] + 1 parent[i-2][j-1] = 'UL' parent2[i-2][j-1] = (i,j) new_frontier.append((i-2,j-1)) if i - 2 >= 0 and j + 1 < n and level[i-2][j+1] == -1: level[i-2][j+1] = level[i][j] + 1 parent[i-2][j+1] = 'UR' new_frontier.append((i-2, j+1)) parent2[i-2][j+1] = (i,j) if j + 2 < n and level[i][j+2] == -1: level[i][j+2] = level[i][j] + 1 parent[i][j+2] = 'R' new_frontier.append((i,j+2)) parent2[i][j+2] = (i,j) if i + 2 < n and j + 1 < n and level[i+2][j+1] == -1: level[i+2][j+1] = level[i][j] + 1 parent[i+2][j+1] = 'LR' new_frontier.append((i+2,j+1)) parent2[i+2][j+1] = (i,j) if i + 2 < n and j - 1 >= 0 and level[i+2][j-1] == -1: level[i+2][j-1] = level[i][j] + 1 parent[i+2][j-1] = 'LL' parent2[i+2][j-1] = (i,j) new_frontier.append((i+2, j-1)) if j - 2 >= 0 and level[i][j-2] == -1: level[i][j-2] = level[i][j] + 1 parent[i][j-2] = 'L' parent2[i][j-2] = (i,j) new_frontier.append((i,j-2)) frontier = new_frontier if level[x][y] == -1: print('Impossible') else: print(level[x][y]) ans = [] while not(x == u and y == v): ans.append(parent[x][y]) x,y = parent2[x][y] ans.reverse() print(' '.join(x for x in ans))