#define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	int n; cin >> n;
	while (n--) {
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d = sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya));
		if (d + ra <= rb)cout << -2 << endl;
		else if (d > ra + rb)cout << 0 << endl;
		else if (d + rb <= ra)cout << 2 << endl;
		else if (d < ra + rb)cout << 1 << endl;
		/*
		d<ra+rb A()B
		d+ra<=rb B A))
		d+rb<=ra A B))
		d>ra+rb
		*/
	}

	return 0;
}