#include <iostream>
#include <cstdio>
using namespace std;
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 = (xb-xa)*(xb-xa)+(yb-ya)*(yb-ya);
		double e = (rb+ra)*(rb+ra);
		if(d<ra*ra) cout << 2 << endl;
		else if(d<rb*rb) cout << -2 << endl;
		else if(d<e) cout << 1 << endl;
		else cout << 0 << endl;
	}
}