#include <iostream>
#include <cmath>
#include <math.h>
using namespace std;
 
float d(float x, float y, float z, float w){
    float ret;
    ret = pow(x *1000 - z * 1000, 2) + pow(y * 1000 - w * 1000, 2);
    return sqrtf(ret);
}
 
int main(){
    int n;
    float x[2], y[2], r[2], dd;
    cin >> n;
    for(int i = 0;i<n;i++){
        cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
        dd = d(x[0], y[0], x[1], y[1]);
        if(dd > (r[0]+r[1]) * 1000){
            cout << 0 << endl;
        }
        else if(dd + r[0] * 1000 < r[1] * 1000){
            cout << -2 << endl;
        }
        else if (dd + r[1] * 1000 < r[0] * 1000) {
            cout << 2 << endl;
        }
        else {
            cout << 1 << endl;
        }
    }
    return 0;
}