#include #include using namespace std; void printShortestPath(int n, int is, int js, int ie, int je) { int i=is,j=js,flag=1,sum=0; string str=""; while(flag==1) { if(i>ie&&j>=je&&abs(i-ie)>=2&&abs(j-je)>=1) { //cout<<"UL"<<" "; str.append(" UL"); i=i-2; j=j-1; sum++; flag=1; } else if(i>ie&&j<=je&&abs(i-ie)>=2&&abs(j-je)>=1) { //cout<<"UR"<<" "; str.append(" UR"); i=i-2; j=j+1; sum++; flag=1; } else if(i=2&&abs(j-je)>=0) { str.append(" LR"); i=i+2; j=j+1; sum++; flag=1; } else if(i=je&&abs(i-ie)>=2&&abs(j-je)>=0) { str.append(" LL"); i=i+2; j=j-1; sum++; flag=1; } else if(i==ie&&j>je&&(j-je)>=2) { str.append(" L"); j=j-2; flag=1; sum++; } else if(i==ie&&(j-je)>=2) { str.append(" R"); j=j+2; flag=1; sum++; } else { flag=0; if(i!=ie and j!=je) { cout<<"Impossible"; } else { cout<> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }