#include <bits/stdc++.h>
#define int long long
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF (((ll)1<<31)-1)
#define eps LDBL_EPSILON
#define moder (1000000007)
#define pie 3.141592653589793238462643383279
#define P std::pair<int,int>
#define prique priority_queue
#define ggr getchar();getchar();return 0;
using namespace std;
int n;
long double a,b,c,d,e,f;
signed main(){
	cin>>n;
	rep(i,n){
		cin>>a>>b>>c>>d>>e>>f;
		if(hypot(a-d,b-e)>c+f)cout<<0<<endl;
		else if(hypot(a-d,b-e)<c-f)cout<<2<<endl;
		else if(hypot(a-d,b-e)<f-c)cout<<-2<<endl;
		else cout<<1<<endl;
	}
	return 0;
}
