#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 d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		double r=(ra+rb);

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


	return 0;
}