q=() x=0 exec"q+=[input(),input()],;"*4+'y=1-x;print"%.f %.f"%tuple(a*y**3+3*y*x*(b*y+c*x)+d*x**3for a,b,c,d in zip(*q));x+=.1;'*11