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