
import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.math;

alias Tuple!(double, "x", double, "y", double, "r") Circle;

double dist(Circle a, Circle b) {
  return sqrt(pow((a.x - b.x), 2) + pow((a.y - b.y), 2));
}

int is_overlap(Circle a, Circle b) {
  double d = dist(a, b);
  if (d > a.r + b.r) return 0;
  else if (d + b.r < a.r) return 2;
  else if (d + a.r < b.r) return -2;
  else return 1;
}

void main() {
  uint n = readln.chomp.to!(uint);
  foreach(t; 0..n) {
    double[] line = readln.chomp.split(" ").map!(to!(double)).array;
    auto c1 = Circle(line[0], line[1], line[2]);
    auto c2 = Circle(line[3], line[4], line[5]);
    is_overlap(c1, c2).writeln;
  }
}