import fractions





def calc(x1, y1, x2, y2):

    return 2 * (x2 - x1), 2 * (y2 - y1), x2 ** 2 + y2 ** 2 - x1 ** 2 - y1 ** 2





n = int(eval(input()))

for _ in range(n):

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

    cx1, cy1, z1 = calc(x1, y1, x2, y2)

    cx2, cy2, z2 = calc(x1, y1, x3, y3)

    gcd = fractions.gcd(cx1, cx2)

    r1, r2 = cx2 // gcd, cx1 // gcd

    dcy = r1 * cy1 - r2 * cy2

    dz = r1 * z1 - r2 * z2

    y = dz / dcy

    x = (z1 - cy1 * y) / cx1 if cx1 else (z2 - cy2 * y) / cx2

    r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5

    print(('{:.3f} {:.3f} {:.3f}'.format(x, y, r)))
def calc(x1, y1, x2, y2):

    return 2 * (x2 - x1), 2 * (y2 - y1), x2 ** 2 + y2 ** 2 - x1 ** 2 - y1 ** 2





n = int(eval(input()))

for _ in range(n):

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

    cx1, cy1, z1 = calc(x1, y1, x2, y2)

    cx2, cy2, z2 = calc(x1, y1, x3, y3)

    dcy, dz = cx2 * cy1 - cx1 * cy2, cx2 * z1 - cx1 * z2

    y = dz / dcy

    x = (z1 - cy1 * y) / cx1 if cx1 else (z2 - cy2 * y) / cx2

    r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5

    print(('{:.3f} {:.3f} {:.3f}'.format(x, y, r)))
import fractions


def calc(x1, y1, x2, y2):
    return 2 * (x2 - x1), 2 * (y2 - y1), x2**2 + y2**2 - x1**2 - y1**2


n = int(eval(input()))
for _ in range(n):
    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))
    cx1, cy1, z1 = calc(x1, y1, x2, y2)
    cx2, cy2, z2 = calc(x1, y1, x3, y3)
    gcd = fractions.gcd(cx1, cx2)
    r1, r2 = cx2 // gcd, cx1 // gcd
    dcy = r1 * cy1 - r2 * cy2
    dz = r1 * z1 - r2 * z2
    y = dz / dcy
    x = (z1 - cy1 * y) / cx1 if cx1 else (z2 - cy2 * y) / cx2
    r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5
    print(("{:.3f} {:.3f} {:.3f}".format(x, y, r)))

def calc(x1, y1, x2, y2):
    return 2 * (x2 - x1), 2 * (y2 - y1), x2**2 + y2**2 - x1**2 - y1**2


n = int(eval(input()))
for _ in range(n):
    x1, y1, x2, y2, x3, y3 = list(map(float, input().split()))
    cx1, cy1, z1 = calc(x1, y1, x2, y2)
    cx2, cy2, z2 = calc(x1, y1, x3, y3)
    dcy, dz = cx2 * cy1 - cx1 * cy2, cx2 * z1 - cx1 * z2
    y = dz / dcy
    x = (z1 - cy1 * y) / cx1 if cx1 else (z2 - cy2 * y) / cx2
    r = ((x - x1) ** 2 + (y - y1) ** 2) ** 0.5
    print(("{:.3f} {:.3f} {:.3f}".format(x, y, r)))

-import fractions - - -    gcd = fractions.gcd(cx1, cx2) -    r1, r2 = cx2 // gcd, cx1 // gcd -    dcy = r1 * cy1 - r2 * cy2 -    dz = r1 * z1 - r2 * z2 +    dcy, dz = cx2 * cy1 - cx1 * cy2, cx2 * z1 - cx1 * z2