#include <iostream>
int main()
{
  int n;
  double xa, ya, ra, xb, yb, rb;
  std::cin >> n;
  while (n--) {
    std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double d = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
    if (d - (ra + rb) * (ra + rb) > 0) {
      std::cout << 0 << std::endl;
    } else if (d < (ra * ra > rb * rb ? ra: rb)) {
      if (ra < rb) {
        std::cout << -2 << std::endl;
      } else if (ra > rb) {
        std::cout << 2 << std::endl;
      }
    } else {
      std::cout << 1 << std::endl;
    }
  }
}