#include using namespace std; // #include // using mint = atcoder::modint998244353; using ld = long double; #define fi first #define se second #define all(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(int)(n);++i) templatebool chmin(T&a,T b){return bbool chmax(T&a,T b){return b>a?(a=b,1):0;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin>>T; while(T--){ long A,B,C,x,y,z; cin>>A>>B>>C>>x>>y>>z; if(A>B) swap(A,B),swap(x,y); if(B>C) swap(B,C),swap(y,z); if(A>B) swap(A,B),swap(x,y); long m=(x+y+z)/2; long s=A; if(m