//#include #pragma GCC optimize(3) #include #include #include #include #include #include #include #include #include #include #include #include //#include #define X first #define Y second #define PB push_back #define MP make_pair #define EB emplace_back #define mset(var,val) memset(var,val,sizeof(var)) #define IOS ios::sync_with_stdio(false);cin.tie(0) #define rep(i,n) for(int i = 0; i < n; ++i) #define rep1(i,n) for(int i = 1; i <= n; ++i) using namespace std; typedef long long ll; #ifdef local #define dbg(args...) do { cout << "\033[32;1m" << #args << " -> "; err(args); } while (0) void err() { cout << "\033[39;0m" << endl; } template class T, typename t, typename... Args> void err(T a, Args... args) { for (auto x: a) cout << x << ' '; err(args...); } template void err(T a, Args... args) { cout << a << ' '; err(args...); } #else #define dbg(...) #endif template inline bool scan(T&ret) { char c; int sgn; if(c=getchar(),c==EOF) return 0; while(c!='-' and (c<'0' or c>'9')) c=getchar(); sgn=(c=='-')?-1:1; ret=(c=='-')?0:(c-'0'); while(c=getchar(),c>='0' and c<='9') ret=ret*10+(c-'0'); ret*=sgn; return 1; } template inline void out(T x) { if(x>9) out(x/10); putchar(x%10+'0'); } int _ = 0; void testcase() { cout << "Case " << (++_) << ": "; } const int inf = 0x3f3f3f3f; const long long INF = 0x3f3f3f3f3f3f3f3fLL; const double PI = acos(-1.0); const long double eps = 1e-6; const int mod = 998244353; //const int maxn = 3e6; const int N = (1<<20)+5; const int M = 710; using pii = pair; using pll = pair; struct seg{ ll val; bool op; }st[N]; char s[N]; #define lson rt<<1 #define rson rt<<1|1 void build(int rt, int l, int r){ if(l==r)return; int mid = l + r >> 1; build(lson,l,mid); build(rson,mid+1,r); if(st[rt].op==0){ st[rt].val = (st[lson].val + st[rson].val) % mod; } else{ st[rt].val = st[lson].val * st[rson].val % mod; } } void update(int rt, int l, int r, int x, int y){ if(l == r){ st[rt].val = y; return; } int mid = l + r >> 1; if(x <= mid) update(lson, l, mid, x, y); else update(rson, mid+1, r, x, y); if(st[rt].op==0){ st[rt].val = (st[lson].val + st[rson].val) % mod; } else{ st[rt].val = st[lson].val * st[rson].val % mod; } } ll query(int rt, int l, int r, int x){ if(l == r) return 1; int mid = l + r >> 1; if(st[rt].op == 0){ if(x <= mid){ return query(lson, l, mid, x); } else{ return query(rson, mid+1, r, x); } } else{ if(x <= mid){ return query(lson, l, mid, x) * st[rson].val % mod; } else{ return query(rson, mid+1, r, x) * st[lson].val % mod; } } } void work() { int m, q; cin >> m >> q; int n = (1<> s; int len = strlen(s); rep(i,len){ st[i+1].op = s[i]-'0'; } build(1,1,n); for(;q--;){ int op; cin >> op; if(op == 1){ int x,y; cin >> x >> y; update(1,1,n,x,y); } else{ int x; cin >> x; cout << query(1,1,n,x) << '\n'; } } } int main() { #ifdef local freopen("../in.txt","r",stdin); // freopen("out.txt","w",stdout); #endif // local IOS; // int t; // cin >> t; // for(;t--;) work(); return 0; }