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

int main(){
	int n;
	scanf(" %d", &n);
	for(int i=0; i<n; ++i){
		double xa, ya, ra, xb, yb, rb;
		scanf(" %lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
		double dist=sqrt( pow(xb-xa, 2) + pow(yb-ya, 2) );
		
		int ans;
		if(dist>ra+rb) ans=0;
		else if(dist==ra+rb || dist==fabs(ra-rb)) ans=1;
		else{
			if(rb>ra) ans=-2;
			else ans=2;
		}
		
		printf("%d\n", ans);
	}
}