#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin>>n;
    for(int a=0;a<n;a++){
        double p,q,r,s,t,u;
        cin>>p>>q>>r>>s>>t>>u;
        double A,B,C;
        A=r;
        B=u;
        C=sqrt((p-s)*(p-s)+(q-t)*(q-t));
        if(B+C<A)cout<<"2";
        else if(A+C<B)cout<<"-2";
        else if(C>A+B)cout<<"0";
        else cout<<"1";
        cout<<endl;
         
    }
    return 0;
}