#include <iostream>
#include <cstdio>
#include <complex>

using namespace std;
typedef long long ll;

typedef double R;
typedef complex<R> P;

R cross(const P &a, const P &b) { return imag(conj(a)*b); }
R dot(const P &a, const P &b) { return real(conj(a)*b); }

struct C {
    P p;
    R r;
    C () {};
    C (P p, R r) : p(p), r(r) {};
};

C c[2];
int solve() {
    for (int i = 0; i < 2; i++) {
        R x, y, r;
        cin >> x >> y >> r;
        c[i] = C(P(x, y), r);
    }
    R dist = abs(c[0].p - c[1].p);
    if (c[0].r > c[1].r + dist) return 2;
    if (c[1].r > c[0].r + dist) return -2;
    if (c[0].r + c[1].r >= dist) return 1;
    return 0;
}


int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cout << solve() << endl;
    }
    return 0;
}