#include <bits/stdc++.h>
int n, m, ans1[2000005], ans2[2000005], Ans1[2000005], Ans2[2000005];
char s[2000005];
int read() {
  char c = getchar();
  int ans = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') ans = ans * 10 + c - '0', c = getchar();
  return ans;
}
void Write(int x) {
  if (x < 10)
    putchar(x ^ 48);
  else
    Write(x / 10), putchar((x % 10) ^ 48);
  return;
}
int min(int x, int y) { return x < y ? x : y; }
int max(int x, int y) { return x > y ? x : y; }
struct Matrix {
  int X[2][2];
  Matrix operator*(const Matrix b) const {
    Matrix c;
    c.X[0][0] =
        ((X[0][0] + 0ll) * b.X[0][0] + (X[0][1] + 0ll) * b.X[1][0]) % 998244353;
    c.X[0][1] =
        ((X[0][0] + 0ll) * b.X[0][1] + (X[0][1] + 0ll) * b.X[1][1]) % 998244353;
    c.X[1][0] =
        ((X[1][0] + 0ll) * b.X[0][0] + (X[1][1] + 0ll) * b.X[1][0]) % 998244353;
    c.X[1][1] =
        ((X[1][0] + 0ll) * b.X[0][1] + (X[1][1] + 0ll) * b.X[1][1]) % 998244353;
    return c;
  }
} Tree[2000005], G;
void modify(int L, int R, int pos, int rt, Matrix x) {
  if (L == R) return (void)(Tree[rt] = x);
  if ((L + R) / 2 >= pos)
    modify(L, (L + R) / 2, pos, rt << 1, x);
  else
    modify((L + R) / 2 + 1, R, pos, rt << 1 | 1, x);
  Tree[rt] = Tree[rt << 1 | 1] * Tree[rt << 1];
  return;
}
Matrix build(int X, int Y) {
  Matrix c;
  c.X[0][0] = X, c.X[0][1] = Y, c.X[1][0] = 1, c.X[1][1] = 0;
  return c;
}
int main() {
  n = read(), m = read();
  scanf("%s", s + 1);
  for (register int i = 1; i <= n; i++) s[i] -= '0';
  std::reverse(s + 1, s + 1 + n);
  G.X[0][0] = 1, G.X[1][0] = 0;
  for (register int i = 0; i < 10; i++)
    for (register int j = 0; j < 10; j++)
      if (i + j < 10)
        ans1[i + j]++;
      else
        ans2[i + j]++;
  for (register int i = 1; i <= n; i++)
    modify(1, n, i, 1, build(ans1[s[i]], ans2[s[i] * 10 + s[i - 1]] * (i > 1)));
  for (register int i = 1, x, y; i <= m; i++) {
    x = n + 1 - read(), y = read();
    s[x] = y;
    modify(1, n, x, 1, build(ans1[s[x]], ans2[s[x] * 10 + s[x - 1]] * (x > 1)));
    if (x < n)
      modify(1, n, x + 1, 1, build(ans1[s[x + 1]], ans2[s[x + 1] * 10 + s[x]]));
    Write((Tree[1] * G).X[0][0]), putchar('\n');
  }
  return 0;
}
