// 標準入力
var fs = require('fs'),
length = fs.fstatSync(process.stdin.fd).size,
buffer = new Buffer(length),
bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
input = buffer.toString('utf8', 0, bytesRead).split('\n');
main();

function main(){
  for(var i = 1, len = input[0] - 0; i <=len; i++){
    var c = input[i].split(' ');
    var xa = +c[0], ya = +c[1], ra = +c[2], xb = +c[3], yb = +c[4], rb = +c[5];

    var r = Math.sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));

    if(r > ra + rb){
      console.log(0);
    }else if(r < ra - rb){
      console.log(2);
    }else if(r < rb - ra){
      console.log(-2);
    }else{
      console.log(1);
    }
    
    
  }

}
     