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

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)

double sqr(double x, double y){
	return x*x + y*y;
}
int main(){
	int n;
	double xa,ya,ra,xb,yb,rb;
	scanf("%d",&n);
	rep(i,n){
		scanf("%lf %lf %lf %lf %lf %lf",
					&xa,&ya,&ra,&xb,&yb,&rb);
		double z = sqrt(sqr(xa-xb,ya-yb));
		//printf("z:%lf   ra+rb:%lf\n",z,ra+rb);
		if( z > ra+rb ){
			puts("0");
		}else{
			if( z > ra && z > rb ){
				puts("1");
			}else if( z-ra<0 ){
				puts("2");
			}else{
				puts("-2");
			}
		}
	}
	return 0;
}