#include using namespace std; const int N = (1 << 20) + 5; const int mod = 998244353; int n, q, op[N]; int f[N]; char str[N]; int main() { scanf("%d%d", &n, &q); scanf(" %s", str + 1); for (int i = 1; i < (1 << (n - 1)); i++) { op[i] = str[i] - '0'; } for (int i = 1; i <= (1 << (n - 1)); i++) { f[i + (1 << (n - 1)) - 1] = i; } for (int i = (1 << (n - 1)) - 1; i >= 1; i--) { if (op[i] == 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--) { int t; scanf("%d", &t); if (t == 1) { int i; scanf("%d", &i); i += (1 << (n - 1)) - 1; scanf("%d", &f[i]); for (i >>= 1; i; i >>= 1) { if (op[i] == 0) f[i] = (f[i << 1] + f[i << 1 | 1]) % mod; else f[i] = 1ll * f[i << 1] * f[i << 1 | 1] % mod; } } else { int i; scanf("%d", &i); i += (1 << (n - 1)) - 1; int res = 1, lst = i; for (i >>= 1; i; i >>= 1) { if (op[i] == 1) res = 1ll * res * f[lst ^ 1] % mod; lst = i; } printf("%d\n", res); } } return 0; }