#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        double A[2], B[2], C1[2], C2[2], D[2], CD[2];
        cin >> A[0] >> A[1] >> B[0] >> B[1];
        D[0] = (A[0] + B[0]) / 2;
        D[1] = (A[1] + B[1]) / 2;
        double AB = sqrt((A[0] - B[0]) * (A[0] - B[0]) + (A[1] - B[1]) * (A[1] - B[1]));
        double AD = AB / 2;
        double DC = sqrt(3) * AD;
        if (A[0] == B[0]) {
            C1[0] = D[0] + DC;
            C1[1] = D[1];
            C2[0] = D[0] - DC;
            C2[1] = D[1];
        }
        if (A[1] == B[1]) {
            C1[0] = D[0];
            C1[1] = D[1] + DC;
            C2[0] = D[0];
            C2[1] = D[1] - DC;
        }
        if (A[0] != B[0] && A[1] != B[1]) {
            double K1 = (A[1] - B[1]) / (A[0] - B[0]);
            double K2 = -1 / K1;
            C1[0] = D[0] + DC / sqrt(1 + K2 * K2);
            C1[1] = D[1] + K2 * (C1[0] - D[0]);
            C2[0] = D[0] - DC / sqrt(1 + K2 * K2);
            C2[1] = D[1] + K2 * (C2[0] - D[0]);
        }
        if (C1[0] < C2[0]) {
            cout << fixed << setprecision(2) << C1[0] << " " << C1[1] << " " << C2[0] << " "
                 << C2[1] << endl;
        } else if (C1[0] > C2[0]) {
            cout << fixed << setprecision(2) << C2[0] << " " << C2[1] << " " << C1[0] << " "
                 << C1[1] << endl;
        }
        if (C1[0] == C2[0]) {
            if (C1[1] < C2[1]) {
                cout << fixed << setprecision(2) << C1[0] << " " << C1[1] << " " << C2[0] << " "
                     << C2[1] << endl;
            } else {
                cout << fixed << setprecision(2) << C2[0] << " " << C2[1] << " " << C1[0] << " "
                     << C1[1] << endl;
            }
        }
    }
    return 0;
}