#include<iostream>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin >> n;
    while(n--){
        double x1,x2,y1,y2,r1,r2;
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
        double dist = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        if(r1>r2){
            if(dist<(r1-r2))    cout << "2\n";
            else if(dist>=(r1-r2)&&dist<=(r1+r2))   cout << "1\n";
            else    cout << "0\n";
        }
        else{
            if(dist<(r2-r1)) cout << "-2\n";
            else if(dist>=(r2-r1)&&dist<=(r2+r1))   cout << "1\n";
            else    cout << "0\n";
        }
    }
    return 0;
}
