#include <bits/stdc++.h>
using namespace std;

using db = double;
const db eps = 1e-12;
int sgn(db a, db b = 0) {
	a -= b;
	return (a > eps) - (a < -eps);
}

struct poi {
	db x, y;
	void r() { cin >> x >> y; }
	poi operator -(poi p) {
		return {x - p.x, y - p.y};
	}
	db len() {
		return sqrt(x * x + y * y);
	}
};

int main() {
	ios :: sync_with_stdio(false);
	int t; cin >> t;
	while(t --) {
		poi a, b; db ra, rb;
		a.r(); cin >> ra;
		b.r(); cin >> rb;
		db d = (b - a).len();
		if(sgn(d, ra + rb) == 0 ||
			sgn(d, abs(ra - rb)) == 0)
			cout << "1\n";
		else if(sgn(ra + d, rb) < 0)
			cout << "-2\n";
		else if(sgn(rb + d, ra) < 0)
			cout << "2\n";
		else
			cout << "0\n";
	}
	return 0;
}