#include using namespace std; typedef long long int uli; pairdir[]={ {-2,-1}, {-2,1}, {0,2}, {2,1}, {2,-1}, {0,-2} }; string dirs[]={ "UL","UR","R","LR","LL","L" }; const int mx=222; int d[mx][mx]; int main(){ int n,r1,c1,r2,c2; cin>>n>>r1>>c1>>r2>>c2; queue >q; q.push({r2,c2}); memset(d,-1,sizeof d); d[r2][c2]=0; while(!q.empty()){ int r=q.front().first; int c=q.front().second; q.pop(); for(int i=0;i<6;i++){ int nr=r+dir[i].first; int nc=c+dir[i].second; if(0<=nr && nr