#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. int c=0,l=0,r=0,ul=0,ur=0,ll=0,lr=0,k=0; int x1=i_start,y1=j_start,x2=i_end,y2=j_end; while((x1 != x2 || y1 != y2) ) { k++; if(x1 > x2 && y1 > y2 && x1-2>=0 && y1-1>=0) { ul++; c++; x1 = x1-2; y1 = y1-1; //cout< x2 && y1 < y2 && x1-2>=0 && y1+1y2 && y1-1>=0 && x1+2y2 && y1-2>=0) { c++; l++; y1 = y1-2; //cout<0) { while(ul--) { cout<<"UL "; } } if(ur>0) { while(ur--) { cout<<"UR "; } } if(r>0) { while(r--) { cout<<"R "; } } if(lr>0) { while(lr--) { cout<<"LR "; } } if(ll>0) { while(ll--) { cout<<"LL "; } } if(l>0) { while(l--) { 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; }