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