#include <iostream>
#include <cmath>
using namespace std;

const double DIFF = 0.0000001;

int main() {
    int n;
    cin >> n;
    while (n--) {
        double xa, ya, ra, xb, yb, rb;
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double dist2 = pow(xa - xb, 2) + pow(ya - yb, 2),
            radiusSum2 = pow(ra + rb, 2);
        int res;
        if (dist2 > radiusSum2) {
            res = 0;
        } else if (fabs(dist2 - radiusSum2) < DIFF){
            res = 1;
        } else if (ra < rb) {
            res = -2;
        } else {
            res = 2;
        }
        cout << res << endl;
    }
}