#include using namespace std; //string v; int printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. int i=i_start,j=j_start,iter = 0; while(1) { //cout<i_end) { i-=2; if(j>=j_end) { j-=1; //v[iter++] = 'U'; //v[iter++] = 'L'; //v[iter++] = ' '; cout<<"UL "; } else if(jj_end) { j-=1; //v[iter++] = 'L'; //v[iter++] = 'L'; //v[iter++] = ' '; cout<<"LL "; } } else if(i==i_end&&j>j_end) { //else { while(j!=j_end) { cout<<"L "; j-=2; } break; } } if((i==i_end)&&(j==j_end)) break; } return 1; } 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; if(abs(i_start-i_end)%2!=0) { cout<<"Impossible"; return 0; } if((j_end-j_start)%2==1) { if(((i_end-i_start)/2)%2==0) { cout<<"Impossible"; return 0; } } if((j_end-j_start)%2==0) { if(((i_end-i_start)/2)%2==1) { cout<<"Impossible"; return 0; } } int ans = 0; //ans += abs(i_end-i_start)/2; //ans += abs((j_end-j_start)/2-ans); int x = abs(i_end - i_start); int y = abs(j_end - j_start); if(y<=x) { ans = x/2; } else { ans = x/2 + (y - x/2)/2; } cout<=j_end) { j-=1; //v[iter++] = 'U'; //v[iter++] = 'L'; //v[iter++] = ' '; cout<<"UL "; } else if(jj) { for(int i1=0;i1<((j_end-j)-(i_end-i)/2)/2;i1++) { cout<<"R "; j+=2; } } i+=2; if(j<=j_end) { j+=1; //v[iter++] = 'U'; //v[iter++] = 'L'; //v[iter++] = ' '; cout<<"LR "; } else if(j>j_end) { j-=1; //v[iter++] = 'U'; //v[iter++] = 'R'; //v[iter++] = ' '; cout<<"LL "; } if((i==i_end)&&(j==j_end)) break; } if(jj_end){ while(j!=j_end) {j-=2; //v[iter++] = 'U'; //v[iter++] = 'R'; //v[iter++] = ' '; cout<<"L ";}return 1; } } //cout<