#!/bin/python3 import sys def printShortestPath(n,x1,y1,x2,y2,board): moves=[] N1=range((x2-1),(x2+1)) N2=range((y2-1),(y2+1)) while(((x1 and y1) != (x2 and y2)) and (((x1 and y1) >= 0) and ((x1 and y1) <= n))): if ((x1 in N1) and (y1 in N2)): return 'Impossible' else: if((x1 < x2) and (y1 == y2) and (x1 < n-2)): moves.append('LR') x1+=2 y1+=1 if((x1 < x2) and (y1 == y2) and not (x1 < n-2)): moves.append('LL') x1+=2 y1-=1 if ((x1 < x2) and (y1 < y2)): moves.append('LR') x1+=2 y1+=1 if ((x1 < x2) and (y1 > y2)): moves.append('LL') x1+=2 y1-=1 if((x1 > x2) and (y1 > y2)): moves.append('UL') x1-=2 y1-=1 if ((x1 > x2) and (y1 < y2)): moves.append('UR') x1-=2 y1+=1 if ((x1 > x2) and (y1==y2) and (y1 > 2)): moves.append('UL') x1-=2 y1-=1 if ((x1 > x2) and (y1==y2) and not (y1 > 2)): moves.append('UR') x1-=2 y1+=1 if((x1 == x2) and (y1 < y2)): moves.append('R') y1+=2 if ((x1 == x2) and (y1 > y2)): moves.append('L') y1-=2 if ((x1==x2) and (y1==y2)): return moves else: return 'Impossible' if __name__ == "__main__": n = int(input().strip()) x1, y1, x2, y2 = input().strip().split(' ') x1, y1, x2, y2 = [int(x1), int(y1), int(x2), int(y2)] board = [[0 for x in range(n)] for y in range(n)] #board[n][n] # for i in range (0,n): # for j in range (0,n): # print (board[i][j],end=" ") # print('\n') moves=printShortestPath(n,x1,y1,x2,y2,board) if ('Impossible' in moves): print (moves) else: print (len(moves)) for i in range(len(moves)): print (moves[i],end=" ")