#include using namespace std; int inf = 1000; int ans[200][200][1000+1], val[200][200][1000+1]; int Moves(int n, int x1, int y1, int x2, int y2, int p) { if(ans[x1][y1][p]==0) { if(x1==x2 && y1==y2) ans[x1][y1][p] = 0; else { if(p==0) ans[x1][y1][p] = inf; else { int i, arr[6], sho=inf, j=0; for(i=0;i<6;i++) arr[i]=inf; if(x1>1 && y1>0) arr[0]=Moves(n,x1-2,y1-1,x2,y2,p-1); if(x1>1 && y10) arr[4]=Moves(n,x1+2,y1-1,x2,y2,p-1); if(y1>1) arr[5]=Moves(n,x1,y1-2,x2,y2,p-1); for(i=0;i<6;i++) { if(sho>arr[i]) { sho = arr[i]; j = i+1; } } if(sho==inf) ans[x1][y1][p] = inf; else { ans[x1][y1][p] = sho+1; val[x1][y1][p] = j; } } } } return ans[x1][y1][p]; } void printShortestPath(int n, int x1, int y1, int x2, int y2, int p) { if(x1==x2 && y1==y2) { } else { if(p==0) { } else { // UL, UR, R, LR, LL, L if(val[x1][y1][p]==1) { cout<<"UL "; printShortestPath(n,x1-2,y1-1,x2,y2,p-1); } else if(val[x1][y1][p]==2) { cout<<"UR "; printShortestPath(n,x1-2,y1+1,x2,y2,p-1); } else if(val[x1][y1][p]==3) { cout<<"R "; printShortestPath(n,x1,y1+2,x2,y2,p-1); } else if(val[x1][y1][p]==4) { cout<<"LR "; printShortestPath(n,x1+2,y1+1,x2,y2,p-1); } else if(val[x1][y1][p]==5) { cout<<"LL "; printShortestPath(n,x1+2,y1-1,x2,y2,p-1); } else if(val[x1][y1][p]==6) { cout<<"L "; printShortestPath(n,x1,y1-2,x2,y2,p-1); } else { } } } } int main() { int n; int x1,y1,x2,y2; cin>>n; cin>>x1>>y1>>x2>>y2; int i,j,k; for(i=0;i<200;i++) { for(j=0;j<200;j++) { for(k=0;k<=inf;k++) { val[i][j][k]=0; ans[i][j][k]=0; } } } int final_answer = Moves(n,x1,y1,x2,y2,inf); if(final_answer==inf) cout<<"Impossible"; else { cout<