#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10, M = N << 2, mod = 998244353;
inline int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
inline int sub(int a, int b) { return a >= b ? a - b : a - b + mod; }
inline int mul(int a, int b) { return 1ll * a * b % mod; }
struct matrix {
  int n, m, a[3][3];
  inline void init(int r, int c) {
    n = r;
    m = c;
    memset(a, 0, sizeof a);
  }
  friend inline matrix operator*(const matrix &a, const matrix &b) {
    matrix c;
    c.init(a.n, b.m);
    for (int i = 0; i < a.n; i++)
      for (int j = 0; j < b.m; j++)
        for (int k = 0; k < a.n; k++)
          c.a[i][j] = add(c.a[i][j], mul(a.a[i][k], b.a[k][j]));
    return c;
  }
} st;
int n, a[N], Q, pos, val;
char s[N];
namespace SegmentTree {
matrix c[M];
inline void pushup(int p) { c[p] = c[p << 1 | 1] * c[p << 1]; }
inline void build(int p, int l, int r) {
  if (l == r) {
    c[p].init(2, 2);
    c[p].a[0][0] = a[l] + 1;
    c[p].a[1][0] = 1;
    c[p].a[0][1] = (9 - a[l]) * (a[l - 1] == 1);
    return;
  }
  int mid = (l + r) >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
inline void change(int p, int l, int r, int pos) {
  if (l == pos && pos == r) {
    c[p].a[0][0] = a[l] + 1;
    c[p].a[1][0] = 1;
    c[p].a[0][1] = (9 - a[l]) * (a[l - 1] == 1);
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    change(p << 1, l, mid, pos);
  else
    change(p << 1 | 1, mid + 1, r, pos);
  pushup(p);
}
}  // namespace SegmentTree
int main() {
  st.init(2, 2);
  st.a[0][0] = st.a[1][0] = 1;
  cin >> n >> Q;
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) a[i] = s[i] - '0';
  SegmentTree::build(1, 1, n);
  while (Q--) {
    scanf("%d%d", &pos, &val);
    a[pos] = val;
    SegmentTree::change(1, 1, n, pos);
    if (pos < n) SegmentTree::change(1, 1, n, pos + 1);
    printf("%d\n", (SegmentTree::c[1] * st).a[0][0]);
  }
  return 0;
}
