#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) x = x * 10 + (c & 15), c = getchar();
}
const int P = 998244353;
int n, m;
char c[500001];
struct matrix {
  int n, m, a[3][3];
  inline matrix(int n = 0, int m = 0) : n(n), m(m) { memset(a, 0, sizeof(a)); }
} s[500001 << 2];
inline matrix operator*(const matrix &a, const matrix &b) {
  matrix c(a.n, b.m);
  for (int i = 1; i <= c.n; i++)
    for (int k = 1; k <= a.m; k++)
      for (int j = 1; j <= c.m; j++)
        c.a[i][j] = (c.a[i][j] + (long long)a.a[i][k] * b.a[k][j]) % P;
  return c;
}
inline void build(int p, int l, int r) {
  if (l == r) {
    s[p] = matrix(2, 2), s[p].a[1][2] = (c[l - 1] == 1 ? 9 - c[l] : 0),
    s[p].a[2][1] = 1, s[p].a[2][2] = c[l] + 1;
    return;
  }
  int mid = (l + r) >> 1;
  build(p << 1, l, mid), build(p << 1 | 1, mid + 1, r);
  s[p] = s[p << 1] * s[p << 1 | 1];
}
inline void add(int p, int l, int r, int x) {
  if (x > r || x < l) return;
  if (l == r) {
    s[p].a[1][2] = (c[l - 1] == 1 ? 9 - c[l] : 0), s[p].a[2][1] = 1,
    s[p].a[2][2] = c[l] + 1;
    return;
  }
  int mid = (l + r) >> 1;
  if (mid >= x)
    add(p << 1, l, mid, x);
  else
    add(p << 1 | 1, mid + 1, r, x);
  s[p] = s[p << 1] * s[p << 1 | 1];
}
signed main() {
  read(n), read(m), scanf("%s", c + 1);
  for (int i = 1; i <= n; i++) c[i] -= '0';
  build(1, 1, n);
  while (m--) {
    int x, y;
    read(x), read(y), c[x] = y, add(1, 1, n, x), add(1, 1, n, x + 1);
    matrix ans(1, 2);
    ans.a[1][1] = ans.a[1][2] = 1;
    ans = ans * s[1];
    printf("%d\n", ans.a[1][2]);
  }
  return 0;
}
