/*
 * Problem     : AOJ0010
 * Title       : A New Plan of Aizu Ski Resort (会津山スキー場の新企画)
 * Author      : mizo0203
 * Copyright   : Your copyright free
 * Description : 外接円の中心座標を計算する
 */

#include <stdio.h>
#include <math.h>
using namespace std;

int n;
double x[3], y[3], xp, yp, r;

void init() {
  scanf("%d", &n);
}

bool input() {
  int i;

  if (!n)
    return false;
  n--;

  for (i = 0; i < 3; i++) {
    scanf("%lf %lf", &x[i], &y[i]);
  }

  return true;
}

int main() {
  double A1, B1, C1, A2, B2, C2;
  init();
  while (input()) {
    A1 = 2 * (x[1] - x[0]);
    B1 = 2 * (y[1] - y[0]);
    C1 = x[0] * x[0] - x[1] * x[1] + y[0] * y[0] - y[1] * y[1];
    A2 = 2 * (x[2] - x[0]);
    B2 = 2 * (y[2] - y[0]);
    C2 = x[0] * x[0] - x[2] * x[2] + y[0] * y[0] - y[2] * y[2];
    xp = (B1 * C2 - B2 * C1) / (A1 * B2 - A2 * B1);
    yp = (C1 * A2 - C2 * A1) / (A1 * B2 - A2 * B1);
    r = sqrt((x[0] - xp) * (x[0] - xp) + (y[0] - yp) * (y[0] - yp));
    printf("%.3f %.3f %.3f\n", xp, yp, r);
  }

  return 0;
}