#include <cmath>
#include <iostream>

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;
        /*
        2 ,原点同士の距離+r1 < r2
        -2,原点同士の距離+r2 < r1
        1 ,原点同士の距離 >= r1 + r2
        0 ,else

        a^2 = b^2 + c^2

        */
        double dx, dy, dis;
        dx = abs(x2-x1);
        dy = abs(y2-y1);
        dis = sqrt(pow(dx, 2) + pow(dy, 2));
        if ( dis + r2 < r1 ) {
            cout << 2;
        } else if ( dis + r1 < r2 ) {
            cout << -2;
        } else if ( r1 + r2 > dis ) {
            cout << 1;
        } else {
            cout << 0;
        }
        cout << endl;
    }

    return 0;
}