#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)

static const double PI=6*asin(0.5);
typedef complex<double> P;
typedef long long ll;

double xa,ya,ra,xb,yb,rb;
int n;

double dist(P a,P b){
	return sqrt(real(a-b)*real(a-b)+imag(a-b)*imag(a-b));
}

int main(){
	cin>>n;
	rep(i,n){
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		P a(xa,ya), b(xb,yb);
		double r=dist(a,b);
		if(ra+rb<r) cout<<0<<endl;
		else if(ra>=rb+r) cout<<2<<endl;
		else if(rb>=ra+r) cout<<-2<<endl;
		else if(ra+rb>=r) cout<<1<<endl;
		
	}
	return 0;
}