def relation(xa, ya, ra, xb, yb, rb)
    d2 = ((xa - xb) ** 2 + (ya - yb) ** 2)
    return 0 if (ra + rb) ** 2 < d2
    
    d = d2 ** 0.5
    return 2 if d + rb <= ra
    return -2 if d + ra <= rb
    return 1
end

$<.gets.to_i.times do
    p relation(*$<.gets.split.map(&:to_r))
end