#include using namespace std; const int mod=998244353; int m,q,f[2222222],tp,x,y,ans,rpos; char s[2222222]; int main() { scanf("%d%d",&m,&q); scanf("%s",s); for (int i=1;i<=(1<<(m-1));i++) f[(1<<(m-1))+i-1]=i; for (int i=(1<<(m-1))-1;i>=1;i--) { if (s[i-1]=='0') f[i]=(f[i<<1]+f[(i<<1)|1])%mod; else f[i]=1ll*f[i<<1]*f[(i<<1)|1]%mod; } while(q--) { scanf("%d",&tp); if (tp==1) { scanf("%d%d",&x,&y); int pos=(1<<(m-1))+x-1; f[pos]=y;pos>>=1; while(pos>=1) { if (s[pos-1]=='0') f[pos]=(f[pos<<1]+f[(pos<<1)|1])%mod; else f[pos]=1ll*f[pos<<1]*f[(pos<<1)|1]%mod; pos>>=1; } } else { scanf("%d",&x); int pos=(1<<(m-1))+x-1;ans=1; rpos=pos; pos>>=1; while(pos>=1) { if (s[pos-1]=='1') { ans=1ll*ans*f[rpos^1]%mod; } rpos=pos; pos>>=1; } printf("%d\n",ans); } } return 0; }