#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, m, inv[505050], f[505050], g[505050][10], a[505050], Inv[505050],
    ginv[505050][10];
int add(int x, int y) { return (x += y) >= mod ? x - mod : x; }
int fpw(int x, int k, int p) {
  int ret = 1;
  while (k) {
    if (k & 1) ret = 1ll * ret * x % p;
    x = 1ll * x * x % p;
    k >>= 1;
  }
  return ret;
}
struct node {
  int l, r, len, ls, rs, ans;
  node operator+(const node &x) const {
    node ret;
    ret.l = l, ret.r = x.r;
    ret.len = len + x.len;
    ret.rs = x.rs;
    if (x.rs == x.len) ret.rs += rs;
    ret.ls = ls;
    if (ls == len) ret.ls += x.ls;
    ret.ans = 1ll * ans * x.ans % mod;
    int mid = r;
    if (rs > 0) {
      if (x.ls > 0) {
        int sum;
        sum =
            1ll * ans * x.ans % mod * inv[rs] % mod * f[rs - 1] % mod * 8 % mod;
        if (x.ls == x.len) {
          sum = 1ll * sum * inv[x.ls] % mod * f[x.ls - 1] % mod;
        } else {
          int t = a[mid + x.ls + 1];
          sum = 1ll * sum * ginv[x.ls][t] % mod * g[x.ls - 1][t] % mod;
        }
        ret.ans = add(ret.ans, sum);
      } else {
        int sum;
        sum = 1ll * ans * x.ans % mod * inv[rs] % mod * f[rs - 1] % mod *
              Inv[a[mid + 1] + 1] % mod * (9 - a[mid + 1]) % mod;
        ret.ans = add(ret.ans, sum);
      }
    }
    return ret;
  }
} nd[505050 * 5 + 5];
void build(int p, int l, int r) {
  nd[p].l = l, nd[p].r = r;
  nd[p].len = r - l + 1;
  if (l == r) {
    if (a[l] == 1) {
      nd[p].ls = nd[p].rs = 1;
    }
    nd[p].ans = a[l] + 1;
    return;
  }
  int mid = (l + r) >> 1;
  build(p + p, l, mid);
  build(p + p + 1, mid + 1, r);
  nd[p] = nd[p + p] + nd[p + p + 1];
}
void modify(int p, int l, int r, int pos, int d) {
  if (l == r) {
    a[l] = d;
    if (a[l] == 1) {
      nd[p].ls = nd[p].rs = 1;
    } else {
      nd[p].ls = nd[p].rs = 0;
    }
    nd[p].ans = a[l] + 1;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid) {
    modify(p + p, l, mid, pos, d);
  } else {
    modify(p + p + 1, mid + 1, r, pos, d);
  }
  nd[p] = nd[p + p] + nd[p + p + 1];
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%1d", &a[i]);
  }
  f[1] = 2;
  f[0] = 1;
  Inv[1] = 1;
  for (int i = 2; i <= 10; i++) {
    Inv[i] = 1ll * (mod - mod / i) * Inv[mod % i] % mod;
  }
  for (int i = 2; i <= n; i++) {
    f[i] = add(1ll * f[i - 1] * 2 % mod, 1ll * f[i - 2] * 8 % mod);
  }
  for (int i = 0; i <= n; i++) {
    inv[i] = fpw(f[i], mod - 2, mod);
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < 10; j++) {
      if (i == 0) {
        g[i][j] = (j + 1);
      } else
        g[i][j] =
            add(1ll * f[i] * (j + 1) % mod, 1ll * f[i - 1] * (9 - j) % mod);
      ginv[i][j] = fpw(g[i][j], mod - 2, mod);
    }
  }
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    int x, d;
    scanf("%d %d", &x, &d);
    modify(1, 1, n, x, d);
    printf("%d\n", nd[1].ans);
  }
  return 0;
}
