#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;
		if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) <= (ra + rb) && abs(rb - ra) <= sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya))) {
			cout << "1" << endl;
		}
		else if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) > (ra + rb)) {
			cout << "0" << endl;
		}
		else if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) < abs(rb - ra) && rb > ra) {
			cout << "-2" << endl;
		}
		else if (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) < abs(rb - ra) && ra > rb) {
			cout << "2" << endl;
			
		}
	}
	return 0;
}
