#!/bin/python import sys global reachDest,path,re reachDest = 0 re = 0 path = '' def crawl(i,j,n,i_dest,j_dest): #print 'i=',i,'j=',j global reachDest,path,re nav[i][j]=0 if i==i_dest and j==j_dest: reachDest = 1 re+=1 else: if (i-2>=0 and j-1>=0) and (i_destj_dest) and nav[i-2][j-1]==1: #UL #print 'UL' crawl(i-2,j-1,n,i_end,j_end) if reachDest==1: re+=1 path='UL '+path return if (i-2>=0 and j+1=0 and ii and j<=j_dest) and nav[i+2][j+1]==1: #LR #print 'LR' crawl(i+2,j+1,n,i_end,j_end) if reachDest==1: re+=1 path='LR '+path return if (i+2=0) and (i_dest>i and j>=j_dest) and nav[i+2][j-1]==1: #LL #print 'LL' crawl(i+2,j-1,n,i_end,j_end) if reachDest==1: re+=1 path='LL '+path return if ((i>=0 and i=0) and (i_dest==i and j>j_dest) and nav[i][j-2]==1: #L #print 'L' crawl(i,j-2,n,i_end,j_end) if reachDest==1: re+=1 path='L '+path return #print 'hai ',i,j nav[i][j]=1 def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves global reachDest,path,re crawl(i_start,j_start,n,i_end,j_end) if reachDest==1: print re-1 print path else: print "Impossible" nav = [] if __name__ == "__main__": n = int(raw_input().strip()) nav=[[1]*n]*n i_start, j_start, i_end, j_end = raw_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)