n = gets.to_i
n.times do
    xa, ya, ra, xb, yb, rb = gets.split.map(&:to_f)
    d = Math::hypot(xa - xb, ya - yb)
    if d < ra - rb
        puts 2
    elsif d < rb - ra
        puts -2
    elsif d > ra + rb
        puts 0
    else
        puts 1
    end
end
