#include <iostream>
using namespace std;
int main()
{
int x, y;
while (cin >> x >> y)
{
int m = 0, n = 0,temp;
if (y>x)
{
temp = x;
x = y;
y = temp;
}
int j;
for (j = y; j <= x; j++)
{
if (j % 2 == 0)
m = m + j*j;
else
n = n + j*j*j;
}
cout << m << " " << n << endl;
}
}