#include <iostream>
#include <cmath>

using namespace std;

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