#include <iostream>
#include <cmath>
using namespace std;

int main(void){
	int n;
	cin>>n;
	for (int i=0; i<n; i++){
		double xa, ya, ra, xb, yb, rb, r;
		cin>>xa>>ya>>ra>>xb>>yb>>rb;
		r=pow(pow((xa-xb),2)+pow(ya-yb,2),.5);
		if (r>ra+rb) cout<<0<<endl;
		else if (r<ra-rb) cout<<2<<endl;
		else if (r<rb-ra) cout<<-2<<endl;
		else cout<<1<<endl;
	}
	return 0;
}