#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
    int n;
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        double x1, y1, x2, y2, x3, y3, x4, y4;
        cin >> x1 >> y1 >> x2 >> y2;
        double dx = x2 - x1, dy = y2 - y1;
        x3 = x1 + 0.5*dx + sqrt(3)/2*dy;
        y3 = y1 - sqrt(3)/2*dx + 0.5*dy;
        x4 = x1 + 0.5f*dx - sqrt(3)/2*dy;
        y4 = y1 + sqrt(3)/2*dx + 0.5f*dy;
        if(x3 < x4 || (x3 == x4 && y3 <= y4))
        {
            cout << fixed << setprecision(2) << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
        }
        else if(x3 > x4 || (x3 == x4 && y4 < y3))
        {
            cout << fixed << setprecision(2) << x4 << " " << y4 << " " << x3 << " " << y3 << endl;
        }
    }
    return 0;
}