#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <complex>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

#ifndef typeof
#define typeof __typeof__
#endif // typeof

#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(typeof((c).rbegin()) i = (c).rbegin(); i != (c).rend(); i++)
#define repby(i, a, b, step) for(typeof(b) i = (a); i < (b); i += (step))
#define repab(i, a, b) repby(i, (a), (b), 1)
#define rep(i, n) repab(i, 0, (n))
#define pb push_back
#define sz(c) int((c).size())

typedef pair<double, double> point;

struct line { // y = inc*x + c
  double inclination;
  double constant;
  bool xf; // if 0: y = c;
  bool yf; // if 0: x = c;
  line(double i, double c) : inclination(i), constant(c), xf(true), yf(true) {}
  line(double c, bool x, bool y) : constant(c), xf(x), yf(y) {}
};

double line_const(double inc, point &p) {
 return p.second - inc * p.first;
}

line make_line(point &p1, point &p2) {
  double inc;

  if (p2.first == p1.first)
    return line(p2.first, true, false);

  if (p2.second == p1.second)
    return line(p2.second, false, true);

  inc = (p2.second - p1.second) / (p2.first - p1.first);
  return line(inc, line_const(inc, p1));
}

line diagonal_line(line &l, point &p) {
  if (l.xf && l.yf) {
    double inc = -l.inclination;
    return line(inc, line_const(inc, p));
  } else {
    if (l.xf) {
      return line(p.second, false, true);
    } else {
      return line(p.first, true, false);
    }
  }
}

point middle_point(point &p1, point &p2) {
  double mx = (p1.first + p2.first) / 2;
  double my = (p1.second + p2.second) / 2;
  return point(mx, my);
}

point intersection_const(line l, line c)
{
  if (c.xf) {
    double x = c.constant;
    double y = l.inclination * x + l.constant;
    return point (x, y);
  } else {
    double y = c.constant;
    double x = (y - l.constant) / l.inclination;
    return point (x, y);
  }
}
point intersection(line l1, line l2)
{
  // y = inc1 * x + con1
  // y = inc2 * x + con2
  // inc2 * x + con2 = inc1 * x + con1
  if (l1.xf && l1.yf && l2.xf && l2.yf) {
    if (l2.inclination == l1.inclination) {
      cerr << "Error: Input is not a triangle" << endl;
      return point(0,0);
    }

    double x = (l1.constant - l2.constant) / (l2.inclination - l1.inclination);
    double y = l1.inclination * x + l1.constant;
    return point(x, y);
  } else if (l1.xf && l1.yf) { // l2: x = c || y = c
    return intersection_const(l1, l2);
  } else if (l2.xf && l2.yf) {
    return intersection_const(l2, l1);
  } else {
    if (l1.xf) {
      return point(l1.constant, l2.constant);
    } else {
      return point(l2.constant, l1.constant);
    }
  }
}

double point_distance(point p1, point p2)
{
  return sqrt(pow(p2.first - p1.first, 2) + pow(p2.second - p1.second, 2));
}

#define dbg(i) cout << #i << " " << i << endl;
void pcircle(point p1, point p2, point p3)
{
  line line12 = make_line(p1, p2);
  line line23 = make_line(p2, p3);
  point m12 = middle_point(p1, p2);
  point m23 = middle_point(p2, p3);
  line diag_line12 = diagonal_line(line12, m12);
  line diag_line23 = diagonal_line(line23, m23);

  point its = intersection(diag_line12, diag_line23);
  cout.setf(ios::fixed);
  cout.precision(3);
  cout << its.first << " " << its.second << " ";
  cout << point_distance(its, p1) << endl;
}

int main(int argc, char **argv)
{
  int n;
  double a, b, c, d, e, f;

  cin >> n;
  while (n--) {
    cin >> a >> b >> c >> d >> e >> f;
    pcircle(point(a, b), point(c, d), point(e, f));
  }

  return 0;
}