#include<iostream>
#include<complex>
using namespace std;
typedef complex<double> P;

int jud(P a, P b, int ra, int rb);
int dis(P a, P b);

int main(){
    int n;
    cin >>n;
    for(int i = 0; i < n; i++){
        P a, b;
        int ra, rb;
        cin >>a.real() >>a.imag() >>ra >>b.real() >>b.imag() >>rb;
        cout <<jud(a, b, ra, rb) <<endl;
    }
    return 0;
}

int jud(P a, P b, int ra, int rb){
    int disab = dis(a, b), ret;
    if(disab < (ra - rb * 2)){
        ret = 2;
    } else if(disab < (rb - ra * 2)){
        ret = -2;
    } else if(disab < ra || disab < rb){
        ret = 1;
    } else{
        ret = 0;
    }
    return ret;
}

int dis(P a, P b){
    return abs((a.imag() - a.real()) * (a.imag() - a.real()) + (b.imag() - b.real()) * (b.imag() - b.real()));
}