#include<cstdio>
#include<cmath>
#include<iostream>

using namespace std;

int main(void){

	double xa,ya,ra,xb,yb,rb;
	double xs,ys,rw;
	int n;

	cin>>n;

	for(int i=0;i<n;i++){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		xs=xa-xb;
		ys=ya-yb;
		rw=ra+rb;
		if(xs*xs+ys*ys>rw*rw) cout<<"0"<<endl;
		else if(sqrt(xs*xs+ys*ys)+rb<ra) cout<<"2"<<endl;
		else if(sqrt(xs*xs+ys*ys)+ra<rb) cout<<"-2"<<endl;
		else cout<<"1"<<endl;
	}
	return 0;
}