import numpy as np
intercept24 = 0.06678044632257585
coefs24 = [-0.0039464751852140234, 0.011085091636340805, -0.015385206955865155, 0.055112472127335894, -0.04232184126326422, 0.031088081785620014, -0.03649929548776042, 0.04102313318836852, -0.017286145753750197, -0.003769818272909144, -0.0019515248991148512, 0.015692004156031922, -0.03852648625459188, 0.03077814008358259, -0.025814536568957328, 0.01700412052314157, -0.001608915057672692, 0.0009337401651250828, -0.0029252301298576156, -0.021129816557464497, -0.02479174134105202, -0.04642854108363228, 0.05064992173862285, 1.0239837617639862]
intercept25 = 0.02441658447851136
coefs25 = [-0.019526863403231648, -0.0027075880115759454, 0.021178278080934743, 0.06467467475715348, -0.04750670908165283, 0.03535869728452369, -0.04709979045354941, 0.03796997326976145, 0.014146121136381199, -0.04898235510056794, 0.03106492847746789, 0.03375656778509765, -0.08658350897309379, 0.028935919763732314, -0.021221603024267847, 0.022743099598498864, 0.02720176740653872, -0.04494945719585793, 0.039700061305231835, -0.028704426749020198, -0.041687928752189754, -0.049068804265277925, 0.005974729286557886, 1.069752304399238]
intercept26 = -0.05029800728805789
coefs26 = [-0.04233764831498315, -0.031809849605969, 0.021066172196482817, 0.12128656983008367, -0.06747128976700204, 0.0783902745345557, -0.07088198331453853, 0.05218256770835599, -0.023076966582493832, -0.011144281068166182, 0.02741406828534581, 0.019952592093813063, -0.0641644269507537, -0.005242083975959617, -0.027266212623996075, 0.051498353646711015, -0.003228312850402138, -0.01807228327414503, 0.02654540199092102, 0.006751295615243703, -0.0005424028083102049, -0.10208595705217342, -0.017227957227576068, 1.0683756001930869]
intercept27 = -0.1612314978974121
coefs27 = [-0.03762071984698354, -0.07299111535798083, -0.000837352177695755, 0.1316470918348903, -0.025604927089739934, 0.08402633746218124, -0.05862234342206059, 0.06347526579208339, -0.05560181048666421, 0.009868089875804726, -0.01798350910642466, 0.08550911819337256, -0.11054950218873015, 0.0019869498182424933, -0.029016861485141855, 0.057459766672526516, -0.014374644943896443, -0.01248719032243085, 0.08109324245070092, 0.02159595882675665, -0.010087929597036891, -0.09991637252351518, -0.06623448484169746, 1.059497826458649]
intercept28 = -0.26133365424447685
coefs28 = [-0.0329277735181407, -0.09628245385142775, -0.0006465397532301908, 0.06105770597248226, -0.028164498105285013, 0.15768157587493484, 0.0051076386700023325, 0.03714604400735086, -0.10574592036799885, 0.03479840283185668, -0.006231448924645955, 0.059900284448661405, -0.07079329966727742, -0.025851299993147538, -0.013509099061889568, 0.046630898001146774, -0.031220843252081763, 0.013190165645837061, 0.1646469727854157, 0.04419058828673067, -0.07025827174361735, -0.08192108533519339, -0.1060612756340013, 1.024125135658626]
intercept29 = -0.3014901857343437
coefs29 = [-0.027875544437292763, -0.09482747499572289, 0.0004924899067043364, 0.00014411015668037183, -0.08770343832566654, 0.196364262123341, 0.09837409800404501, 0.01605891235735349, -0.11347610595556863, 0.028612295415257026, 0.015850992649216758, 0.020149897321100795, -0.014300581762449433, -0.06339330151197115, -0.03218562561711411, 0.06335838982546252, 0.017833521332896857, 0.09819099883850428, 0.1373593902222864, 0.02386896073774964, -0.07080153348102466, -0.09025639666529996, -0.07102842757829593, 0.919836204075626]
intercept30 = -0.3352704038384795
coefs30 = [-0.05729896268252373, -0.07037472041110637, 0.03137312483527463, -0.06013640695816125, -0.12142856726939305, 0.145556695149847, 0.1939677277469438, 0.021217341729887897, -0.13892908770152962, 0.07346772308146153, 0.0209310682095527, -0.015519322847908365, 0.007429087581461212, -0.0841746637760093, -0.04035932093049281, 0.1231044711334037, 0.09234522159348382, 0.08346815751349858, 0.10917907895575579, -0.004136268946169497, -0.044985982028900695, -0.0808461320339259, -0.04519043486666321, 0.8181483989952442]
intercept31 = -0.42507050308161975
coefs31 = [-0.06546910253460844, -0.032244988601661695, 0.03392209432211614, -0.06713846544586119, -0.16105079439617218, 0.10706284373229387, 0.1390101050214402, 0.06677944979297476, -0.1269772004141127, 0.1065650209572284, 0.013438443442230183, -0.019091127438484637, 0.02674876928071505, -0.0832558411966274, -0.015152773071870455, 0.18766495680814915, 0.13856010935290272, -0.010839398282038042, 0.08967795783539931, 0.016257601820357754, -0.04712535291630759, -0.04564794462669802, -0.06919722507555494, 0.7586816940213558]
model_coefs = np.array(
[
np.array(coefs24),
np.array(coefs25),
np.array(coefs26),
np.array(coefs27),
np.array(coefs28),
np.array(coefs29),
np.array(coefs30),
np.array(coefs31)
]
)
model_intercept = np.array(
[intercept24, intercept25, intercept26, intercept27, intercept28, intercept29, intercept30, intercept31]
)
T = int(input())
for _ in range(T):
day_temp = [float(el) for el in input().split()]
for i in range(8):
hour_pred = np.array(day_temp).dot(model_coefs[i]) + model_intercept[i]
print(f"{hour_pred:.2f}", end=' ')
print("? ? ? ?")