#include <bits/stdc++.h>
const int p = 998244353;
const int maxn = 5e5 + 1;
template <class T>
inline void read(T &x) {
  T f = 1;
  x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = (x * 10) + (s & 15);
    s = getchar();
  }
  x *= f;
}
struct matrix {
  long long a[2][2];
  matrix() { memset(a, 0, sizeof(a)); }
} gjh;
inline matrix operator*(matrix a, matrix b) {
  matrix tmp;
  for (long long i = 0; i <= 1; i++)
    for (long long j = 0; j <= 1; j++)
      for (long long k = 0; k <= 1; k++)
        (tmp.a[i][j] += (a.a[i][k] * b.a[k][j])) %= p;
  return tmp;
}
matrix val[maxn << 2];
char S[maxn];
long long n, m, x, d, s[maxn];
inline void pushup(long long rt) { val[rt] = val[rt << 1] * val[rt << 1 | 1]; }
inline void build(long long rt, long long l, long long r) {
  if (l == r) return (void)(val[rt].a[1][0] = 1);
  build(rt << 1, l, ((l + r) >> 1));
  build(rt << 1 | 1, ((l + r) >> 1) + 1, r);
}
inline void insert1(long long rt, long long l, long long r, long long k,
                    long long ch) {
  if (l == r) return (void)(val[rt].a[0][0] = (ch + 1));
  if (k <= ((l + r) >> 1))
    insert1(rt << 1, l, ((l + r) >> 1), k, ch);
  else
    insert1(rt << 1 | 1, ((l + r) >> 1) + 1, r, k, ch);
  pushup(rt);
}
inline void insert2(long long rt, long long l, long long r, long long k,
                    long long ch1, long long ch2) {
  if (!k || k > n) return;
  if (l == r) return (void)(val[rt].a[0][1] = (ch1 == 1) * (9 - ch2));
  if (k <= ((l + r) >> 1))
    insert2(rt << 1, l, ((l + r) >> 1), k, ch1, ch2);
  else
    insert2(rt << 1 | 1, ((l + r) >> 1) + 1, r, k, ch1, ch2);
  pushup(rt);
}
signed main() {
  read(n);
  read(m);
  scanf("%s", S + 1);
  for (long long i = 1; i <= n; i++) s[i] = (S[i] - '0');
  build(1, 1, n);
  for (long long i = 1; i <= n; i++) insert1(1, 1, n, i, s[i]);
  for (long long i = 1; i <= n - 1; i++) insert2(1, 1, n, i, s[i], s[i + 1]);
  gjh.a[1][1] = 1;
  gjh.a[0][0] = 1;
  for (long long i = 1; i <= m; i++) {
    read(x);
    read(d);
    s[x] = d;
    insert1(1, 1, n, x, d);
    insert2(1, 1, n, x, d, s[x + 1]);
    insert2(1, 1, n, x - 1, s[x - 1], d);
    printf("%lld\n", (gjh * val[1]).a[0][0]);
  }
}
