#define MD 998244353 ll@t;rep(t){ll@n,@m;wt(Mint(m)**n*n*(n-1)/2*(m-1)/2);}