//要考虑的问题还真多,试了两下,才弄出来,AC掉了,你对比一下吧
#include
int main ()
{
int a,b,s,p,t;
while (scanf ("%d%d",&a,&b)!=EOF)
{ p=0;
s=0;
if(a>b) {t=a;a=b;b=t;}
for (;a<=b;a++)
{
if (a==a/2*2)
p=p+a*a;
else
s=s+a*a*a;
}
printf ("%d %d\n",p,s);
}
return 0;
}