#include using namespace std; struct node{ string st; int val; }; bool compare(node x,node y){ if(x.val *vec,string str,int count){ if(w<0 || w>n-1 || x<0 || x>n-1) return; if(w==y && x==z){ node nd; nd.st=str; nd.val=count ; (*vec).push_back(nd); return;} //cout<x) get_path(n,w-2,x+1,y,z,vec,str+"UR ",count+1); if(y==w && z>x) get_path(n,w,x+2,y,z,vec,str+"R ",count+1); if(y>w && z>x) get_path(n,w+2,x+1,y,z,vec,str+"LR ",count+1); if(y>w && z vec; int count=0; string str=""; get_path(n,w,x,y,z,&vec,str,count); if(vec.size()==0) cout<<"Impossible\n"; else{ sort(vec.begin(),vec.begin()+vec.size(),compare); 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; }