#include<iostream>
#include<algorithm>
using namespace std;
int m, n;
int main(){
while(cin >> m >> n){
if(m > n) swap(m, n);//99%的wa都是因为这个
int x = 0, y = 0;
for(int i = m; i <= n; i++){
if(i % 2 == 0) x += i * i;
else y += i * i * i;
}
cout << x << " " << y << endl;
}
return 0;
}
//presented by 大吉大利,今晚AC