#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <cmath>	// require fabs, sqrt
using namespace std;

int main()
{
	string str = "";
	int n;

	getline (cin, str );
	stringstream ssn(str);
	ssn >> n;

	for (int i = 0; i < n; ++i){
		getline (cin, str );
		vector <double> cx (2, 0.0), cy (2, 0.0), r (2, 0.0);
		stringstream ss(str);

		ss >> cx[0] >> cy[0] >> r[0] >> cx[1] >> cy[1] >> r[1];
		double d = sqrt ( (cx[1] - cx[0])*(cx[1] - cx[0]) + (cy[1] - cy[0])*(cy[1] - cy[0]) );

		if (d >= 0 && d < fabs (r[1] - r[0])){
			if (r[0] > r[1]){		// B in A
				cout << "2" << endl;
			}else if (r[0] < r[1]){	// A in B
				cout << "-2" << endl;
			}else{
				cout << "1" << endl;
			} // end if
		}else if ( ( d >= fabs(r[1] - r[0]) ) && ( d <= r[0] + r[1] ) ){
			cout << "1" << endl;
		}else{
			cout << "0" << endl;
		} // end if
	} // end for
		
	return 0;
}