#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++) {
vector<float> v;
for (int j = 0; j < 24; j++) {
float a;
cin >> a;
v.push_back(a);
}
vector<float> m = {
0.0,
-0.01383,
-0.11098,
-0.29267,
-0.495,
-0.758,
-1.042,
-1.334,
}
vector<float> s = {
0.1,
0.1,
0.0,
0.0,
0.0,
0.0,
0.0,
}
cout << v[23] + m[0] + s[0] * (v[23] - v[22]) << " ";
cout << v[23] + m[1] + s[1] * (v[23] - v[22]) << " ";
cout << v[23] + m[2] + s[2] * (v[23] - v[22]) << " ";
cout << v[23] + m[3] + s[3] * (v[23] - v[22]) << " ";
if (abs(v[6] - v[0]) < 6.0) {
cout << v[23] + m[4] + s[4] * (v[23] - v[22]) << " ";
}
else cout << "? ";
if (abs(v[6] - v[0]) < 3.5) {
cout << v[23] + m[5] + s[5] * (v[23] - v[22]) << " ";
}
else cout << "? ";
if (abs(v[6] - v[0]) < 1.75) {
cout << v[23] + m[6] + s[6] * (v[23] - v[22]) << " ";
}
else cout << "? ";
if (abs(v[6] - v[0]) < 1.0) {
cout << v[23] + m[7] + s[7] * (v[23] - v[22]) << " ";
}
else cout << "? ";
cout << "? ? ? ? " << endl;
}
return 0;
}