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

struct C{ double x, y, r; }

void main()
{
    foreach(unused;0..readln.chomp.to!int)
    {
        C a, b;

        auto s = readln.split.map!(to!double);
        a.x = s[0]; a.y = s[1]; a.r = s[2];
        b.x = s[3]; b.y = s[4]; b.r = s[5];

        if((a.x - b.x) ^^ 2 + (a.y - b.y)  ^^ 2 >= (a.r + b.r) ^^ 2)
        {
            0.writeln;
        }
        else
        {
            if(a.r >= b.r && (a.x - b.x) ^^ 2 + (a.y - b.y)  ^^ 2 <= a.r - b.r)
            {
                2.writeln;
            }
            else if(a.r <= b.r && (a.x - b.x) ^^ 2 + (a.y - b.y)  ^^ 2 <= b.r - a.r)
            {
                (-2).writeln;
            }
            else 
            {
                1.writeln;
            }
        }
    }
}