import std.stdio, std.string, std.conv, std.algorithm, std.math;

enum EPS = 1.0e-6;

void main()
{
    foreach(_; 0 .. readln.chomp.to!int)
    {
        auto inp = readln.split.map!(to!real);
        real x1 = inp[0], y1 = inp[1],
             x2 = inp[2], y2 = inp[3],
             x3 = inp[4], y3 = inp[5];
        real mx1 = (x1 + x2) / 2, my1 = (y2 + y3) / 2,
             mx2 = (x2 + x3) / 2, my2 = (y2 + y3) / 2;
        real dx1 = x2 - x1, dy1 = y2 - y1,
             dx2 = x3 - x2, dy2 = y3 - y2;
        real ddx1 = -dy1, ddy1 = dx1,
             ddx2 = -dy2, ddy2 = dx2;
        real m1 = ddy1 / ddx1, m2 = ddy2 / ddx2;
        real x, y, r;
        if(!m1.isFinite)
        {
            x = mx1;
            y = m2 * (x - mx2) + my2;
        }
        else if(!m2.isFinite)
        {
            x = mx2;
            y = m1 * (x - mx1) + my1;
        }
        else
        {
            x = (m1 * mx1 - m2 * mx2 - (my1 - my2)) / (m1 - m2);
            y = m1 * (x - mx1) + my1;
        }
        r = sqrt((x1 - x) ^^ 2 + (y1 - y) ^^ 2);
        writefln("%.3f %.3f %.3f", x, y, r);
    }
}