#include<iostream>
#include<cmath>
using namespace std;

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