#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int a=i_end-i_start; if((a)%2!=0){ cout << "Impossible"; return; } int b=abs(a/2); int c=abs(j_end-j_start); int d=abs(c-b); if(d%2!=0){ cout <<"Impossible"; return; } int e=0; if(c>b){ e=d/2; } int sum=b+e; cout << sum<abs(y)/2){ int temp=abs(y)/2; int temp1= (abs(x)-temp)/2; while(temp--) cout << "UL "; while(temp1--) cout << "L "; } else{ temp=abs(x); temp1=(abs(y/2)-temp)/2; temp+=temp1; while(temp--) cout << "UL "; while(temp1--) cout << "UR "; } } else if(x<=0 && y>=0){ if(abs(x)>y){ int temp=abs(x)-y; int temp1= (x-temp)/2; while(temp--) cout << "LL "; while(temp1--) cout << "L "; } else{ temp=x+y; temp1=(y-temp)/2; while(temp1--) cout << "LR "; while(temp--) cout << "LL "; } } /*if(x>0 && y>0){ } if(x>0 && y<0){ } if(x<0 && y<0){ }*/ // Print the distance along with the sequence of moves. } int main() { int n; cin >> 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; }