def calc(l):

	A1=2*(l[1][0]-l[0][0])

	B1=2*(l[1][1]-l[0][1])

	C1=l[0][0]**2-l[1][0]**2+l[0][1]**2-l[1][1]**2

	A2=2*(l[2][0]-l[0][0])

	B2=2*(l[2][1]-l[0][1])

	C2=l[0][0]**2-l[2][0]**2+l[0][1]**2-l[2][1]**2

	X=(B1*C2-B2*C1)/(A1*B2-A2*B1)

	Y=(C1*A2-C2*A1)/(A1*B2-A2*B1)

	R=((X-l[0][0])**2+(Y-l[0][1])**2)**0.5

	return tuple(map(round, [X,Y,R], [3]*3))

l=[list(zip(*[iter(map(float,input().split()))]*2)) for i in range(eval(input()))]

for ll in l:

	print("%.3f %.3f %.3f"%(calc(ll)))
def calc(a,b,c,d,e,f):

	A1=2*(c-a)

	B1=2*(d-b)

	C1=a**2-c**2+b**2-d**2

	A2=2*(e-a)

	B2=2*(f-b)

	C2=a*a-e*e+b*b-f*f

	X=(B1*C2-B2*C1)/(A1*B2-A2*B1)

	Y=(C1*A2-C2*A1)/(A1*B2-A2*B1)

	R=((X-a)**2+(Y-b)**2)**0.5

	return tuple(map(round, [X,Y,R], [3]*3))

l=[list(map(float,input().split())) for i in range(eval(input()))]

for ll in l:

	print("%.3f %.3f %.3f"%(calc(*ll)))
def calc(l):
    A1 = 2 * (l[1][0] - l[0][0])
    B1 = 2 * (l[1][1] - l[0][1])
    C1 = l[0][0] ** 2 - l[1][0] ** 2 + l[0][1] ** 2 - l[1][1] ** 2
    A2 = 2 * (l[2][0] - l[0][0])
    B2 = 2 * (l[2][1] - l[0][1])
    C2 = l[0][0] ** 2 - l[2][0] ** 2 + l[0][1] ** 2 - l[2][1] ** 2
    X = (B1 * C2 - B2 * C1) / (A1 * B2 - A2 * B1)
    Y = (C1 * A2 - C2 * A1) / (A1 * B2 - A2 * B1)
    R = ((X - l[0][0]) ** 2 + (Y - l[0][1]) ** 2) ** 0.5
    return tuple(map(round, [X, Y, R], [3] * 3))


l = [list(zip(*[iter(map(float, input().split()))] * 2)) for i in range(eval(input()))]
for ll in l:
    print("%.3f %.3f %.3f" % (calc(ll)))

def calc(a, b, c, d, e, f):
    A1 = 2 * (c - a)
    B1 = 2 * (d - b)
    C1 = a**2 - c**2 + b**2 - d**2
    A2 = 2 * (e - a)
    B2 = 2 * (f - b)
    C2 = a * a - e * e + b * b - f * f
    X = (B1 * C2 - B2 * C1) / (A1 * B2 - A2 * B1)
    Y = (C1 * A2 - C2 * A1) / (A1 * B2 - A2 * B1)
    R = ((X - a) ** 2 + (Y - b) ** 2) ** 0.5
    return tuple(map(round, [X, Y, R], [3] * 3))


l = [list(map(float, input().split())) for i in range(eval(input()))]
for ll in l:
    print("%.3f %.3f %.3f" % (calc(*ll)))

-def calc(l): -    A1 = 2 * (l[1][0] - l[0][0]) -    B1 = 2 * (l[1][1] - l[0][1]) -    C1 = l[0][0] ** 2 - l[1][0] ** 2 + l[0][1] ** 2 - l[1][1] ** 2 -    A2 = 2 * (l[2][0] - l[0][0]) -    B2 = 2 * (l[2][1] - l[0][1]) -    C2 = l[0][0] ** 2 - l[2][0] ** 2 + l[0][1] ** 2 - l[2][1] ** 2 +def calc(a, b, c, d, e, f): +    A1 = 2 * (c - a) +    B1 = 2 * (d - b) +    C1 = a**2 - c**2 + b**2 - d**2 +    A2 = 2 * (e - a) +    B2 = 2 * (f - b) +    C2 = a * a - e * e + b * b - f * f -    R = ((X - l[0][0]) ** 2 + (Y - l[0][1]) ** 2) ** 0.5 +    R = ((X - a) ** 2 + (Y - b) ** 2) ** 0.5 -l = [list(zip(*[iter(map(float, input().split()))] * 2)) for i in range(eval(input()))] +l = [list(map(float, input().split())) for i in range(eval(input()))] -    print("%.3f %.3f %.3f" % (calc(ll))) +    print("%.3f %.3f %.3f" % (calc(*ll)))