#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. pathLength=0 pathSpec='' deltaPath=0 vMoves=i_start-i_end #when vMoves + move up from start hMoves=j_end-j_start #when hMoves + move right from start rowCheck1=vMoves%2 #tells us if end is even rows away from start rowCheck2=(vMoves//2)%2 #if end is even rows away, tells us if it is in the odd or even column displacement regime colCheck=hMoves%2 #tells us if end is even columns away if rowCheck1!=0: print('Impossible') elif rowCheck2!=colCheck: print('Impossible') else: while (vMoves!=0)|(hMoves!=0): if vMoves==0: #running behavior deltaPath=abs(hMoves//2) pathLength+=deltaPath if hMoves>0: pathSpec+='R '*deltaPath hMoves=0 else: pathSpec+='L '*deltaPath hMoves=0 elif hMoves==0: #laddering behavior deltaPath=abs(vMoves//2) pathLength+=deltaPath if vMoves>0: pathSpec+='UL UR '*(deltaPath//2) vMoves=0 else: pathSpec+='LR LL '*(deltaPath//2) vMoves=0 else: if (vMoves>0)&(hMoves<0): pathLength+=1 pathSpec+='UL ' vMoves-=2 hMoves+=1 elif (vMoves>0)&(hMoves>0): pathLength+=1 pathSpec+='UR ' vMoves-=2 hMoves-=1 elif (vMoves<0)&(hMoves>0): while abs(vMoves)!=abs(2*hMoves): pathLength+=1 pathSpec+='R ' hMoves-=2 pathLength+=1 pathSpec+='LR ' vMoves+=2 hMoves-=1 else: pathLength+=1 pathSpec+='LL ' vMoves+=2 hMoves+=1 print(pathLength) print(pathSpec[:-1]) 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)