#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
const int MOD = 998244353;
int n, q;
char str[maxn];
int arr[maxn];
void add(long long& x, long long y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
namespace Segtree {
long long ansl[maxn << 2], ansr[maxn << 2], anslr[maxn << 2], ans[maxn << 2];
void pushup(int o, int L, int R) {
  int lch = o * 2, rch = o * 2 + 1;
  ans[o] = ans[lch] * ans[rch] % MOD;
  ansl[o] = ansl[lch] * ans[rch] % MOD;
  ansr[o] = ans[lch] * ansr[rch] % MOD;
  anslr[o] = ansl[lch] * ansr[rch] % MOD;
  int mid = (L + R) / 2;
  int lv = arr[mid], rv = arr[mid + 1];
  int v = lv * 10 + rv;
  if (v >= 10 && v <= 18) {
    int cnt = 19 - v;
    add(ans[o], ansr[lch] * ansl[rch] % MOD * cnt % MOD);
    add(ansl[o], anslr[lch] * ansl[rch] % MOD * cnt % MOD);
    add(ansr[o], anslr[rch] * ansr[lch] % MOD * cnt % MOD);
    add(anslr[o], anslr[lch] * anslr[rch] % MOD * cnt % MOD);
  }
  return;
}
void build(int o, int L, int R) {
  int lch = o * 2, rch = o * 2 + 1;
  if (L == R) {
    ansl[o] = ansr[o] = 1;
    anslr[o] = 0;
    ans[o] = arr[L] + 1;
    return;
  }
  int mid = (L + R) / 2;
  build(lch, L, mid);
  build(rch, mid + 1, R);
  pushup(o, L, R);
}
void update(int o, int L, int R, int pos) {
  int lch = o * 2, rch = o * 2 + 1;
  if (L == R) {
    ansl[o] = ansr[o] = 1;
    anslr[o] = 0;
    ans[o] = arr[L] + 1;
    return;
  }
  int mid = (L + R) / 2;
  if (pos <= mid)
    update(lch, L, mid, pos);
  else
    update(rch, mid + 1, R, pos);
  pushup(o, L, R);
}
};  // namespace Segtree
using namespace Segtree;
int main() {
  scanf("%d%d", &n, &q);
  scanf("%s", str + 1);
  for (int i = 1; i <= n; i++) arr[i] = str[i] - '0';
  build(1, 1, n);
  while (q--) {
    int x, d;
    scanf("%d%d", &x, &d);
    arr[x] = d;
    update(1, 1, n, x);
    printf("%I64d\n", ans[1]);
  }
  return 0;
}
