#include<iostream>
using namespace std;
int main(){
	int c;
	double ax,ay,ar,bx,by,br;
	cin>>c;
	for(int i=0;i<c;i++){
		cin>>ax>>ay>>ar>>bx>>by>>br;
		if((ax+ar>bx+br&&ax-ar<bx-br) && (ay+ar>by+br&&ay-ar<by-br))
			cout<<"2";
		else if((bx+br>ax+ar&&bx-br<ax-ar) && (by+br>ay+ar&&by-br<ay-ar))
			cout<<"-2";
		else if(!(ax+ar>bx-br&&bx+br>ax-ar)&&!(bx+br>ax-ar&&ax+ar>bx-br))
			cout<<"0";
		else cout<<"1";
	cout <<endl;	
	}				
}