gets.to_i.times do
  xa, ya, ra, xb, yb, rb = gets.split(" ").map(&:to_f)
  l = Math.sqrt((xa - xb)**2 + (ya - yb)**2)
  if ra + rb < l
    puts "0"
  elsif (ra - rb).abs <= l and l <= ra + rb
    puts "1"
  elsif ra > rb
    puts "2"
  elsif ra < rb
    puts "-2"
  end
end