p[9],t=4,r;main(i){for(;r=t+11;t-=i^=~scanf("%d",++*p+p)||printf("%.f%c",(3*--r*(t*p[6-i]-r*p[4-i])-t*t*p[8-i])*t/1e3,10+i*22));}