#include <iostream>
#include <cmath>

using namespace std;

inline double sq (double a) {
    return a * a;
}

inline double dist (double x1, double y1, double x2, double y2) {
    return sqrt(sq(x1 - x2) + sq(y1 - y2));
}

int main (void) {
    int N;
    cin >> N;
    while (N--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa;
        cin >> ya;
        cin >> ra;
        cin >> xb;
        cin >> yb;
        cin >> rb;
        double d = dist(xa, ya, xb, yb);
        int s;
        if (d + rb < ra) s = 2;
        else if (d + ra < rb) s = -2;
        else if (d < ra + rb) s = 1;
        else s = 0;
        cout << s << endl;
    }
    return 0;
}