def aux(xa,ya,ra,xb,yb,rb)
  x = Math.sqrt((xa-xb)**2+(ya-yb)**2)
  if x > ra+rb
    0
  elsif x >= (ra-rb).abs
    1
  elsif x < ra-rb
    2
  elsif x < rb-ra
    -2
  end
end

def main
  fh=STDIN
  #fh=File.new("x.txt", "r")
  n=fh.gets.chomp.to_i
  n.times {
    xa,ya,ra,xb,yb,rb = fh.gets.chomp.split.map(&:to_f)
    puts aux(xa,ya,ra,xb,yb,rb)
  }
end

if $0 == __FILE__ then
  main
end
