// class point	の練習（クラスの高度な実装）
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <vector>
#include <queue>


typedef long long llong;
using namespace std;

#define SMALL_LIMIT 1e-30

struct Point {
	double x;
	double y;
};
double dist(Point a, Point b) {
	return sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y));
}

int main() {
	int n;
	Point a, b;
	double ra, rb;
	double d;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.x >> a.y >> ra >> b.x >> b.y >> rb;
		d = dist(a, b);
		if (d + rb -ra< 0)cout << 2 << endl;
		else if (d + ra-rb <0)cout << -2 << endl;
		else if (0 >-d+ ra + rb)cout << 0 << endl;
		else cout << 1 << endl;

	}
	return 0;
}
 
