#include <iostream>
#include <cmath>

using namespace std;
typedef long double ld;

const ld eps = 1e-15;

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        ld xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;

        ld dis = sqrt(pow(xa - xb, 2) + pow(ya - yb, 2));
        if (dis < abs(ra - rb)) {
            cout << (ra > rb ? 2 : -2) << endl;
        } else if (dis <= (ra + rb) + eps) {
            cout << 1 << endl;
        } else {
            cout << 0 << endl;
        }
    }
    return 0;
}
