#include using namespace std; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; using P = pair; set

sp1,sp2,sp3,sp4; const Int INF = 30000; sp1.emplace(0,INF); sp2.emplace(0,INF); sp3.emplace(0,INF); sp4.emplace(0,INF); sp1.emplace(INF,0); sp2.emplace(INF,0); sp3.emplace(INF,0); sp4.emplace(INF,0); auto calc=[&](auto &sp,P p)->Int{ auto area=[&](P q)->Int{ auto it=sp.lower_bound(q); auto pr=it;pr--; auto nx=it;nx++; return (it->first-pr->first)*(it->second-nx->second); }; Int res=0; Int x=p.first,y=p.second; auto it=sp.lower_bound(P(x,-1)); if(it->second>=y) return 0; while(!sp.empty()){ auto er=sp.lower_bound(P(x,y)); if(er==sp.begin()) break; er--; if(er->second<=y){ res-=area(*er); sp.erase(er); continue; } break; } sp.emplace(p); res+=area(p); return res; }; for(Int i=0;i>xa>>ya>>xb>>yb; Int dif=0; dif+=calc(sp1,P(+xb,+yb)); dif+=calc(sp2,P(-xa,+yb)); dif+=calc(sp3,P(-xa,-ya)); dif+=calc(sp4,P(+xb,-ya)); cout<