#include using namespace std; int row[] = { -2, -2, 0, 2, 2, 0}; int col[] = { -1, 1, 2, 1, -1, -2}; string direc(int i){ switch(i){ case 0:return "UL"; case 1:return "UR"; case 2:return "R"; case 3:return "LR"; case 4:return "LL"; case 5:return "L"; } return ""; } bool valid(int x, int y,int N) { if (x < 0 || y < 0 || x >= N || y >= N)return false; return true; } struct Node { int x, y, px, py, dir,dist; bool const operator==(const Node& o) const{return x == o.x && y == o.y;} bool operator<(const Node& o) const{return x < o.x || (x == o.x && y < o.y);} }; int main() { ios_base::sync_with_stdio(false);cin.tie(NULL); int n,xs,ys,xf,yf,dist,flag=0,i; cin>>n; cin>>xs>>ys>>xf>>yf; Node src={xs,ys};Node dest={xf,yf}; map visited; queue q; vector v; q.push(src); while (!q.empty()) { Node node = q.front(); v.push_back(node); q.pop(); int x = node.x; int y = node.y; dist= node.dist; if (x == dest.x && y == dest.y){flag=1;break;} if (!visited.count(node)) { visited[node] = true; for (i = 0; i < 6; ++i) { int x1 = x + row[i]; int y1 = y + col[i]; if (valid(x1, y1, n)){ q.push({x1, y1, x, y, i, dist+1}); } } } } if(flag==0) cout<<"Impossible"; else{ cout<