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

int main()
{
    int n;
    cin >> n;

    for(int i=0; i<n; i++){

        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        double d; // 中心間距離
        d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));

        if( d > ra + rb ) cout << "0\n";
        else if( d == ra+rb ) cout << "1\n";
        else if( ra > rb ) cout << "2\n";
        else cout << "-2\n";
    }

    return 0;
}