#include	<iostream>
#include	<cstdio>

using namespace std;

int main(void) {
	int ds;
	cin >> ds;
	
	for(int i = 0; i < ds; i++) {
		double d, r1[3], r2[3];
		for(int j = 0; j < 3; j++)
			cin >> r1[j];
		for(int j = 0; j < 3; j++)
			cin >> r2[j];
		
		d = (r2[0] - r1[0]) * (r2[0] - r1[0]) + (r2[1] - r1[1]) * (r2[1] - r1[1]);
		
		if( d < abs(r1[2] - r2[2]) ) {
			cout << "2" << endl;
		}else if( d < abs(r2[2] - r1[2]) ) {
			cout << "-2" << endl;
		}else if( (abs(r1[2] - r2[2]) < d && d < r1[2] + r2[2]) || d == r1[2] + r2[2] ) {
			cout << "1" << endl;
		}else {
			cout << "0" << endl;
		}
	}
	return 0;
}