#include <iostream>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int solver(double ra, double rb, double d);

int main(void)
{
    double xa,ya,ra,xb,yb,rb,d;
    int n;
    
    cin >> n;
    
    rep(i,n)
    {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        d = hypot(xb-xa, yb-ya);
        cout << solver(ra, rb, d) << endl;
    }
    
    return 0;
}

int solver(double ra, double rb, double d)
{
    if(d+rb<ra)
        return 2;
    else if(d+ra<rb)
        return -2;
    else if(ra+rb<d)
        return 0;
    else
        return 1;
}