import std.stdio;
import std.string;
import std.math;
import std.conv;
import std.algorithm;
import std.bigint;

void main(){

    auto n = to!int(chomp(readln()));
    for(int i=0;i<n;i++){
	auto s = split(readln());
	real[] a;
	foreach(j;s) a ~= to!real(j);
	real R2 = (a[0] - a[3])*(a[0] - a[3]) + (a[1] - a[4])*(a[1] - a[4]);
	if(R2 > (a[2] + a[5])*(a[2] + a[5])) writeln("0");
	else if(R2 <= (a[2] + a[5])*(a[2] + a[5])){
	    if( sqrt(R2) + a[2] < a[5]) writeln("-2");
	    else if(sqrt(R2) + a[5] < a[2]) writeln("2");
	    else writeln("1");
	}
    }
}