import std.stdio;
import std.conv;
import std.string;

void main()
{
  int n = to!(int)(chomp(readln()));
  int result;
  double xa, ya, ra, xb, yb, rb;

  for (int i = 0; i < n; i++) {
    readf("%f %f %f %f %f %f\n", &xa, &ya, &ra, &xb, &yb, &rb);
    double dp = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
    double r = (ra + rb) * (ra + rb);
    double dr = (ra - rb) * (ra - rb);

    if (dp > r) {
      result = 0;
    } else if (dp < dr) {
      if (ra > rb) result = 2;
      else result = -2;
    } else {
      result = 1;
    }

    writeln(result);
  }
}