#include #include using namespace std; using ll = long long; using mint = atcoder::modint998244353; int main(){ ll h, w; cin >> h >> w; mint a = h/2, b = w/2; mint ans = 2*a*b*(a+1+b+1) + a*(a+1)*b*(b+1); if (h % 2 == 1){ ans += b*(b+1); } if (w % 2 == 1){ ans += a*(a+1); } mint tot = h*w; ans = tot*(tot-1) - ans; cout << ans.val() << endl; }