import std.math, 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)
    {
        auto s = readln.split.map!(to!double);
        isOverlap(C(s[0], s[1], s[2]), C(s[3], s[4], s[5])).writeln;
    }
}

int isOverlap(C a, C b)
{
    double d = sqrt((a.x - b.x) ^^ 2  +  (a.y - b.y) ^^ 2);
    if(d > a.r + b.r) return 0;
    else if(d + b.r < a.r) return 2;
    else if(d + a.r < b.r) return -2;
    else return 1;
}