#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using i2 = pair<int, int>;
using ll2 = pair<ll, ll>;
const int N = 5e5 + 9;
const int M = 998244353;
int A[N << 1], treeL[N << 1], treeR[N << 1], treeC[N << 1], tree[N << 1];
int dsize;
inline int f(int a, int b) {
  int x = 10 * a + b;
  if (10 <= x && x <= 18)
    return 19 - x;
  else
    return 0;
}
inline int add(int a, int b) {
  int res = a + b;
  if (res >= M) res -= M;
  return res;
}
inline int mult(ll a, ll b) { return (a * b) % M; }
void upd(int u, int d) {
  A[u] = d;
  int lo = 0, hi = 0;
  if (u & 1) {
    lo = u;
    hi = u + 1;
    u += dsize - 1;
    u >>= 1;
    treeL[u] = d + 1;
  } else {
    lo = u - 1;
    hi = u;
    u += dsize - 1;
    u >>= 1;
    treeR[u] = d + 1;
  }
  tree[u] = add(f(A[lo], A[hi]), mult(treeL[u], treeR[u]));
  while (u >> 1) {
    if (u & 1)
      lo -= hi - lo + 1;
    else
      hi += hi - lo + 1;
    u >>= 1;
    int mid = (lo + hi) >> 1;
    treeC[u] = mult(treeR[u << 1], treeL[u << 1 | 1]);
    treeC[u] = add(treeC[u], mult(mult(treeC[u << 1], treeC[u << 1 | 1]),
                                  f(A[mid], A[mid + 1])));
    treeL[u] = mult(tree[u << 1], treeL[u << 1 | 1]);
    treeL[u] = add(treeL[u], mult(mult(treeL[u << 1], treeC[u << 1 | 1]),
                                  f(A[mid], A[mid + 1])));
    treeR[u] = mult(treeR[u << 1], tree[u << 1 | 1]);
    treeR[u] = add(treeR[u], mult(mult(treeC[u << 1], treeR[u << 1 | 1]),
                                  f(A[mid], A[mid + 1])));
    tree[u] = mult(tree[u << 1], tree[u << 1 | 1]);
    tree[u] = add(tree[u], mult(mult(treeL[u << 1], treeR[u << 1 | 1]),
                                f(A[mid], A[mid + 1])));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 1) {
    int c;
    cin >> c;
    while (m--) {
      int x, d;
      cin >> x >> d;
      cout << d + 1 << "\n";
    }
  } else {
    dsize = 1;
    while (dsize < n) dsize <<= 1;
    for (int i = 1; i < dsize; i++)
      tree[i] = treeL[i] = treeR[i] = treeC[i] = 1;
    for (int i = 1; i <= n; i++) {
      char c;
      cin >> c;
      int d = (int)c - 48;
      upd(dsize - n + i, d);
    }
    while (m--) {
      int x, d;
      cin >> x >> d;
      upd(dsize - n + x, d);
      cout << tree[1] << "\n";
    }
  }
  return 0;
}
