#include <bits/stdc++.h>
using namespace std;
int n, m;
const int maxn = 1000005;
long long c[maxn];
long long dpr[maxn];
long long dpl[maxn];
const long long mod = 998244353;
int cnt[110] = {};
string s;
struct node {
  int l, r;
  long long val[4];
  int len;
};
node segTree[maxn * 4];
void pushup(int i) {
  long long ans = 0;
  int a = i << 1;
  int b = a | 1;
  segTree[i].len = segTree[a].len + segTree[b].len;
  segTree[i].val[3] = segTree[a].val[3] * segTree[b].val[3] % mod;
  segTree[i].val[2] = segTree[a].val[3] * segTree[b].val[2] % mod;
  segTree[i].val[1] = segTree[a].val[1] * segTree[b].val[3] % mod;
  segTree[i].val[0] = segTree[a].val[1] * segTree[b].val[2] % mod;
  if (c[segTree[a].r] == 1) {
    int cn = cnt[10 + c[segTree[b].l]];
    bool aa = segTree[a].len > 1;
    bool bb = segTree[b].len > 1;
    segTree[i].val[3] += segTree[a].val[2] * segTree[b].val[1] % mod * cn % mod;
    segTree[i].val[3] %= mod;
    if (bb) {
      segTree[i].val[2] +=
          segTree[a].val[2] * segTree[b].val[0] % mod * cn % mod;
      segTree[i].val[2] %= mod;
    }
    if (aa) {
      segTree[i].val[1] +=
          segTree[a].val[0] * segTree[b].val[1] % mod * cn % mod;
      segTree[i].val[1] %= mod;
    }
    if (aa && bb) {
      segTree[i].val[0] +=
          segTree[a].val[0] * segTree[b].val[0] % mod * cn % mod;
      segTree[i].val[0] %= mod;
    }
  }
}
void build(int i, int l, int r) {
  if (r == l)
    segTree[i] = {l, r, 1ll, 1ll, 1ll, 1ll * cnt[c[l]], 1};
  else
    segTree[i] = {l, r};
  if (l == r) return;
  int mid = (l + r) / 2;
  build(i << 1, l, mid);
  build((i << 1) + 1, mid + 1, r);
  pushup(i);
}
void upd(int i, int l, int r, int x) {
  if (l == r) {
    segTree[i].val[3] = cnt[c[l]];
    return;
  }
  int mid = (l + r) / 2;
  if (mid >= x)
    upd(i << 1, l, mid, x);
  else
    upd((i << 1) + 1, mid + 1, r, x);
  pushup(i);
}
int main() {
  cin >> n >> m;
  cin >> s;
  for (int i = 1; i <= n; ++i) {
    c[i] = s[i - 1] - '0';
  }
  dpr[n + 1] = dpr[0] = dpl[0] = dpl[n + 1] = 1;
  for (int i = 0; i <= 9; ++i) {
    for (int j = 0; j <= 9; ++j) {
      cnt[i + j]++;
    }
  }
  build(1, 1, n);
  for (int i = 0; i < m; ++i) {
    int x, d;
    scanf("%d%d", &x, &d);
    c[x] = d;
    upd(1, 1, n, x);
    cout << segTree[1].val[3] << endl;
  }
}
