#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    double xa, ya, ra, xb, yb, rb;
    double d;
    int num;

    cin >> num;
    for (int i = 0; i < num; i++) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        
        ra *= ra;
        rb *= rb;
        d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);

        if (d > ra + rb) 
            cout << 0 << endl;
        else if ((abs(ra - rb) < d) && (d < abs(ra + rb)))
            cout << 1 << endl;
        else if (d < abs(ra - rb))
            cout << 2 << endl;
        else if (d < abs(rb - ra))
            cout << -2 << endl;
    }

    return 0;
}