#include <bits/stdc++.h>

using namespace std;

namespace arithmetic {
  template<typename T> class Addition {
  public:
    template<typename V> T operator+(const V& v) const {
      return T(static_cast<const T&>(*this)) += v;
    }
  };

  template<typename T> class Subtraction {
  public:
    template<typename V> T operator-(const V& v) const {
      return T(static_cast<const T&>(*this)) -= v;
    }
  };

  template<typename T> class Multiplication {
  public:
    template<typename V> T operator*(const V& v) const {
      return T(static_cast<const T&>(*this)) *= v;
    }
  };

  template<typename T> class Division {
  public:
    template<typename V> T operator/(const V& v) const {
      return T(static_cast<const T&>(*this)) /= v;
    }
  };

  template<typename T> class Modulus {
  public:
    template<typename V> T operator%(const V& v) const {
      return T(static_cast<const T&>(*this)) %= v;
    }
  };
}

template<typename T> class IndivisibleArithmetic : public arithmetic::Addition<T>, public arithmetic::Subtraction<T>, public arithmetic::Multiplication<T> {};

template<typename T> class Arithmetic : public IndivisibleArithmetic<T>, public arithmetic::Division<T> {};

template<typename T> class Ordered {
public:
  template<typename V> bool operator==(const V& v) const {
    return !(static_cast<T>(v) < static_cast<const T&>(*this) || static_cast<const T&>(*this) < static_cast<T>(v));
  }
  
  template<typename V> bool operator!=(const V& v) const {
    return static_cast<T>(v) < static_cast<const T&>(*this) || static_cast<const T&>(*this) < static_cast<T>(v);
  }

  template<typename V> bool operator>(const V& v) const {
    return static_cast<T>(v) < static_cast<const T&>(*this);
  }

  template<typename V> bool operator<=(const V& v) const {
    return !(static_cast<T>(v) < static_cast<const T&>(*this));
  }

  template<typename V> bool operator>=(const V& v) const {
    return !(static_cast<const T&>(*this) < static_cast<T>(v));
  }
};

template<typename T> inline T gcd(T a, T b) {
  return __gcd(a, b);
}

template<typename T> inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}

template<typename T> inline T floor(T a, T b) {
  return floor(a / b) * b <= a ? floor(a / b) : floor(a / b) - 1;
}

template<typename T> inline T ceil(T a, T b) {
  return floor(a + b - 1, b);
}

template<typename T> inline T round(T a, T b) {
  return floor(a + b / 2);
}

template<typename T> inline T mod(T a, T b) {
  return a - floor(a, b) * b;
}

template<typename T> inline T factorial(T n) {
  return n <= 1 ? 1 : factorial(n - 1) * n;
}

template<typename T> inline T square(T n) {
  return n * n;
}

template<typename T> inline T cube(T n) {
  return n * n * n;
}

template<typename T> inline T norm(T x1, T y1, T x2, T y2) {
  return square(x1 - x2) + square(y1 - y2);
}

inline long long sqrt(long long n) {
  return sqrt((long double)n);
}

class Real : public Arithmetic<Real>, public arithmetic::Modulus<Real>, public Ordered<Real> {
private:
  long double val;

  operator long double() const {
    return val;
  }

public:
  static long double EPS;
  static int precision;

  Real() {}

  Real(long double val) : val(val) {}

  Real operator-() const {
    return -val;
  }

  template<typename T> Real operator+=(const T& r) {
    val += static_cast<long double>(r);
    return *this;
  }

  template<typename T> Real operator-=(const T& r) {
    val -= static_cast<long double>(r);
    return *this;
  }

  template<typename T> Real operator*=(const T& r) {
    val *= static_cast<long double>(r);
    return *this;
  }

  template<typename T> Real operator/=(const T& r) {
    val /= static_cast<long double>(r);
    return *this;
  }

  template<typename T> Real operator%=(const T& r) {
    return *this = mod(*this, static_cast<Real>(r));
  }

  template<typename T> Real operator-(const T& v) const {
    return Real(*this) -= v;
  }

  template<typename T> Real operator*(const T& v) const {
    return Real(*this) *= v;
  }

  template<typename T> Real operator/(const T& v) const {
    return Real(*this) /= v;
  }

