#include <bits/stdc++.h>
#define PI 3.14159265359
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, x, y;
		x = abs(ax - bx);
		y = abs(ay - by);
		d = sqrt(x * x + y * y);

		int a = -100;
		if (d < abs(ar - br)) {
			if (ar > br) {
				a = 2;
			}
			else {
				a = -2;
			}
		}
		else if (d > (ar + br)) {
			a = 0;
		}
		else {
			a = 1;
		}

		cout << a << endl;
	}
}
