#include using namespace std; using ll=long long; int main() { cin.tie(0)->sync_with_stdio(0); ll h,w,a,b,r1,c1,r2,c2,p,q;cin>>h>>w>>a>>b>>r1>>c1>>r2>>c2>>p>>q; ll ans=0,y=a,x=b,now=1LL<<60; for(int i=r1;i<=r2;i++) { for(int j=c1;j<=c2;j++) { ll tmp=abs(a-i)+abs(b-j); if(tmp