#include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<sstream>
#include<functional>
#include<map>
#include<set>
#include<cmath>

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

#define EPS 1e-9

using namespace std;

int main(){

	int n;
	cin >>n;

	double xa,ya,ra,xb,yb,rb;
	rep(i,n){

	cin >> xa >> ya >> ra >> xb >> yb >> rb;

	double AB=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));

	if(AB>ra+rb) cout << 0 << endl;
	else if(AB<ra-rb) cout << 2 << endl;
	else if(AB<rb-ra) cout << -2 << endl;
	else  cout << 1 << endl;
	}


return 0;
}