import std.stdio, std.getopt, std.random, std.range, std.string, std.conv;
import std.algorithm, std.container, std.datetime;
import std.complex, std.math, std.typecons;

//alias P = Complex!(double);
//alias Cir = Tuple!(P, double);
alias Complex!(double) P;
alias Tuple!(P, double) Cir;
double norm(P x) {
    return x.re*x.re+x.im*x.im;
}

double cross(P x, P y) {
    return (conj(x)*y).im;
}

Cir curcumCircle(ref P a, ref P b, ref P c) {
    double s = cross(b-a, b-c);
    double A = norm(b-c), B = norm(c-a), C = norm(a-b);
    //writeln(A, " ", B, " ", C);
    //writeln(s);
    return Cir((A*(B+C-A)*a+B*(C+A-B)*b+C*(A+B-C)*c)/(4*s*s), sqrt(A*B*C/(4*s*s)));
}

int main() {
    int n;
    readf("%d\n", &n);
    foreach (i; 0..n) {
        auto d = readln().split().map!(s => to!double(s)).array;
        P[3] k = [P(d[0],d[1]), P(d[2],d[3]), P(d[4],d[5])];
        auto c = curcumCircle(k[0], k[1], k[2]);
        writef("%.3f %.3f %.3f\n", c[0].re, c[0].im, c[1]);
    }
    return 0;
}