#include <iostream>
#include <cmath>

std::pair<double, double> p, q;
double r_p, r_q;
int n;

void solve() {
    double center_dist = pow(p.first - q.first, 2) + pow(p.second - q.second, 2);
    double radius_dist = pow(r_p+r_q, 2);

    if (center_dist > radius_dist) {
        std::cout << 0 << std::endl;
    } else if (center_dist < pow(r_q, 2) + pow(r_p, 2) - 2*r_p*r_q) {
        if (r_p > r_q) {
            std::cout << 2 << std::endl;
        } else {
            std::cout << -2 << std::endl;
        }
    } else {
        std::cout << 1 << std::endl;
    }
}

int main(void) {
    std::cin >> n;
    for (int i=0; i<n; i++) {
        std::cin >> p.first >> p.second >> r_p
                 >> q.first >> q.second >> r_q;
        solve();
    }
}

