#include <iostream>
#include <vector>
#include <utility>
#include <cmath>
#define ttt template <typename T>
#define pca point<T> const &
ttt struct point { T x, y; };
ttt point<T> operator + (pca a, pca b) { return { a.x+b.x, a.y+b.y }; }
ttt point<T> operator - (pca a, pca b) { return { a.x-b.x, a.y-b.y }; }
ttt point<T> operator - (pca a) { return { -a.x, -a.y }; }
ttt point<T> operator * (T a, pca b) { return { a*b.x, a*b.y }; }
ttt std::pair<T,T> to_pair(pca a) { return { a.x, a.y }; }
ttt bool operator == (pca a, pca b) { return to_pair(a) == to_pair(b); }
ttt bool operator != (pca a, pca b) { return to_pair(a) != to_pair(b); }
ttt bool operator <  (pca a, pca b) { return to_pair(a) <  to_pair(b); }
ttt bool operator <= (pca a, pca b) { return to_pair(a) <= to_pair(b); }
ttt bool operator >= (pca a, pca b) { return to_pair(a) >= to_pair(b); }
ttt bool operator >  (pca a, pca b) { return to_pair(a) >  to_pair(b); }
ttt T length_squared(pca p) { return p.x*p.x + p.y*p.y; }
ttt double length(pca p) { return sqrt(length_squared(p)); }
ttt point<T> normalized(pca a) { return (1 / length(a)) * a; }
ttt T   dot(pca p, pca q) { return p.x * q.x + p.y * q.y; }
ttt T cross(pca p, pca q) { return p.x * q.y - p.y * q.x; }
ttt int ccw(pca a, pca b, pca c) { T x = cross(b - a, c - a); return x > 0 ? 1 : x < 0 ? -1 : 0; }
#undef ttt
#undef pca
template <typename T> std::istream & operator >> (std::istream & input, point<T> & p) { return input >> p.x >> p.y; }
template <typename T> std::ostream & operator << (std::ostream & output, const point<T> & p) { return output << p.x << ' ' << p.y; }
template <typename T> struct circle { point<T> p; T r; };
template <typename T> bool operator == (circle<T> const & a, circle<T> const & b) { return a.p == b.p and a.r == b.r; }
template <typename T> bool operator != (circle<T> const & a, circle<T> const & b) { return not (a == b); }
using namespace std;
int main() {
    int n; cin >> n;
    while (n --) {
        circle<double> a, b;
        cin >> a.p >> a.r >> b.p >> b.r;
        double l = length(a.p - b.p);
        if (a.r + b.r < l) {
            cout << 0 << endl;
        } else if (l + a.r < b.r) {
            cout << - 2 << endl;
        } else if (l + b.r < a.r) {
            cout << 2 << endl;
        } else {
            cout << 1 << endl;
        }
    }
    return 0;
}