import java.util.Scanner;
public class HDU_oj2007 {
/*
* 给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和。*/
public static void main(String[] args) {
Scanner sn = new Scanner(System.in);
while(sn.hasNext()) {
int n = sn.nextInt();
int m = sn.nextInt();
int evenSum = 0,oddSum = 0;
if(n > m) { //注意一定要判断大小,否则wrong answer
int temp = n;
n = m;
m = temp;
}
for(int i = n; i <= m;i++) {
if(i % 2 == 0) {
evenSum += Math.pow(i, 2);
} else {
oddSum += Math.pow(i, 3);
}
}
System.out.println(evenSum+ " " + oddSum);
}
}
}