#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        float x[2], y[2], r[2];
        
        for(int j = 0; j < 2; j++)
            cin >> x[j] >> y[j] >> r[j];
        
        // 2??????????????????????????¢
        float d = sqrt((x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0]));
        
        // ??????????????¢??¨???B?????????????????????A????????????????°?????????´?????????B??????A????????¨?????????
        if(d + r[0] < r[1])
            cout << "-2" << endl;
        // ?????????
        else if(d + r[1] < r[0])
            cout << "2" << endl;
        // 2?????????????????????????????????????????¢??????????°?????????´??????2????????????????????£?????????
        else if(d < r[0]+ r[1])
            cout << "1" << endl;
        // ?????????
        else
            cout << "0" << endl;

    }
}