#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

double dir(double x1, double y1, double x2, double y2){
    return hypot(abs(x1-x2),abs(y1-y2));
}

const double EPS = (1e-9);

int main(){
    int n;
    cin>>n;
    rep(loop,n){
        double x[2], y[2], r[2];
        rep(i,2)cin>>x[i]>>y[i]>>r[i];
        
        double direct = dir(x[0],y[0],x[1],y[1]);
        if(direct>r[0]+r[1]+EPS)cout<<0<<endl;
        else if(direct+r[1]<=r[0]+EPS)cout<<2<<endl;
        else if(direct+r[0]<=r[1]+EPS)cout<<-2<<endl;
        else cout<<1<<endl;
    }
}

