n = int(eval(input()))

for _ in range(n):

    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))

    a = pow(pow(x3-x2, 2) + pow(y3-y2, 2), 0.5)

    b = pow(pow(x1-x3, 2) + pow(y1-y3, 2), 0.5)

    c = pow(pow(x2-x1, 2) + pow(y2-y1, 2), 0.5)

    cosA = (b**2+c**2-a**2) / (2*b*c)

    sinA = 1-cosA**2

    r = a / pow(sinA, 0.5) / 2

    a, b, c = x1-x2, y1-y2, -(x1**2 + y1**2) + (x2**2 + y2**2)

    d, e, f = x2-x3, y2-y3, -(x2**2 + y2**2) + (x3**2 + y3**2)

    l = (c*e - b*f) / (e*a - b*d)

    m = (c*d - a*f) / (b*d - a*e)

    print(("{0:.3f} {1:.3f} {2:.3f}".format(-l/2, -m/2, r)))
n = int(eval(input()))

for _ in range(n):

    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))

    a = pow((x3-x2) ** 2 + (y3-y2) ** 2, 0.5)

    b = pow((x3-x1) ** 2 + (y3-y1) ** 2, 0.5)

    c = pow((x1-x2) ** 2 + (y1-y2) ** 2, 0.5)

    cosA = (b**2 + c**2 - a**2) / (2*b*c)

    sinA = pow(1 - cosA**2, 0.5)

    R = a / sinA / 2

    a, b, c = x1-x2, y1-y2, -(x1**2 + y1**2) + (x2**2 + y2**2)

    d, e, f = x2-x3, y2-y3, -(x2**2 + y2**2) + (x3**2 + y3**2)

    l = (c*e - b*f) / (e*a - b*d)

    m = (c*d - a*f) / (b*d - a*e)

    l, m = l*-0.5, m*-0.5

    print(("{:.3f} {:.3f} {:.3f}".format(l, m, R)))



n = int(eval(input()))
for _ in range(n):
    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))
    a = pow(pow(x3 - x2, 2) + pow(y3 - y2, 2), 0.5)
    b = pow(pow(x1 - x3, 2) + pow(y1 - y3, 2), 0.5)
    c = pow(pow(x2 - x1, 2) + pow(y2 - y1, 2), 0.5)
    cosA = (b**2 + c**2 - a**2) / (2 * b * c)
    sinA = 1 - cosA**2
    r = a / pow(sinA, 0.5) / 2
    a, b, c = x1 - x2, y1 - y2, -(x1**2 + y1**2) + (x2**2 + y2**2)
    d, e, f = x2 - x3, y2 - y3, -(x2**2 + y2**2) + (x3**2 + y3**2)
    l = (c * e - b * f) / (e * a - b * d)
    m = (c * d - a * f) / (b * d - a * e)
    print(("{0:.3f} {1:.3f} {2:.3f}".format(-l / 2, -m / 2, r)))

n = int(eval(input()))
for _ in range(n):
    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))
    a = pow((x3 - x2) ** 2 + (y3 - y2) ** 2, 0.5)
    b = pow((x3 - x1) ** 2 + (y3 - y1) ** 2, 0.5)
    c = pow((x1 - x2) ** 2 + (y1 - y2) ** 2, 0.5)
    cosA = (b**2 + c**2 - a**2) / (2 * b * c)
    sinA = pow(1 - cosA**2, 0.5)
    R = a / sinA / 2
    a, b, c = x1 - x2, y1 - y2, -(x1**2 + y1**2) + (x2**2 + y2**2)
    d, e, f = x2 - x3, y2 - y3, -(x2**2 + y2**2) + (x3**2 + y3**2)
    l = (c * e - b * f) / (e * a - b * d)
    m = (c * d - a * f) / (b * d - a * e)
    l, m = l * -0.5, m * -0.5
    print(("{:.3f} {:.3f} {:.3f}".format(l, m, R)))

-    a = pow(pow(x3 - x2, 2) + pow(y3 - y2, 2), 0.5) -    b = pow(pow(x1 - x3, 2) + pow(y1 - y3, 2), 0.5) -    c = pow(pow(x2 - x1, 2) + pow(y2 - y1, 2), 0.5) +    a = pow((x3 - x2) ** 2 + (y3 - y2) ** 2, 0.5) +    b = pow((x3 - x1) ** 2 + (y3 - y1) ** 2, 0.5) +    c = pow((x1 - x2) ** 2 + (y1 - y2) ** 2, 0.5) -    sinA = 1 - cosA**2 -    r = a / pow(sinA, 0.5) / 2 +    sinA = pow(1 - cosA**2, 0.5) +    R = a / sinA / 2 -    print(("{0:.3f} {1:.3f} {2:.3f}".format(-l / 2, -m / 2, r))) +    l, m = l * -0.5, m * -0.5 +    print(("{:.3f} {:.3f} {:.3f}".format(l, m, R)))