#include <stdio.h>

int main() {
	int m,n;
	scanf("%d %d",&m,&n);
	
	int square = 0,cube = 0;
	
	while(m <= n) {
		if(m % 2 == 0) square += m * m;
		else cube += m * m * m;
		m++;
	}
	
	printf("%d %d",square,cube);
	
	return 0;
}