#!/bin/python3 import sys def get_new_pos(i_start,j_start,i_end,j_end): if(i_start>i_end): if(j_start>j_end): return [i_start-2,j_start-1,'UL']; elif(j_start<=j_end): return [i_start-2,j_start+1,'UR']; elif(i_startj_end): return [i_start+2,j_start-1,'LL']; elif(j_start<=j_end): return [i_start+2,j_start+1,'LR']; elif(i_start==i_end): if(abs(j_start-j_end)%2==1): return ['','',None]; else: if(j_start>j_end): fact = -2 move1 = 'L'; else: fact=2 move1='R'; return [i_end,j_start+fact,move1]; def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. if(abs(i_start-i_end)%2 !=0): print("Impossible"); else: count = 0; move="" while(True): i_start,j_start,move1= get_new_pos(i_start,j_start,i_end,j_end); #print(i_start,j_start) count+=1; if(move1 is None): print("Impossible"); break; move+=move1+" " if((i_start==i_end) and (j_start==j_end)): break; print(count); print(move); 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)