#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main()
{
	int N;
	cin>>N;
	while(N--){
		int ans;
		double ax,ay,ar,bx,by,br;
		cin>>ax>>ay>>ar>>bx>>by>>br;
		double x;
		x=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
		if(x>(ar+br))ans=0;
		else if(abs(ar-br)<x&&x<=(ar+br))ans=1;
		else if(x<=abs(ar-br)&&ar>br)ans=2;
		else ans=-2;
		cout<<ans<<endl;
	}
    return 0;
}