#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
using namespace std;

int main(){

  int n;
  cin >> n;
  for(int i=0; i<n; i++){
    double xa, ya, ra;
    double xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;

    int ans = 0;

    if( ra*ra > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + rb*rb ) ans = 2;
    else if( rb*rb > (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) + ra*ra ) ans = -2;
    else if( (ra*ra)+(rb*rb) >= (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) ans = 1;


    cout << ans << endl;
  }

  return 0;
}