#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5, M = 998244353;
int ways[100];
int n, q;
string in;
long long solve(int i, int l) {
  if (i < l) return 1;
  long long ans = solve(i - 1, l) * ways[in[i] - '0'];
  if (i - 1 >= l && in[i - 1] != '0')
    (ans += solve(i - 2, l) * ways[(in[i - 1] - '0') * 10 + (in[i] - '0')]) %=
        M;
  return ans;
}
struct Node {
  long long tot, sub, lft, rgt;
  Node() { sub = lft = rgt = 1; }
};
Node seg[4 * N];
Node mrg(Node x, Node y, int num, int l, int r) {
  Node ret;
  if (r - l + 1 <= 10) {
    ret.tot = solve(r, l);
    ret.lft = solve(r - 1, l);
    ret.rgt = solve(r, l + 1);
    ret.sub = solve(r - 1, l + 1);
  } else {
    long long w = ways[num];
    if (num < 10 || num > 18) w = 0;
    ret.tot = (((x.tot * y.tot) % M) + (((x.lft * w) % M) * y.rgt) % M) % M;
    ret.lft = (((x.tot * y.lft) % M) + (((x.lft * w) % M) * y.sub) % M) % M;
    ret.rgt = (((x.rgt * y.tot) % M) + (((x.sub * w) % M) * y.rgt) % M) % M;
    ret.sub = (((x.rgt * y.lft) % M) + (((x.sub * w) % M) * y.sub) % M) % M;
  }
  return ret;
}
void upd(int p, int s, int e, int idx) {
  if (s == e) return void(seg[p].tot = ways[in[s] - '0']);
  int m = (s + e) >> 1, a = p << 1, b = a | 1;
  idx <= m ? upd(a, s, m, idx) : upd(b, m + 1, e, idx);
  seg[p] = mrg(seg[a], seg[b], (in[m] - '0') * 10 + (in[m + 1] - '0'), s, e);
}
void pre() {
  for (int i = 0; i <= 18; ++i)
    for (int j = 0; j <= i; ++j)
      if (j <= 9 && i - j <= 9) ++ways[i];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  pre();
  cin >> n >> q >> in;
  for (int i = 0; i < n; ++i) upd(1, 0, n - 1, i);
  while (q--) {
    int idx;
    char val;
    cin >> idx >> val;
    --idx;
    in[idx] = val;
    upd(1, 0, n - 1, idx);
    cout << seg[1].tot << '\n';
  }
  return 0;
}
