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

void main()
{
  int n = to!(int)(chomp(readln()));
  int result;

  for (int i = 0; i < n; i++) {
    double[6] a;
    string[] input = split(readln());
    for (int j = 0; j < 6; j++) {
      a[j] = to!(double)(input[j]);
    }
    double dp = (a[0] - a[3]) * (a[0] - a[3]);
    double r = (a[2] + a[5]) * (a[2] + a[5]);
    double dr = (a[2] - a[5]) * (a[2] - a[5]);

    if (dp > r) {
      result = 0;
    } else if (dp < dr) {
      if (a[2] > a[5]) result = 2;
      else result = -2;
    } else {
      result = 1;
    }

    writeln(result);
  }
}