#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main(void){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
	double x[2],y[2],r[2],h;
		for(int j=0;j<2;j++){
			cin>>x[j]>>y[j]>>r[j];
		}
		h=hypot(abs(x[0]-x[1]),abs(y[0]-y[1]));
		if(r[1]+h<r[0])puts("2");
		else if(r[0]+h<r[1])puts("-2");
		else if(h<=r[0]+r[1])puts("1");
		else puts("0");
	}
}
