#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;

void Solution()
{
    int n;
    
    cin>>n;
    
    while(n--)
    {
        float xa, ya, ra;
        float xb, yb, rb;
        float d;
        
        cin>>xa>>ya>>ra>>xb>>yb>>rb;
        
        d = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); // distance of o1 and o2
        
        if (fabs(d < ra - rb) && (ra > rb))
        {
            cout<<2<<endl;
        }
        else if (fabs(d < ra - rb) && (ra < rb))
        {
            cout<<-2<<endl;
        }
//        else if (fabs(d > ra - rb) && (d < ra + rb))
//        {
//            cout<<"1"<<endl;
//        }
        else if (d > ra + rb)
        {
            cout<<0<<endl;
        }
        else
        {
            cout<<1<<endl;
        }
    }
}

int main()
{
    Solution();
    return 0;
}