#include<iostream>
#include<algorithm>
using namespace std;

int d(int x1,int y1,int x2,int y2) {
    int k;
    k = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
    return k;
}
int main()
{
    int n;
    cin >> n;
    for (int k = 0; k < n; k++) {
        int A[3][2];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 2; j++) {
                cin >> A[i][j];
            }
        }
        cout << d(A[0][0], A[0][1], A[1][0], A[1][1]) << endl;
        cout << d(A[1][0], A[1][1], A[2][0], A[2][1]) << endl;
        cout << d(A[2][0], A[2][1], A[0][0], A[0][1]) << endl;
    }
    
    return 0;
}