#include <bits/stdc++.h>
const long long N = 500005, mod = 998244353;
struct M {
  long long a[3][3];
  M() { memset(a, 0, sizeof(a)); }
  void set(long long x, long long y) { a[1][1] = x, a[1][2] = y, a[2][1] = 1; }
  M operator*(const M A) {
    M B;
    for (long long i = 1; i <= 2; i++) {
      for (long long j = 1; j <= 2; j++)
        B.a[i][j] = a[i][1] * A.a[1][j] + a[i][2] * A.a[2][j], B.a[i][j] %= mod;
    }
    return B;
  }
} f[N << 2], Bg, Ed;
long long a[N], n, Q;
char s[N];
void build(long long k, long long l, long long r) {
  if (l == r) {
    f[k].set(a[l] + 1, (a[l - 1] == 1) * (9 - a[l]));
    return;
  }
  long long mid = l + r >> 1;
  build(k << 1, l, mid), build(k << 1 | 1, mid + 1, r),
      f[k] = f[k << 1 | 1] * f[k << 1];
}
void mofy(long long k, long long l, long long r, long long x) {
  if (l == r) {
    f[k].set(a[x] + 1, (a[x - 1] == 1) * (9 - a[x]));
    return;
  }
  long long mid = l + r >> 1;
  x <= mid ? mofy(k << 1, l, mid, x) : mofy(k << 1 | 1, mid + 1, r, x);
  f[k] = f[k << 1 | 1] * f[k << 1];
}
signed main() {
  long long x, y;
  scanf("%lld%lld", &n, &Q);
  scanf("%s", s + 1);
  for (long long i = 1; i <= n; i++) a[i] = s[i] - '0';
  Ed.set(1, 0), build(1, 1, n);
  while (Q--) {
    scanf("%lld%lld", &x, &y), a[x] = y, mofy(1, 1, n, x);
    if (x < n) mofy(1, 1, n, x + 1);
    printf("%lld\n", (f[1] * Ed).a[1][1]);
  }
  return 0;
}
