#include <math.h>
#include <iostream>
using namespace std;

int main() {
	int lop; cin >> lop;
	long double xa, ya, ra, xb, yb, rb;
	long double d;
	for (; lop > 0; lop--) {
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		d = (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb);
		if (d < ra * ra - 2 * ra*rb + rb * rb) {
			if (ra > rb)
				cout << 2 << endl;
			else
				cout << -2 << endl;
			continue;
		}
		if (d <= rb * rb + 2 * ra*rb + ra * ra) {
			cout << 1 << endl;
			continue;
		}
		cout << 0 << endl;
	}
	return 0;
}
