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