q:stdin.get_s(99).split(" ").map(|s|s.to_i).to_a;22.times{t:it/2;i:it%2;u:10-t;print(t*t*q[6+i]+3*u* u*q[2+i]+t*q[4+i] *t/1000,i<1?" ":" ");}