#include using namespace std; long long mod = 998244353; //入力が必ずmod未満の時に使う. struct mint{ long long v = 0; mint(){} mint(int a){v = a;} mint(long long a){v = a;} mint(unsigned long long a){v = a;} long long val(){return v;} void modu(){v %= mod;} mint repeat2mint(long long a,long long b){ mint ret = 1,p = a; int Log = 60; if(b <= 2e9) Log = 30; for(int i=0; i(mint b){if(v > b.v) return true; else return false;} bool operator>=(mint b){if(v >= b.v) return true; else return false;} bool operator<(mint b){if(v < b.v) return true; else return false;} bool operator<=(mint b){if(v <= b.v) return true; else return false;} mint pow(long long x){return repeat2mint(v,x);} mint inv(){return mint(1)/v;} }; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); long long H,W; cin >> H >> W; long long h2 = H/2,w2 = W/2; mint answer = (H*W)%mod; answer *= (H*W-1)%mod; mint h3 = (h2*(h2+1)/2)%mod,w3 = (w2*(w2+1)/2)%mod; answer -= h3*W*2; answer -= w3*H*2; answer -= h3*w3*4; cout << answer.v << endl; }