#include #define Nmax 205 using namespace std; int n,x,y,x2,y2,mn[Nmax][Nmax],type[Nmax][Nmax]; int dx[] = {-2,-2,0,2,2,0}; int dy[] = {-1,1,2,1,-1,-2}; string T[] = {"UL","UR","R","LR","LL","L"}; struct NOD{ pair pos; int val; }; pair ant[Nmax][Nmax]; vector H; vector res; bool OK(int x,int y) { if (x<0 || x>=n || y<0 || y>=n) return 0; return 1; } bool comp(NOD a,NOD b) { return a.val>b.val; } bool comp2(int a,int b) { return a>b; } int main() { cin>>n; cin>>x>>y>>x2>>y2; memset(mn,0x3f,sizeof(mn)); mn[x][y] = 0; H.push_back({{x,y},0}); ant[x][y] = {-1,-1}; while (!H.empty()) { pair nod = H[0].pos; int val = H[0].val; pop_heap(H.begin(),H.end(),comp); H.pop_back(); if (val>mn[nod.first][nod.second]) continue; for (int i=0;i<6;i++) { int X = nod.first+dx[i]; int Y = nod.second+dy[i]; if (OK(X,Y) && mn[X][Y]>mn[nod.first][nod.second]+1) { mn[X][Y] = mn[nod.first][nod.second]+1; ant[X][Y] = {nod.first,nod.second}; type[X][Y] = i; H.push_back({{X,Y},mn[X][Y]}); push_heap(H.begin(),H.end(),comp); } } } if (mn[x2][y2]>1e9) { cout<<"Impossible\n"; return 0; } cout<=0;i--) cout<