#include<iostream>
#include<cmath>
using namespace std;

int main() {
  double n, xa, ya, ra, xb, yb, rb;
  double x, y, xx, rr, rr2;
  cin >> n;
  while(n--) {
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    x = xb - xa; y = yb - ya;
    xx = x*x + y*y;
    rr = rb - ra; rr = rr*rr;
    rr2 = rb + ra; rr2 = rr2*rr2;
    if(xx<rr) {
      if(rb<ra) {
        cout << "2" << endl;
      }else {
        cout << "-2" << endl;
      }
    }else if(xx<=rr2 && rr<=xx) {
      cout << "1" << endl;
    }else {
      cout << "0" << endl;
    }
  }
  return 0;
}