#include #include #include #include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<998244353>; int main(){ int N; string S; cin >> N >> S; vector Sval(1< pow10((1< pow2((1<> micro(1<(SZ)); rep(i,1< Modint { Modint ans; for(int i=l; i> Q; rep(q,Q){ int t; cin >> t; if(t == 1){ int x, y; cin >> x >> y; y -= Sval[x]; Sval[x] += y; Modint dy = y; int i = x >> (N-n); auto iter = micro[i].begin(); int xx = x & MASK; rep(j,SZ) iter[j] += dy * pow2[xx^j] * pow10[SZ-1-(xx^j)]; } else if(t == 2){ int l, r, x; cin >> l >> r >> x; r++; Modint ans = 0; if(r - l <= SZ * 2){ ans = naive(l, r, x); } else{ int lv = (l + (SZ - 1)) >> (N-n); int rv = r >> (N-n); int lowmask = x & MASK; int himask = x >> (N-n); ans += naive(l, lv << (N-n), x) * pow10[r - (lv << (N-n))]; for(int d=lv; d