//接する場合が未定義なのだが…
#include<iostream>
using namespace std;

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