def euclidean_distance(p1, p2)
  sum_of_squares = 0
  p1.each_with_index do |p1_coord, index|
    sum_of_squares += (p1_coord - p2[index]) ** 2
  end
  Math.sqrt(sum_of_squares)
end

gets.to_i.times do
  input = gets.split.map(&:to_f)
  center_a = input[0..1]
  radius_a = input[2]
  center_b = input[3..4]
  radius_b = input[5]

  distance = euclidean_distance(center_a, center_b)

  if distance > radius_a + radius_b
    puts "0" # A and B do not overlap
  elsif radius_a > radius_b + distance
    puts "2" # B is in A
  elsif radius_b > radios_a + distance
    puts "-2" # A is in B
  else
    puts "1" # A and B intersect
  end
end