#!/bin/python3 def main_shifting(x1,y1,c): #print(c) moves = ['UL', 'UR', 'R', 'LR', 'LL', 'L'] if(x1 - x2 == 1 or x2 - x1 == 1): print ("Impossible") elif(x1 == x2 and y1 == y2): print (steps) for i in range(len(positionstack)): print(positionstack[i], end = " ") else: if(x1,y1) not in trackingstack: #print("position push:") trackingstack.append((x1,y1)) #print(trackingstack) if(x1 == x2): if(y1 - y2 == 1 or y2 - y1 == 1): print ("Impossible") elif(y1 > y2): shiftposition(moves[5],x1,y1) elif(y2 > y1): shiftposition(moves[2],x1,y1) else: shiftposition(moves[c],x1,y1) def shiftposition(position,a,b): global count global steps #print("position:"+position) if(position == 'L'): c = a d = b - 2 elif(position =='R'): c = a d = b + 2 elif(position =='UL'): c = a - 2 d = b - 1 elif(position =='UR'): c = a - 2 d = b + 1 elif(position =='LL'): c = a + 2 d = b - 1 elif(position =='LR'): c = a + 2 d = b + 1 if(count < 5): if(c < 0 or c >= n or d < 0 or d >= n ): count = count +1 main_shifting(a,b,count) else: count = 0 #trackingstack.append((c,d)) positionstack.append(position) steps = steps + 1 #print("trackingstack:" ,trackingstack) main_shifting(c,d,count) if __name__ == "__main__": n = int(input().strip()) global x1,y1,x2,y2 , trackingstack, positionstack x1,y1,x2,y2 = input().strip().split(' ') x1,y1,x2,y2 = int(x1),int(y1),int(x2),int(y2) #print (x1,y1,x2,y2) trackingstack = [] positionstack = [] global count,steps steps = int(0) count = int(0) main_shifting(x1,y1,0)