#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long int ll;
double ab(double a){
	if(a>=0)return a;
	return -a;
}
int main()
{
	int n;
    double xa,ya,ra,xb,yb,rb;
	cin >> n;
	for(int i=0;i<n;i++){
	cin >> xa >> ya >> ra >> xb >> yb >> rb;
	double a=sqrt((yb-ya)*(yb-ya)+(xb-xa)*(xb-xa));
	if(a>ra+rb){
		printf("0\n");
	}
	else if(ab(ra-rb)<a){
		printf("1\n");
	}
	else if(ra>rb)printf("2\n");
	else printf("-2\n");
	}
    return 0;
}