#include <bits/stdc++.h>
using namespace std;
inline int rd(int f = 1, int x = 0, char ch = ' ') {
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = -1;
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
const int N = 5e5 + 5, P = 998244353;
int n, m, c[N];
char s[N];
void fix(int &x) { x < P ? 0 : x -= P; }
struct Mx {
  int A[2][2];
  Mx() { memset(A, 0, sizeof(A)); }
  inline int *operator[](const int i) { return A[i]; }
  friend Mx operator*(Mx A, Mx B) {
    Mx C;
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j)
        for (int k = 0; k < 2; ++k)
          fix(C[i][j] += (long long)A[i][k] * B[k][j] % P);
    return C;
  }
} t[N << 2];
void F(Mx &A, int c, int cc) {
  A = Mx(), A[1][0] = 1, A[0][1] = 10 <= cc && cc <= 18 ? 19 - cc : 0,
  A[1][1] = c + 1;
}
void init(int x, int l, int r) {
  if (l == r) return F(t[x], c[l], c[l - 1] * 10 + c[l]);
  int mid = (l + r) >> 1;
  init(x << 1, l, mid), init(x << 1 | 1, mid + 1, r),
      t[x] = t[x << 1] * t[x << 1 | 1];
}
void upd(int x, int l, int r, int p) {
  if (l == r) return F(t[x], c[l], c[l - 1] * 10 + c[l]);
  int mid = (l + r) >> 1;
  if (p <= mid)
    upd(x << 1, l, mid, p);
  else
    upd(x << 1 | 1, mid + 1, r, p);
  t[x] = t[x << 1] * t[x << 1 | 1];
}
int main() {
  n = rd(), m = rd(), scanf("%s", s + 1);
  for (int i = 1; i <= n; ++i) c[i] = s[i] - '0';
  init(1, 1, n);
  while (m--) {
    int x = rd(), d = rd();
    c[x] = d, upd(1, 1, n, x);
    if (x != n) upd(1, 1, n, x + 1);
    printf("%d\n", (t[1][0][1] + t[1][1][1]) % P);
  }
  return 0;
}
