#include <iostream>
#include <string>
#include<math.h>
using namespace std;
int main(){
    double xa,xb,ya,yb,ra,rb;
	double x;
	int n,w;
	cin>>n;
	for(int i=0;i<n;i++){
		w=0;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		x=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
		x=sqrt((double)x);
		if(ra+rb<x)
			w=0;
		else if(ra-rb>=x)
			w=2;
		else if(rb-ra>=x)
			w=-2;
		else
			w=1;
		cout<<w<<endl;
	}
	return 0;
}