#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {

  double xa,ya,ra;
  double xb,yb,rb;

  int n;
  
  double d,diff;
  int i;


  scanf("%d",&n);

  for(i=0;i<n;i++) {

    scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);

    d=sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));

    diff=fabs(rb-ra);

    if(d>ra+rb) printf("0\n");

    else if(d<ra+rb && d>diff) printf("1\n");

    else if(ra>rb) printf("2\n");

    else if(rb>ra) printf("-2\n");

  }

  return 0;

}