<>;map$_%=998244353,$z+=$x=${1-$_},${-$_}+=$x+1for glob<>;print$z