// Problem: P2241 统计方形(数据加强版)
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P2241
// Memory Limit: 125 MB
// Time Limit: 1000 ms
// User: Pannnn
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
long long n, m;
cin >> n >> m;
// 以某个点结束有多少正方形
long long cntSquare = 0;
// 以某个点结束有多少矩形(包括正方形)
long long cntRectangle = 0;
for (int i = 1; i <= n; ++i) {
for (int j = 1; j <= m; ++j) {
cntSquare += min(i, j);
cntRectangle += i * j;
}
}
cout << cntSquare << " " << cntRectangle - cntSquare << endl;
return 0;
}