#include <iostream>
#include <cmath>
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 dr = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if(ra >= rb+dr)
			cout << 2 << endl;
		else if(rb >= ra+dr)
			cout << -2 << endl;
		else if(dr < ra + rb)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}