#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void chkmin(T &a, const T &b) {
  a = a < b ? a : b;
}
template <typename T>
inline void chkmax(T &a, const T &b) {
  a = a > b ? a : b;
}
const int MAXN = 500005, MAXT = 1 << 20, MOD = 998244353;
struct Mat {
  long long a[2][2];
  Mat() { memset(a, 0, sizeof(a)); }
  const long long *operator[](int x) const { return a[x]; }
  long long *operator[](int x) { return a[x]; }
  Mat operator*(const Mat &b) const {
    Mat res;
    res[0][0] = (a[0][0] * b[0][0] + a[0][1] * b[1][0]) % MOD;
    res[0][1] = (a[0][0] * b[0][1] + a[0][1] * b[1][1]) % MOD;
    res[1][0] = (a[1][0] * b[0][0] + a[1][1] * b[1][0]) % MOD;
    res[1][1] = (a[1][0] * b[0][1] + a[1][1] * b[1][1]) % MOD;
    return res;
  }
} nd[MAXT];
int num[100], n, Q;
char str[MAXN];
void calc(Mat &m, int p) {
  m[0][0] = 0, m[1][0] = 1;
  m[1][1] = str[p] + 1;
  m[0][1] = str[p - 1] != 0 ? num[str[p - 1] * 10 + str[p]] : 0;
}
void build(int l, int r, int k) {
  if (l == r) return calc(nd[k], l);
  int mid = (l + r) >> 1;
  build(l, mid, k << 1);
  build(mid + 1, r, k << 1 | 1);
  nd[k] = nd[k << 1] * nd[k << 1 | 1];
}
void modify(int a, int b, int l = 1, int r = n, int k = 1) {
  if (a > r || b < l) return;
  if (l == r) return calc(nd[k], l);
  int mid = (l + r) >> 1;
  modify(a, b, l, mid, k << 1);
  modify(a, b, mid + 1, r, k << 1 | 1);
  nd[k] = nd[k << 1] * nd[k << 1 | 1];
}
int main() {
  scanf("%d%d", &n, &Q);
  scanf("%s", str + 1);
  for (int i = 1; i <= n; i++) str[i] -= '0';
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++)
      if (i + j >= 10) ++num[i + j];
  build(1, n, 1);
  while (Q--) {
    int x, d;
    scanf("%d%d", &x, &d);
    str[x] = d;
    modify(x, min(n, x + 1));
    printf("%lld\n", nd[1][1][1]);
  }
  return 0;
}
