#include <iostream>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

#define rep(i, n)      for (int i=0; i<int(n); i++)
#define rep3(i, s, n)  for (int i=int(s); i<int(n); i++)
#define rev_rep(i, n)  for (int i=int(n)-1; i>=0; i-=1)

int N;

int main() {
  cin >> N;
  rep(i, N) {
    double xa, ya, ra, xb, yb, rb;
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    double dist = sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb));
    int ans = 0;
    if (dist < ra+rb) ans = 1;
    if (ra > rb && dist <= ra-rb) ans =  2;
    if (ra < rb && dist <= rb-ra) ans = -2;
    cout << ans << "\n";
  }
  return 0;
}