$<.readlines.drop(1).map {|a| a.split.map(&:to_f)}.each do |xa, ya, ra, xb, yb, rb|
  l = Math.sqrt((xb - xa) ** 2 + (yb - ya) ** 2)
  r = ra - rb
  puts case
       when l < r  then 2
       when l < -r then -2
       when l > ra + rb then 0
       else 1
       end
end
