#include <bits/stdc++.h>
using namespace std;
int n, m, g1[500015], g2[500015];
int s[500015];
int get(int x) {
  int cnt = 0;
  for (int i = 0; i <= 9; i++)
    for (int j = 0; j <= 9; j++) {
      if (i + j == x) cnt++;
    }
  return cnt;
}
struct matrix {
  long long a[3][3];
  matrix() { memset(a, 0, sizeof a); }
  long long* operator[](int i) { return a[i]; }
  matrix operator*(matrix lhs) const {
    matrix tmp;
    for (int i = 1; i <= 2; i++)
      for (int j = 1; j <= 2; j++)
        for (int k = 1; k <= 2; k++) {
          (tmp[i][k] += a[i][j] * lhs[j][k]) %= 998244353;
        }
    return tmp;
  }
} base;
matrix Get(int i) {
  matrix u;
  u[1][1] = g1[s[i]];
  u[1][2] = (s[i] == 1 && i > 1) ? g2[s[i - 1]] : 0;
  u[2][1] = 1;
  return u;
}
namespace seg {
matrix t[500015 << 2];
void pushup(int p) { t[p] = t[(p << 1 | 1)] * t[(p << 1)]; }
void build(int p, int l, int r) {
  if (l == r) return t[p] = Get(l), void();
  int mid = (l + r) >> 1;
  build((p << 1), l, mid);
  build((p << 1 | 1), mid + 1, r);
  pushup(p);
}
void change(int p, int l, int r, int pos) {
  if (l == r) return t[p] = Get(pos), void();
  int mid = (l + r) >> 1;
  if (pos <= mid)
    change((p << 1), l, mid, pos);
  else
    change((p << 1 | 1), mid + 1, r, pos);
  pushup(p);
}
matrix query() { return t[1]; }
}  // namespace seg
using namespace seg;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i <= 9; i++) g1[i] = get(i);
  for (int i = 0; i <= 9; i++) g2[i] = get(10 + i);
  for (int i = 1; i <= n; i++) scanf("%1d", &s[n - i + 1]);
  build(1, 1, n);
  while (m--) {
    int pos, val;
    scanf("%d%d", &pos, &val);
    pos = n - pos + 1;
    base[1][1] = 1;
    s[pos] = val;
    change(1, 1, n, pos);
    if (pos + 1 <= n) change(1, 1, n, pos + 1);
    base = base * query();
    printf("%lld\n", base[1][1]);
  }
  return 0;
}
