#include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<cmath>
#include<string>
#include<algorithm>
#include<cstdlib>
using namespace std;

struct circle{
	double r,x,y;
};

int main(){
	int n;
	scanf("%d",&n);
	for(int x=0;x<n;++x){
		circle a,b;
		scanf("%lf %lf %lf %lf %lf %lf",&a.x,&a.y,&a.r,&b.x,&b.y,&b.r);
		double d = sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
		if(d>a.r+b.r){
			cout<<0<<endl;
		}else if(a.r+d<b.r){
			cout<<-2<<endl;
		}else if(b.r+d<a.r){
			cout<<2<<endl;
		}else{
			cout<<1<<endl;
		}
	}
	return 0;
}