#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long tree[2005000], ls[2005000], rs[2005000], ll[2005000], rr[2005000],
    ms[2005000];
int a[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, aa[2005000], n, m, x, y;
char s[2005000];
void build(int l, int r, int rt) {
  if (l == r) {
    int x = aa[l];
    ls[rt] = rs[rt] = ms[rt] = 1;
    tree[rt] = x + 1;
    ll[rt] = rr[rt] = x;
    return;
  }
  int mid = (l + r) / 2;
  build(l, mid, rt * 2);
  build(mid + 1, r, rt * 2 + 1);
  int num = (rr[rt * 2] == 1) * a[ll[rt * 2 + 1]];
  tree[rt] = (tree[rt * 2] * tree[rt * 2 + 1] +
              num * ls[rt * 2] % mod * rs[rt * 2 + 1] % mod) %
             mod;
  ms[rt] = (rs[rt * 2] * ls[rt * 2 + 1] + num * (mid - l > 0) * (r - mid > 1) *
                                              ms[rt * 2] % mod *
                                              ms[rt * 2 + 1] % mod) %
           mod;
  ll[rt] = ll[rt * 2];
  rr[rt] = rr[rt * 2 + 1];
  ls[rt] = (tree[rt * 2] * ls[rt * 2 + 1] +
            num * (r - mid > 1) * ls[rt * 2] % mod * ms[rt * 2 + 1] % mod) %
           mod;
  rs[rt] = (tree[rt * 2 + 1] * rs[rt * 2] +
            num * (mid - l > 0) * rs[rt * 2 + 1] % mod * ms[rt * 2] % mod) %
           mod;
}
void change(int l, int r, int rt, int q, int x) {
  if (l == r && l == q) {
    ls[rt] = rs[rt] = ms[rt] = 1;
    tree[rt] = x + 1;
    ll[rt] = rr[rt] = x;
    return;
  }
  int mid = (l + r) / 2;
  if (q <= mid)
    change(l, mid, rt * 2, q, x);
  else
    change(mid + 1, r, rt * 2 + 1, q, x);
  int num = (rr[rt * 2] == 1) * a[ll[rt * 2 + 1]];
  tree[rt] = (tree[rt * 2] * tree[rt * 2 + 1] +
              num * ls[rt * 2] % mod * rs[rt * 2 + 1] % mod) %
             mod;
  ms[rt] = (rs[rt * 2] * ls[rt * 2 + 1] + num * (mid - l > 0) * (r - mid > 1) *
                                              ms[rt * 2] % mod *
                                              ms[rt * 2 + 1] % mod) %
           mod;
  ll[rt] = ll[rt * 2];
  rr[rt] = rr[rt * 2 + 1];
  ls[rt] = (tree[rt * 2] * ls[rt * 2 + 1] +
            num * (r - mid > 1) * ls[rt * 2] % mod * ms[rt * 2 + 1] % mod) %
           mod;
  rs[rt] = (tree[rt * 2 + 1] * rs[rt * 2] +
            num * (mid - l > 0) * rs[rt * 2 + 1] % mod * ms[rt * 2] % mod) %
           mod;
}
int main() {
  cin >> n >> m;
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    aa[i] = s[i] - '0';
  }
  build(1, n, 1);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    change(1, n, 1, x, y);
    printf("%lld\n", tree[1]);
  }
}
