#include using namespace std; struct cell { int row,col,distance; string dir; cell(){} cell(int x,int y,int distance,string dir) : row(x),col(y),distance(distance),dir(dir){} }; bool inside(int x, int y, int N) { if (x >= 0 && x < N && y >= 0 && y < N) return true; return false; } void Ans(int krow,int kcol,int trow,int tcol,int n) { queueq; int drow[] = {-2,-2,0,2,2,0}; int dcol[] = {-1,1,2,1,-1,-2}; string direction[] = {"UL","UR","R","LR","LL","L"}; q.push(cell(krow,kcol,0,"")); set >st; while(!q.empty()) { static int c=0; c++; if(c>100000) break; cell temp = q.front(); q.pop(); st.insert(make_pair(temp.row,temp.col)); if(temp.row == trow && temp.col == tcol) { string s = temp.dir; s.erase(s.begin(),s.begin()+1); cout<= 0 && nextRow < n && nextCol >=0 && nextCol < n) && st.find(make_pair(nextRow,nextCol)) == st.end()) q.push(cell(nextRow,nextCol,temp.distance+1,nextDir)); } } cout<<"Impossible\n"; return; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int N; cin>>N; int kx,ky,tx,ty; cin>>kx>>ky>>tx>>ty; Ans(kx,ky,tx,ty,N); return 0; }