#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. chess=[] for i in range(n): chess.append([ 0 for j in range(n)]) start_i=i_start end_j=j_start count=0 moves=[] while((start_i,end_j)!=(i_end,j_end) and (start_i in range(n) and end_j in range(n))): if start_i-2 in range(n) and end_j-1 in range(n) and abs(end_j-1-j_end)<=abs(end_j+1-j_end): if chess[start_i-2][end_j-1]==0 : chess[start_i - 2][end_j - 1]=1 start_i=start_i-2 end_j=end_j-1 count+=1 moves.append('UL') elif start_i-2 in range(n) and end_j+1 in range(n) : if chess[start_i - 2][end_j + 1] == 0: chess[start_i - 2][end_j + 1]=1 start_i=start_i-2 end_j=end_j+1 count += 1 moves.append('UR') elif start_i in range(n) and end_j+2 in range(n) and abs(end_j+2-j_end)<=abs(end_j-2-j_end): if chess[start_i][end_j + 2] == 0: chess[start_i ][end_j + 2]=1 start_i=start_i end_j=end_j+2 count += 1 moves.append('R') elif start_i+2 in range(n) and end_j+1 in range(n) and abs(end_j+1-j_end)<=abs(end_j-1-j_end): if chess[start_i + 2][end_j + 1] == 0: chess[start_i +2][end_j +1]=1 start_i=start_i+2 end_j=end_j+1 count+=1 moves.append('LR') elif start_i+2 in range(n) and end_j-1 in range(n)and start_i+2==i_end: if chess[start_i + 2][end_j - 1] == 0: chess[start_i +2][end_j -1]=1 start_i=start_i+2 end_j=end_j-1 count+=1 moves.append('LL') elif start_i in range(n) and end_j-2 in range(n): if chess[start_i][end_j - 2] == 0: chess[start_i ][end_j -2]=1 start_i=start_i end_j=end_j-2 count+=1 moves.append('L') if count==0: print("Impossible") else: print(count) print(*moves) 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)