def relation(xa, ya, ra, xb, yb, rb)
    d = ((xa - xb) ** 2 + (ya - yb) ** 2) ** 0.5

    case
    when ra + rb < d; 0
    when d + rb < ra; 2
    when d + ra < rb; -2
    else 1
    end
end

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