#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &n) {
  n = 0;
  T f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (isdigit(c)) n = n * 10 + c - '0', c = getchar();
  n *= f;
}
template <typename T>
void write(T n) {
  if (n < 0) putchar('-'), n = -n;
  if (n > 9) write(n / 10);
  putchar(n % 10 + '0');
}
struct Matrix {
  int n, m;
  long long a[3][3];
  Matrix(int x = 0, int y = 0) : n(x), m(y) { memset(a, 0, sizeof(a)); }
  friend Matrix operator*(Matrix a, Matrix b) {
    Matrix c(a.n, b.m);
    for (int i = 1; i <= a.n; i++) {
      for (int j = 1; j <= b.m; j++) {
        for (int k = 1; k <= a.m; k++) {
          (c.a[i][j] += a.a[i][k] * b.a[k][j] % 998244353) %= 998244353;
        }
      }
    }
    return c;
  }
} s[500005 * 4], mat, ans;
int a[500005 * 4];
void build(int p, int l, int r) {
  if (l == r) {
    s[p].n = s[p].m = 2;
    s[p].a[1][1] = a[l] + 1;
    s[p].a[2][1] = 1, s[p].a[2][2] = 0;
    if (l > 1 && a[l - 1] == 1) s[p].a[1][2] = 9 - a[l];
    return;
  }
  build((p << 1), l, ((l + r) >> 1)),
      build((p << 1 | 1), ((l + r) >> 1) + 1, r);
  s[p] = s[(p << 1 | 1)] * s[(p << 1)];
}
void update(int p, int l, int r, int u, int k) {
  if (l == r) {
    s[p].a[1][1] = k + 1;
    if (u > 1 && a[u - 1] == 1)
      s[p].a[1][2] = 9 - k;
    else
      s[p].a[1][2] = 0;
    a[u] = k;
    return;
  }
  if (((l + r) >> 1) >= u)
    update((p << 1), l, ((l + r) >> 1), u, k);
  else
    update((p << 1 | 1), ((l + r) >> 1) + 1, r, u, k);
  s[p] = s[(p << 1 | 1)] * s[(p << 1)];
}
int n, m;
int main() {
  mat.n = 2, mat.m = 1;
  mat.a[1][1] = mat.a[2][1] = 1;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) scanf("%1d", &a[i]);
  build(1, 1, n);
  int x, y;
  for (int i = 1; i <= m; i++) {
    read(x), read(y);
    update(1, 1, n, x, y);
    if (x < n) update(1, 1, n, x + 1, a[x + 1]);
    ans = s[1] * mat;
    write(ans.a[1][1]);
    puts("");
  }
  return 0;
}
