#include <bits/stdc++.h>

using namespace std;

struct Circle {
    double x, y, r;    
};

istream &operator >> (istream &is, Circle &c)
{
    return is >> c.x >> c.y >> c.r;
}

double dist(double x1, double y1, double x2, double y2)
{
    return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}

int main()
{
    int N;    
    Circle c1, c2;
    cin >> N;
    while (N--) {
        cin >> c1 >> c2;
        double d = dist(c1.x, c1.y, c2.x, c2.y);
        if (c1.r + c2.r < d) {
            cout << 0 << endl;
        } else if (c2.r + d < c1.r) {
            cout << 2 << endl;
        } else if (c1.r + d < c2.r) {
            cout << -2 << endl;
        } else {
            cout << 1 << endl;
        }
    }    
    return 0;
}