#include<iostream>
#include<math.h>
using namespace std;

int main(){
    int N;
    double xa, ya, ra, xb, yb, rb;
    cin >> N;
    for(int i=0; i<N; i++){
        cin >>xa>>ya>>ra>>xb>>yb>>rb;

        double rsum = (ra+rb)*(ra+rb), rdiff = ra-rb;
        double cntr_dst = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
        if(rdiff>0 && rdiff*rdiff>cntr_dst){
            cout << 2;
        }else if(rdiff<0 && rdiff*rdiff>cntr_dst){
            cout << -2;
        }
        else if(rsum>cntr_dst && cntr_dst>fabs(rdiff)){
            cout << 1;
        }
        else if(rsum<cntr_dst){
            cout << 0;
        }
        cout << endl;
    }
    return 0;
}