Mod=998244353 H,W=map(int,input().split()) X=0 Y=0 t=(H+2)//2 X+=(t)*(t-1)//2 t=H-(H+1)//2+1 X+=(t)*(t-1)//2 X+=H t=(W+2)//2 Y+=(t)*(t-1)//2 t=W-(W+1)//2+1 Y+=(t)*(t-1)//2 Y+=W print(((H*W)**2-X*Y)%Mod)