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

#define equals(a, b) (fabs((a)-(b)) < EPS)
const double EPS = (1e-10);

class Point {
public:
    double x, y;

    Point(double x = 0, double y = 0): x(x), y(y) {}

    Point operator + (Point p) {
        return Point(x+p.x, y+p.y);
    }
    Point operator - (Point p) {
        return Point(x-p.x, y-p.y);
    }
    Point operator * (double a) {
        return Point(x*a, y*a);
    }
    Point operator / (double a) {
        return Point(x/a, y/a);
    }

    double abs() {
        return sqrt(norm());
    }
    double norm() {
        return x*x + y*y;
    }

    bool operator < (const Point &p) const {
        return x != p.x ? x < p.x : y < p.y;
    }

    bool operator == (const Point &p) const {
        return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
    }
};

typedef Point Vector;
// ??????
double dot(Vector a, Vector b) {
    return a.x*b.x + a.y*b.y;
}
// ??????
double cross(Vector a, Vector b) {
    return a.x*b.y - a.y*b.x;
}

class Circle {
public:
    Point c;                    // ??????
    double r;                   // ??????
    Circle(Point c = Point(), double r = 0.0): c(c), r(r) {}
};


int intersect(Circle c1, Circle c2) {
    double d = (c2.c - c1.c).abs();

    // ????????£???????????´???
    if (d - (c1.r+c2.r) > EPS) {
        return 0;
    }

    if (c1.r > c2.r && c1.r-c2.r > d) {
        return 2;
    }
    if (c2.r > c1.r && c2.r-c1.r > d) {
        return -2;
    }

    return 1;
}

int main(void) {

    int N; cin >> N;
    for (int i = 0; i < N; i++) {
        Circle ca, cb;
        cin >> ca.c.x >> ca.c.y >> ca.r
            >> cb.c.x >> cb.c.y >> cb.r;

        cout << intersect(ca, cb) << endl;
    }

    return 0;
}