#include <iostream>
#include <cmath>

using namespace std;

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		double ax,ay,ar,bx,by,br;
		cin >> ax >> ay >> ar >> bx >> by >> br;
		double d = sqrt((ax-bx)*(ax-bx) + (ay-by)*(ay-by)); 
		if (ar > br && ar-d > br)
			cout << 2 << endl;
		else if (br > ar && br-d > ar)
			cout << -2 << endl;
		else if (d < ar+br)
			cout << 1 << endl;
		else
			cout << 0 << endl;
	}
	return 0;
}