#include <iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	while(n--){
		int a;
		double x[2], y[2], r[2], d2;
		for(int i = 0; i < 2; i++) cin >> x[i] >> y[i] >> r[i];
		d2 = (x[1]-x[0])*(x[1]-x[0]) - (y[1]-y[0])*(y[1]-y[0]);
		if(d2 > (r[0]+r[1])*(r[0]+r[1]) ) a = 0;
		else if(d2 > (r[0]-r[1])*(r[0]-r[1]) ) a = 1;
		else  r[0]>r[1] ? a = 2 : a = -2;
		cout << a << endl;
	}
	return 0;
}