#include <iostream>
using namespace std;

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		double xa, ya, ra;
		double xb, yb, rb;
		cin >> xa >> ya >> ra
			>>xb >> yb >> rb;
		double dis = (xb - xa) * (xb - xa) + (yb - ya) * (yb - ya);
		if(ra > rb && ((ra - rb) * (ra - rb) >= dis)){
			cout << 2 << endl;
		}else if(rb > ra && ((rb - ra) * (rb - ra) >= dis)){
			cout << -2 << endl;
		}else if(((ra + rb) * (ra + rb)) >= dis){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
	return 0;
}