#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int n;
	double x1, x2, y1, y2, r1, r2, u;
	while(cin>>n && n){
		while(n--){
			cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
			u = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
			
			if(r1+r2 > u){
				if(r1 > u && r2 > u){
					if(r1 == r2){
						cout << 1 << endl;
					} else if(r1 > r2){
						cout << 2 << endl;
					} else {
						cout << -2 << endl;
					}
				} else if(r1 > u && r2 <= u){
					cout << 2 << endl;
				} else {
					cout << -2 << endl;
				}
			} else if(r1+r2 == u){
				cout << 1 << endl;
			} else {
				cout << 0 << endl;
			}
		}
	}
	
	return 0;
}