#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T a) {
  for (auto x : a) cout << x << ' ';
  cout << '\n';
}
const int MOD = 998244353;
int mul(int a, int b) { return (1ll * a * b) % MOD; }
int add(int a, int b) { return (a + b) % MOD; }
int precalc[100];
int get_val(int a) { return precalc[a]; }
vector<int> a;
vector<int> t1, t2, tf, te;
void build(int v, int tl, int tr) {
  if (tl == tr) {
    t1[v] = t2[v] = te[v] = tf[v] = 0;
    tf[v] = get_val(a[tl]);
    te[v] = 0;
    t1[v] = 1;
    t2[v] = 1;
  } else if (tl == tr - 1) {
    t1[v] = t2[v] = te[v] = tf[v] = 0;
    t1[v] = get_val(a[tr]);
    t2[v] = get_val(a[tl]);
    if (a[tl] != 0) tf[v] = add(tf[v], get_val(a[tl] * 10 + a[tr]));
    tf[v] = add(tf[v], mul(get_val(a[tl]), get_val(a[tr])));
    te[v] = 1;
  } else {
    int tm = (tl + tr) / 2;
    build(v * 2 + 1, tl, tm);
    build(v * 2 + 2, tm + 1, tr);
    t1[v] = t2[v] = te[v] = tf[v] = 0;
    t1[v] = add(t1[v], mul(t1[v * 2 + 1], tf[v * 2 + 2]));
    if (a[tm] != 0)
      t1[v] =
          add(t1[v], mul(te[v * 2 + 1],
                         mul(t1[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
    t2[v] = add(t2[v], mul(tf[v * 2 + 1], t2[v * 2 + 2]));
    if (a[tm] != 0)
      t2[v] =
          add(t2[v], mul(t2[v * 2 + 1],
                         mul(te[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
    tf[v] = add(tf[v], mul(tf[v * 2 + 1], tf[v * 2 + 2]));
    if (a[tm] != 0)
      tf[v] =
          add(tf[v], mul(t2[v * 2 + 1],
                         mul(t1[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
    te[v] = add(te[v], mul(t1[v * 2 + 1], t2[v * 2 + 2]));
    if (a[tm] != 0)
      te[v] =
          add(te[v], mul(te[v * 2 + 1],
                         mul(te[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
  }
}
void update(int v, int tl, int tr, int pos) {
  if (tl == tr) {
    t1[v] = t2[v] = te[v] = tf[v] = 0;
    tf[v] = get_val(a[tl]);
    te[v] = 0;
    t1[v] = 1;
    t2[v] = 1;
  } else if (tl == tr - 1) {
    t1[v] = t2[v] = te[v] = tf[v] = 0;
    t1[v] = get_val(a[tr]);
    t2[v] = get_val(a[tl]);
    if (a[tl] != 0) tf[v] = get_val(a[tl] * 10 + a[tr]);
    tf[v] = add(tf[v], mul(get_val(a[tl]), get_val(a[tr])));
    te[v] = 1;
  } else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      update(v * 2 + 1, tl, tm, pos);
    else
      update(v * 2 + 2, tm + 1, tr, pos);
    t1[v] = t2[v] = te[v] = tf[v] = 0;
    t1[v] = add(t1[v], mul(t1[v * 2 + 1], tf[v * 2 + 2]));
    if (a[tm] != 0)
      t1[v] =
          add(t1[v], mul(te[v * 2 + 1],
                         mul(t1[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
    t2[v] = add(t2[v], mul(tf[v * 2 + 1], t2[v * 2 + 2]));
    if (a[tm] != 0)
      t2[v] =
          add(t2[v], mul(t2[v * 2 + 1],
                         mul(te[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
    tf[v] = add(tf[v], mul(tf[v * 2 + 1], tf[v * 2 + 2]));
    if (a[tm] != 0)
      tf[v] =
          add(tf[v], mul(t2[v * 2 + 1],
                         mul(t1[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
    te[v] = add(te[v], mul(t1[v * 2 + 1], t2[v * 2 + 2]));
    if (a[tm] != 0)
      te[v] =
          add(te[v], mul(te[v * 2 + 1],
                         mul(te[v * 2 + 2], get_val(a[tm] * 10 + a[tm + 1]))));
  }
}
void solve() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  a.resize(n);
  for (int i = 0; i < n; i++) a[i] = s[i] - '0';
  for (int i = 0; i < 100; i++) {
    int ans = 0;
    for (int j = 0; j < 10; j++)
      if ((i - j >= 0) && (i - j <= 9)) ans++;
    precalc[i] = ans;
  }
  t1.resize(n * 4 + 10);
  t2.resize(n * 4 + 10);
  tf.resize(n * 4 + 10);
  te.resize(n * 4 + 10);
  build(0, 0, n - 1);
  for (int i = 0; i < m; i++) {
    int x, d;
    cin >> x >> d;
    x--;
    a[x] = d;
    update(0, 0, n - 1, x);
    cout << tf[0] << '\n';
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