  template<typename T> bool operator<(const T r) const {
    return val < static_cast<long double>(r) - EPS;
  }

  Real abs() const {
    return std::abs(val);
  }

  Real sqrt() const {
    return std::sqrt(val);
  }

  long double toLongDouble() const {
    return val;
  }
};

long double Real::EPS = 1e-10;
int Real::precision = 15;

inline ostream& operator<<(ostream& os, const Real& a) {
  os << fixed << setprecision(Real::precision) << a.toLongDouble();
  return os;
}

inline istream& operator>>(istream& is, Real& a) {
	long double n;
	is >> n;
	a = n;
	return is;
}

Real floor(const Real& r) {
  return floor(r.toLongDouble());
}

class Point : public Arithmetic<Point>, public Ordered<Point> {
public:
  Real x, y;

  Point() {}

  Point(const Real& x) : x(x), y(0) {}

  Point(const Real& x, const Real& y) : x(x), y(y) {}

  Point operator+=(const Point& p) {
    x += p.x;
    y += p.y;
    return *this;
  }

  Point operator-=(const Point& p) {
    x -= p.x;
    y -= p.y;
    return *this;
  }

  Point operator*=(const Point& p) {
    Real xx = x * p.x - y * p.y;
    y = x * p.y + y * p.x;
    x = xx;
    return *this;
  }

  Point operator*=(const Real& r) {
    x *= r;
    y *= r;
    return *this;
  }

  Point operator/=(const Point& p) {
    Real nrm = p.norm();
    Real xx = (x * p.x + y * p.y) / nrm;
    y = (y * p.x - x * p.y) / nrm;
    x = xx;
    return *this;
  }

  Point operator/=(const Real& r) {
    x /= r;
    y /= r;
    return *this;
  }

  bool operator<(const Point& p) const {
    return (x == p.x) ? y < p.y : x < p.x;
  }

  Real norm() const {
    return x * x + y * y;
  }

  Real abs() const {
    return norm().sqrt();
  }

  Point conj() const {
    return Point(x, -y);
  }
};

inline Point operator*(const Real& real, const Point& point) {
  return point * real;
}

inline Point operator/(const Real& real, const Point& point) {
  return point / real;
}

inline ostream& operator<<(ostream& os, const Point& point) {
	os << point.x << " " << point.y;
	return os;
}

inline istream& operator>>(istream& is, Point& point) {
  Real x, y;
	is >> x >> y;
	point = Point(x, y);
	return is;
}

class Line {
public:
  Point a, b;

  Line() {}

  Line (const Point& a, const Point& b) : a(a), b(b) {}

  bool operator==(const Line& line) const {
    return ((line.vec() / vec()).y == 0) && (((line.a - a) / vec()).y == 0);
  }

  Point vec() const {
    return b - a;
  }
};

inline ostream& operator<<(ostream& os, const Line& line) {
	os << line.a << " " << line.b;
	return os;
}

inline istream& operator>>(istream& is, Line& line) {
  Point a, b;
  is >> a >> b;
  line = Line(a, b);
  return is;
}

inline Point crossPoint(const Line& line1, const Line& line2) {
  return line1.a + line1.vec() * ((line2.a - line1.a) / line2.vec()).y / (line1.vec() / line2.vec()).y;
}

class Triangle {
public:
  Point a, b, c;

  Triangle() {}

  Triangle (const Point& a, const Point& b, const Point& c) : a(a), b(b), c(c) {}

  Point circumcenter() const {
    Line s((a + b) / 2, (a + b) / 2 + (a - b) * Point(0, 1));
    Line t((a + c) / 2, (a + c) / 2 + (a - c) * Point(0, 1));
    return crossPoint(s, t);
  }
};

inline ostream& operator<<(ostream& os, const Triangle& triangle) {
	os << triangle.a << " " << triangle.b << " " << triangle.c;
	return os;
}

inline istream& operator>>(istream& is, Triangle& triangle) {
  Point a, b, c;
  is >> a >> b >> c;
  triangle = Triangle(a, b, c);
  return is;
}

void solve() {
  Triangle t;
  cin >> t;
  Point p = t.circumcenter();
  Real::precision = 3;
  cout << fixed << setprecision(3) << p << " " << (t.a - p).abs() << endl;
}

int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) solve();
}

Measured memory_bytes: 3252