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