#include <bits/stdc++.h>
using namespace std;

constexpr double EPS = 1e-9;

struct circle {
	double x, y, r;
	circle(double x_ = 0.0, double y_ = 0.0, double r_ = 0.0):x(x_), y(y_), r(r_) {}
};

istream &operator>>(istream &is, circle &c) {
	return is >> c.x >> c.y >> c.r;
}

// Is b in a
bool in(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return b.r + EPS < a.r && d + EPS < a.r - b.r;
}

bool intersect(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return d < a.r + b.r + EPS && d + EPS > abs(a.r - b.r);
}

int solve() {
	circle a, b;
	cin >> a >> b;

	if(in(a, b)) return 2;
	if(in(b, a)) return -2;
	if(intersect(a, b)) return 1;
	return 0;
}

int main() {
	int t;
	cin >> t;

	while(t--) cout << solve() << endl;

	return EXIT_SUCCESS;
}