import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;
import std.math;

void main()
{
    foreach(_;0..readln().chomp().to!int())
    {
        auto m = readln().split().map!(to!real);
        immutable xa=m[0], ya=m[1], ra=m[2], xb=m[3], yb=m[4], rb=m[5];
        immutable d = hypot(xa-xb,ya-yb);
        if(ra>rb+d) writeln(2);
        else if(ra+d<rb) writeln(-2);
        else if(ra+rb<d) writeln(0);
        else writeln(1);
    }
}