#include using namespace std; const int MAX=203; const int dx[]= {-2,-2,0,2,2,0}; const int dy[]= {-1,1,2,1,-1,-2}; string ans[]= {"UL","UR","R","LR","LL","L"}; queue >q; pairparent[MAX][MAX],destination,start; bool visited[MAX][MAX],flag; int n,a,b,c,d; bool valid(int x,int y) { if(x<=0||x>n||y<=0||y>n) return false; if(visited[x][y]) return false; visited[x][y]=true; return true; } void func() { a++,b++,c++,d++; destination=make_pair(c,d); start=make_pair(a,b); q.push(make_pair(a,b)); while(!q.empty()) { pairtemp=q.front(); q.pop(); if(temp==destination) { flag=true; break; } int x=temp.first; int y=temp.second; for(int j=0; j<6; j++) { int nx=x+dx[j]; int ny=y+dy[j]; if(!valid(nx,ny)) continue; q.push(make_pair(nx,ny)); parent[nx][ny]=make_pair(x,y); } } if(!flag) cout<<"Impossible"< >v; while(destination!=start) { pairp=parent[destination.first][destination.second]; v.push_back(p); destination=p; } v.pop_back(); reverse(v.begin(),v.end()); v.push_back(make_pair(c,d)); cout<>n; cin>>a>>b>>c>>d; func(); return 0; }