#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main(){
	int n;
	int out[1000];
	cin >> n;
	for(int i = 0; i < n; i++){
		double t;
		bool irekae = {false};
		double xa, ya, ra, xb, yb, rb;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		t = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
		if((ra+rb) < t){
			out[i] = 0;
			continue;
		}
		if(ra < rb){
			swap(xa,xb);
			swap(ya,yb);
			swap(ra,rb);
			irekae = {true};
		}
		if(t+rb < ra){
			if(irekae == true){
				out[i] = -2;
				continue;
			}
			else{
				out[i] = 2;
				continue;
			}
		}
		else{
			out[i] = 1;
		}
	}
	for(int i = 0; i < n; i++){
		cout << out[i] << endl;
	}
}