#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
vector<double> temperatures(24);
for (int j = 0; j < 24; j++) {
cin >> temperatures[j];
}
vector<double> predictions(12);
for (int j = 12; j < 24; j++) {
// Calculate the average of the previous 12 hours
double sum = 0.0;
int count = 0;
for (int k = j - 12; k < j; k++) {
if (temperatures[k] != -1.0) {
sum += temperatures[k];
count++;
}
}
// If there is enough data for prediction, calculate the average
if (count >= 6) {
predictions[j - 12] = sum / count;
} else {
// If there is insufficient data, use a question mark
predictions[j - 12] = -1.0;
}
}
// Print the predictions for the next 12 hours
for (int j = 0; j < 12; j++) {
if (j > 0) {
cout << " ";
}
if (predictions[j] != -1.0) {
cout << fixed <<setprecision(2)<< predictions[j];
} else {
cout << "?";
}
}
cout << endl;
}
return 0;
}