#! -*- coding:utf-8 -*-
import math
n = input()
for x in xrange(n):
    x1,y1,x2,y2,x3,y3 = map(float,raw_input().split())
    a1 = 2.0*(x2-x1)
    b1 = 2.0*(y2-y1)
    x12 = x1**2
    y12 = y1**2
    c1 = x12-x2**2+y12+y2**2
    a2 = 2.0*(x3-x1)
    b2 = 2.0*(y3-y1)
    c2 = x12-x3**2+y12-y3**2
    denom=(a1*b2-a2*b1)
    x = (b1*c2-b2*c1)/denom
    y = (c1*a2-c2*a1)/denom
    r = math.sqrt((x-x1)**2+(y-y1)**2)

    print "%.3f %.3f %.3f"%(x,y,r)