#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 * ra) >= (dis + rb)){
			cout << 2 << endl;
		}else if((rb * rb) >= (dis + ra)){
			cout << -2 << endl;
		}else if((ra + rb) >= dis){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
	return 0;
}