import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd h,w = map(int,input().split()) if h % 2 == 0: hh = h//2-1 else: hh = h//2 if w % 2 == 0: ww = w//2-1 else: ww = w//2 all = ((1+hh)*hh//2) * ((1+ww)*ww//2) * 4 lh = h-hh*2 lw = w-ww*2 all += ((1+ww)*ww//2) * h * lh * 2 all += ((1+hh)*hh//2) * w * lw * 2 all += h*w *lh*lw ans = (h*w)**2 - all print(ans%998244353)