#include <algorithm>
#include <cmath>
#include <ctime>
#include <climits>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cstring>
#include <tuple>
#include <bitset>
#include <unordered_map>
using namespace std;
typedef long long ll;
int main() {
    int n;
    cin >> n;
    double x1, y1, x2, y2, x3, y3;
    for (int i=0; i<n; ++i) {
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        if (y1 == y2) {
            swap(x2, x3);
            swap(y2, y3);
        } else if (y2 == y3) {
            swap(x1, x2);
            swap(y1, y2);
        }
        double a = (x1 - x2) / (y1 - y2) * (-1);
        double b = (y1 - y2) / 2 - (x1 - x2) / 2 * a;
        double c = (x2 - x3) / (y2 - y3) * (-1);
        double d = (y2 - y3) / 2 - (x2 - x3) / 2 * a;
        double px = (a - b) / (c - a);
        double py = (a * d - b * c) / (c - a);
        double r = hypot(x1 - px, y1 - py);
        cout.precision(3);
        cout << fixed << px << " " << py << " " << r << endl;
    }
    return 0;
}