#include <iostream>
#include <cmath>
using namespace std;

class Point{
public:
    double x,y;
    
    Point(double xx,double yy){
        x = xx;
        y = yy;
    }
};

double distance(Point p1,Point p2){
    return sqrt(pow(p1.x-p2.x,2)+pow(p1.y-p2.y,2));
}

struct data1{
    double x,y,r;
} circle1;

struct data2{
    double x,y,r;
} circle2;

int main(){
    int n;
    
    cin >> n;
    while(n--){
        cin >> circle1.x >> circle1.y >> circle1.r;
        cin >> circle2.x >> circle2.y >> circle2.r;
        
        Point p1(circle1.x,circle1.y),p2(circle2.x,circle2.y);
        double d = distance(p1,p2);
        
        if(circle1.r + circle2.r < d) cout << "0" << endl;
        else if(circle2.r + d < circle1.r) cout << "2" << endl;
        else if(circle1.r + d < circle2.r) cout << "-2" << endl;
        else cout << "1" << endl;
    }
    
    return 0;
}