#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. paths = [] paths.insert(0,[i_start, j_start, 0,list()]) board = [[0 for x in range(n)] for y in range(n)] for b in board: b = [n] moves = [[[-2,-1],"UL"],[[-2,1],"UR"],[[0,2],"R"],[[2,1],"LR"],[[2,-1],"LL"],[[0,-2],"L"]] board[0][0] = 1 while(not (len(paths) == 0)): path = paths[-1] paths = paths[:-1] board[path[0]][path[1]] = 1 if(path[0] == i_end and path[1] == j_end): print(path[2]) for m in path[3]: print(m, end=' ') return for move in moves: nx = path[0] + move[0][0] ny = path[1] + move[0][1] if(ny >=0 and ny < n and nx >=0 and nx < n and board[nx][ny] != 1): shift = list(path[3]) shift.insert(len(shift),move[1]) paths.insert(0,[nx, ny, path[2]+1,shift]) 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)