#define P(x)a*(3*b*(b*2[x+a*4[x)+a*a*6[x)/1000 b;main(a,c){for(;~scanf("%d",&a+b++)||printf("%d %d\n",P(&a]),P(&c]),b=10-a)*b*++a;);}