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

int main() {
    int n;
    cin >> n;
    double xa, ya, ra, xb, yb, rb;
    while (n--) {
        cin >> xa >> ya >> ra >> xb >> yb >> rb;
        double d = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
        if (ra + rb <= d + 1e-9) {
            cout << 0 << endl;
        } else if (d + ra < rb + 1e-9) {
            cout << -2 << endl;
        } else if (d + rb < ra + 1e-9) {
            cout << 2 << endl;
        } else {
            cout << 1 << endl;
        }
    }
    return 0;
}