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

using namespace std;

const double eps=1e-10;

int main()
{
	int n;
	cin>>n;

	for(int i=0;i<n;i++){
		double xa,ya,ra,xb,yb,rb;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		double d2=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
		double r2=(ra+rb)*(ra+rb);

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


	return 0;
}