#include #include #include using namespace std; int **board; string temp[200]; string mini[200]; int k; int printPath(int ,int ,int ,int ,int ); bool place(int istart,int jstart,int iend,int jend){ if((istart-2)==iend && (jstart-1)==jend){ temp[k]="UL"; return true; } if((istart-2)==iend && (jstart+1)==jend){ temp[k]="UR"; return true; } if((istart==iend) && (jstart+2)==jend){ temp[k]="R"; return true; } if((istart+2)==iend && (jstart+1)==jend){ temp[k]="LR"; return true; } if((istart+2)==iend && (jstart-1)==jend){ temp[k]="LL"; return true; } if((istart==iend) && (jstart-2)==jend){ temp[k]="L"; return true; } return false; } int printPath(int istart,int jstart,int iend,int jend,int n){ if((istart==iend) && (jstart==jend)) return 0; if(place(istart,jstart,iend,jend)) return 1; int min=INT_MAX; if((istart-2)>=0 && (jstart-1)>=0) { if(board[istart-2][jstart-1]==0){ temp[k++]="UL"; board[istart-2][jstart-1]=1; int ans=printPath(istart-2,jstart-1,iend,jend,n); if(ans!=INT_MAX && ans+1=0 && (jstart+1)=0) { if(board[istart+2][jstart-1]==0){ temp[k++]="LL"; board[istart+2][jstart-1]=1; int ans=printPath(istart+2,jstart-1,iend,jend,n); if(ans!=INT_MAX && ans+1=0){ if(board[istart][jstart-2]==0){ temp[k++]="L"; board[istart][jstart-2]=1; int ans=printPath(istart,jstart-2,iend,jend,n); if(ans!=INT_MAX && ans+1>n; k=0; board=new int*[n]; for(int i=0;i>istart>>jstart>>iend>>jend; board[istart][jstart]=1; int ans=printPath(istart,jstart,iend,jend,n); if(ans==INT_MAX) cout<<"Impossible"; else{ cout<