#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;

double tb(double n){
	return n * n;
}
int main(void){

int nm,ans;
double xa,ya,ra,xb,yb,rb;
	while(cin >> nm){
		
//		if(nm == 0) break;
		rep(i,nm){
			cin >> xa >> ya >> ra;
			cin >> xb >> yb >> rb;
			
			if(tb(xa-xb) + tb(ya-yb) > tb(ra+rb)) ans = 0;
			else if(tb(rb) + tb(xa-xb) + tb(ya-yb) < tb(ra)) ans = 2;
			else if(tb(ra) + tb(xa-xb) + tb(ya-yb) < tb(rb)) ans = -2;
			else ans = 1;
			cout << ans << endl;
		}
	}
	return 0;
}