#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, ans = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return f * ans;
}
const long long MAXN = 5e5 + 11;
struct Matrix {
  long long A[3][3];
  void clear() {
    memset(A, 0, sizeof(A));
    return;
  }
} tr[MAXN << 2];
Matrix operator*(Matrix x1, Matrix x2) {
  Matrix x3;
  x3.clear();
  for (long long i = 1; i <= 2; i++)
    for (long long j = 1; j <= 2; j++)
      for (long long k = 1; k <= 2; k++)
        x3.A[i][j] += x1.A[i][k] * x2.A[k][j], x3.A[i][j] %= 998244353;
  return x3;
}
void print(Matrix s) {
  printf("========\n");
  for (long long i = 1; i <= 2; i++) {
    for (long long j = 1; j <= 2; j++) printf("%lld ", s.A[i][j]);
    printf("\n");
  }
  printf("========\n");
  return;
}
long long F[MAXN], N, Q;
char str[MAXN];
struct Segment {
  void Modify(long long k, long long l, long long r, long long ps) {
    if (l == r) {
      long long p = (19 - (F[l] * 10 + F[l + 1])), q = (F[l] + 1);
      if (l == N || !F[l] || F[l] > 1) p = 0;
      tr[k].A[1][1] = q, tr[k].A[1][2] = p, tr[k].A[2][1] = 1,
      tr[k].A[2][2] = 0;
      return;
    }
    long long mid = (l + r) >> 1;
    if (ps <= mid)
      Modify(k << 1, l, mid, ps);
    else
      Modify(k << 1 | 1, mid + 1, r, ps);
    tr[k] = tr[k << 1] * tr[k << 1 | 1];
  }
} S;
signed main() {
  N = read(), Q = read();
  scanf("%s", str + 1);
  for (long long i = 1; i <= N; i++) F[i] = str[i] - '0';
  for (long long i = 1; i <= N; i++) S.Modify(1, 1, N, i);
  while (Q--) {
    long long ps = read(), w = read();
    F[ps] = w;
    S.Modify(1, 1, N, ps);
    if (ps != 1) S.Modify(1, 1, N, ps - 1);
    printf("%lld\n", (tr[1].A[1][1] + tr[1].A[1][2]) % 998244353);
  }
  return 0;
}
