#include <iostream>
#include <cmath>

double distance(double x1, double y1, double x2, double y2){
    return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}

int main() {
    int n;
    double xa, ya, ra, xb, yb, rb;
    std::cin >> n;
    
    while(n--){
        std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double dis = distance(xa, ya, xb, yb);
        if(dis + rb < ra)
            std::cout << "2" << std::endl;
        else if(dis + ra < rb)
            std::cout << "-2" << std::endl;
        else if(ra + rb > dis)
            std::cout << "0" << std::endl;
        else if(ra + rb <= dis)
            std::cout << "1" << std::endl;
    }
    return 0;
}