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