use bigint; $n=<>+0; $a=<>=~y/AB//+0; print+(bnok$n$a)%998244353;