#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define TEST_MODE 0
float lim[12] = {20.0, 19.0, 17.9, 17.7, 8.3, 6.9, 6.3, 5.7, 4.9, 4.4, 4.4, 4.4};
const float mg1[12][24] = {
{-0.03103,0.02364,-0.00433,0.03019,0.04572,-0.02409,-0.04673,0.03106,0.04437,-0.06663,0.02789,0.03819,-0.08189,0.07713,-0.0095,-0.00727,-0.02199,0.03609,-0.03728,-0.01495,-0.0326,0.02894,0.00623,0.991},
{-0.0341,-0.00289,0.01899,0.04806,0.06858,-0.02996,-0.0496,0.02275,0.06548,-0.10277,0.02703,0.1242,-0.12333,0.0696,0.00168,-0.05248,-0.00978,0.07515,-0.09721,0.03707,-0.0442,0.03904,-0.00865,0.96242},
{-0.07916,0.00287,-0.00032,0.10301,0.08634,-0.00941,-0.03142,-0.04753,0.12525,-0.08893,0.04921,0.0408,-0.09817,0.12989,-0.04538,0.0031,-0.1144,0.10835,-0.07295,0.09368,-0.07239,0.05261,-0.04862,0.91794},
{-0.09927,0.01949,-0.02425,0.08677,0.16941,-0.05436,-0.03331,-0.01529,0.13024,-0.0833,0.03899,0.03866,-0.09836,0.14189,-0.04747,0.047,-0.19674,0.11686,-0.00531,0.10137,-0.09175,0.07723,-0.10018,0.8814},
{-0.09795,-0.0005,-0.0304,0.03623,0.24453,-0.05067,-0.00479,-0.03048,0.11227,-0.08995,0.0661,0.0288,-0.05554,0.12911,-0.07068,0.05498,-0.20548,0.14447,0.01199,0.12045,-0.10353,0.0677,-0.10696,0.82415},
{-0.11119,-0.00441,-0.01372,-0.02696,0.26338,-0.00255,-0.03661,0.00511,0.12734,-0.15506,0.11532,0.00657,-0.01462,0.0955,-0.05328,0.08793,-0.20392,0.15617,0.04333,0.08904,-0.12768,0.07476,-0.10237,0.7768},
{-0.09943,-0.00914,-0.01516,-0.08969,0.30734,-0.0262,0.00756,-0.02497,0.12224,-0.15711,0.15667,-0.01303,-0.01476,0.12017,-0.06111,0.13947,-0.16585,0.11505,0.04316,0.07161,-0.09728,0.00473,-0.06611,0.73507},
{-0.08544,0.01642,-0.03035,-0.08894,0.29052,-0.05003,-0.01933,0.0082,0.10877,-0.12462,0.14369,0.024,-0.07059,0.17099,-0.06777,0.13897,-0.12858,0.04841,0.13598,0.04428,-0.12083,-0.01894,-0.06193,0.71463},
{-0.10212,0.02823,-0.02887,-0.04028,0.20971,-0.01814,-0.02876,0.00528,0.09902,-0.10689,0.1734,-0.01186,-0.07476,0.21761,-0.09162,0.17529,-0.13245,0.03229,0.15085,0.00209,-0.10685,-0.01645,-0.06474,0.70241},
{-0.06516,-0.01442,-0.0047,-0.0382,0.19201,-0.02612,-0.04491,0.04522,0.05569,-0.0899,0.18625,0.00806,-0.10519,0.24362,-0.09572,0.18956,-0.15525,0.05418,0.15246,-0.01027,-0.12873,0.01032,-0.08516,0.69357},
{-0.04658,-0.04595,0.04816,-0.06405,0.16319,-0.01445,-0.03665,0.04012,0.07644,-0.16992,0.21272,0.03481,-0.11023,0.21725,-0.03016,0.16455,-0.12332,0.02148,0.19873,-0.03229,-0.1409,0.03581,-0.11983,0.68564},
{-0.01262,-0.06266,0.0255,-0.04801,0.14489,-0.00581,-0.0494,0.05524,0.07042,-0.17097,0.1945,0.0852,-0.16358,0.20555,0.03841,0.11877,-0.05433,-0.05516,0.26053,-0.02783,-0.15737,0.02916,-0.11366,0.65513},
};
const float mb1[12][24] = {
{0.00114,0.00706,-0.01083,0.04874,-0.05648,0.04961,-0.04996,0.0606,-0.03241,0.00407,-0.00439,0.00065,-0.01921,0.02197,-0.02764,0.025,-0.00393,-0.00345,-0.00406,-0.01154,-0.02977,-0.05259,0.06214,1.01862},
{-0.02795,0.0131,0.02903,0.06706,-0.09166,0.06322,-0.06536,0.06658,-0.0027,-0.02877,0.01646,0.00502,-0.054,0.01806,-0.03293,0.04432,0.01483,-0.05655,0.06206,-0.03437,-0.05297,-0.04139,0.00345,1.07654},
{-0.03813,-0.01698,0.02612,0.10793,-0.08876,0.0881,-0.08226,0.0813,-0.04046,0.0004,0.0012,0.01434,-0.03816,-0.03455,-0.01919,0.05706,-0.00711,-0.02611,0.05144,-0.02223,0.01731,-0.10485,-0.04244,1.10011},
{-0.02282,-0.0571,-0.00313,0.12519,-0.04515,0.07723,-0.05684,0.09276,-0.08389,0.01758,-0.03138,0.08286,-0.09049,-0.03811,-0.01465,0.05016,-0.00574,-0.0227,0.10792,-0.02029,0.02014,-0.10917,-0.08602,1.09159},
{-0.01533,-0.08286,0.00222,0.06773,-0.07324,0.16433,-0.00776,0.09159,-0.1351,0.0189,-0.01706,0.07031,-0.07292,-0.05471,0.00479,0.02508,-0.01429,0.00367,0.18702,-0.00066,-0.04484,-0.08027,-0.12677,1.06198},
{0.00259,-0.08742,0.01137,0.00416,-0.15802,0.22133,0.09438,0.0633,-0.15032,0.01348,0.01159,0.02975,-0.02946,-0.08929,-0.01807,0.04196,0.03166,0.08633,0.16134,-0.01505,-0.03585,-0.09515,-0.08581,0.95147},
{-0.02744,-0.05975,0.05157,-0.0514,-0.22129,0.17957,0.19814,0.07733,-0.1821,0.05703,0.00856,0.00921,-0.01917,-0.1118,-0.03787,0.09541,0.11602,0.07032,0.12804,-0.0379,-0.01222,-0.07314,-0.07164,0.8563},
{-0.03527,-0.01134,0.05775,-0.06878,-0.25931,0.15243,0.12743,0.13206,-0.17604,0.08533,0.00077,0.0038,0.00637,-0.11396,-0.03429,0.16584,0.15556,-0.01069,0.10162,-0.01533,-0.027,-0.02538,-0.07759,0.78619},
{-0.06552,0.01643,0.07497,-0.06518,-0.27039,0.14747,0.06858,0.05625,-0.08467,0.09929,-0.00995,0.01472,0.0152,-0.0893,0.01454,0.17054,0.15645,-0.0792,0.11373,-0.01547,-0.02717,-0.00857,-0.04893,0.71135},
{-0.05554,-0.00301,0.10916,-0.09149,-0.27407,0.18067,0.00914,0.01377,-0.03231,0.09294,-0.00476,0.04307,-0.00982,-0.06117,0.02291,0.21761,0.10865,-0.08907,0.13081,-0.02507,-0.02961,0.00614,-0.0398,0.65607},
{-0.05479,0.01692,0.1043,-0.10027,-0.25556,0.14079,0.00383,-0.0003,0.00855,0.037,0.02687,0.06228,-0.02519,-0.03277,0.02514,0.22929,0.08519,-0.09039,0.14383,-0.02101,-0.02961,-0.02614,-0.00151,0.61653},
{-0.04682,0.02686,0.0869,-0.08167,-0.26329,0.11445,0.00364,0.00371,0.00462,0.03192,0.04255,0.0697,-0.01544,-0.02697,0.0105,0.2654,0.04124,-0.0451,0.11282,-0.02711,0.0129,-0.07231,0.00868,0.59795},
};
const float mg2[12] = {0.04664,0.03363,-0.00652,-0.05538,-0.10264,-0.14896,-0.18094,-0.23624,-0.28454,-0.32457,-0.37545,-0.42555};
const float mb2[12] = {0.09237,0.01069,-0.12658,-0.33309,-0.54303,-0.6707,-0.81348,-1.05438,-1.24652,-1.38813,-1.5428,-1.6463};
float ar[24];
int n;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
#if !TEST_MODE
cin >> n;
for (int i=0; i < n; i++) {
for (int j=0; j < 24; j++) cin >> ar[j];
float x1 = ar[0], x2 = ar[0];
for (int j=1; j < 24; j++) {
x1 = min(x1, ar[j]);
x2 = max(x2, ar[j]);
}
float dif = abs(x1 - x2);
int depth = 1;
for (; depth <= 12; depth++) {
if (dif > lim[depth-1]) break;
}
for (int j=0; j < 12; j++) {
if (j >= depth) {
cout << "? ";
continue;
}
float q = dif > 6.0 ? mb2[j] : mg2[j];
for (int k=0; k < 24; k++) {
q += (dif > 6.0 ? mb1[j][k] : mg1[j][k]) * ar[k];
}
cout << q << ' ';
}
}
#else
int a[12] = {}, b[12] = {};
freopen("data.txt", "r", stdin);
cin >> n;
for (int i=0; i < n; i++) {
for (int j=0; j < 24; j++) cin >> ar[j];
float x1 = ar[0], x2 = ar[0];
for (int j=1; j < 24; j++) {
x1 = min(x1, ar[j]);
x2 = max(x2, ar[j]);
}
float dif = abs(x1 - x2);
int depth = 1;
for (; depth <= 12; depth++) {
if (dif > lim[depth-1]) break;
}
for (int j=0; j < 12; j++) {
float ans;
cin >> ans;
if (j >= depth) continue;
float q = dif > 6.0 ? mb2[j] : mg2[j];
for (int k=0; k < 24; k++) {
q += (dif > 6.0 ? mb1[j][k] : mg1[j][k]) * ar[k];
}
if (abs(q - ans) < 0.75) a[j]++;
if (abs(q - ans) > 2.05) b[j]++;
}
}
int asum = 0, bsum = 0;
printf(" i | a | b | a-b | %%\n");
for (int i=0; i < 12; i++) {
printf("%2d |%5d |%5d |%5d |%.2f\n", i+1, a[i], b[i], a[i]-b[i], a[i]/(float)n);
asum += a[i];
bsum += b[i];
}
printf(" |%5d |%5d |%.2f |%.2f\n", asum, bsum, (25*(asum-bsum)/(float)n), asum/(float)n);
#endif
}