#include<bits/stdc++.h>
using namespace std;
int main(){
long long T;
long long x1,x2,y1,y2,a,b;
long long kvadratche1,kvadratche2,br1,br2;
cin>>T;
for(long long i=0;i<2;i++){
    cin>>x1>>y1>>x2>>y2>>a>>b;

    kvadratche1=x1-x2;
    kvadratche2=y1-y2;
    if(kvadratche1<0){kvadratche1=kvadratche1*-1;}
    if(kvadratche2<0){kvadratche2=kvadratche2*-1;}
    //cout<<kvadratche1<<";"<<kvadratche2<<endl;
    if(a<0){a=a*-1;}
    if(b<0){b=b*-1;}
    br1=a-kvadratche1+1;
    br2=b-kvadratche2+1;
    //cout<<br1<<";"<<br2<<endl;
    if(kvadratche1<=a&&kvadratche2<=b){cout<<br1*br2;}else{cout<<0;}
    cout<<endl;


}




return 0;
}
