#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(5)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<short, short> P;
typedef complex<double> Point;
typedef long long ll;
const int INF = 114514810;
const int MOD = 100000007;
const double EPS = 1e-10;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

double ax, ay, ar, bx, by, br;
double d;
int main()
{
	int n; cin >> n;
	REP(i, n)
	{
		cin >> ax >> ay >> ar >> bx >> by >> br;
		d = abs(ax - bx)*abs(ax - bx) + abs(ay - by)*abs(ay - by);
		int ans;
		if (d > (ar + br)*(ar + br)) ans = 0;
		else if (ar > br && (ar - sqrt(d)) > br) ans = 2;
		else if (ar < br && (br - sqrt(d)) > ar) ans = -2;
		else ans = 1;
		cout << ans << endl;
	}
}