#include <cstdio>
using namespace std;
int main()
{
    int x,y;
    while(~scanf("%d%d",&x,&y))
    {
        long long ans1=0,ans2=0;
        for(int i=x; i<=y; i++)
            if(i&1)
                ans2+=(1ll*i*i*i);
            else
                ans1+=(1ll*i*i);
        printf("%lld %lld\n",ans1,ans2);
    }
    return 0;
}
