#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. if(abs(i_end-i_start)%2!=0) cout<<"Impossible"; else { int cnt=0; if(i_startdiff) cnt+=d-diff; else cnt+=(diff-d)/2+(diff-d)%2; cout<1) { cout<<"LR LL "; diff=diff-2; } if(temp%2==1) cout<<"LR L"; } } else if(j_start>j_end) { int d=j_start-j_end; cnt+=abs(d-diff); if(d>diff) cnt+=d-diff; else cnt+=(diff-d)/2+(diff-d)%2; cout<1) { cout<<"LR LL "; diff=diff-2; } if(temp%2==1) cout<<"LR L"; } } else { int d=0; cnt+=abs(d-diff)/2+(diff%4)/2; cout<i_end) { int diff=i_start-i_end; if(j_startdiff) cnt+=d-diff; else cnt+=(diff-d)/2+(diff-d)%2; cout<1) { cout<<"UR UL "; diff=diff-2; } if(temp%2==1) cout<<"UR L"; } } else if(j_start>j_end) { int d=j_start-j_end; cnt+=abs(d-diff); if(d>diff) cnt+=d-diff; else cnt+=(diff-d)/2+(diff-d)%2; cout<1) { cout<<"UR UL "; diff=diff-2; } if(temp%2==1) cout<<"UR L"; } } else { int d=0; cnt+=abs(d-diff)/2+(diff%4)/2; cout<j_end) { while((j_start--)!=j_end) cout<<"L "; } } } } 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; }