#include<iostream>
#include<cmath>
using namespace std;

int main()
{
    int n;
    double x1, y1, r1, x2, y2, r2;

    cin >> n;

    while( n-- )
    {
        cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2 ;

        double dis = sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) );
        if( dis > r1 + r2 )
            cout << 0 << endl;
        else if( r1 > dis + r2 )
            cout << 2 << endl;
        else if( r2 > dis + r1 )
            cout << -2 << endl;
        else
            cout << 1 << endl;
    }
    return 0;
}
