#include <bits/stdc++.h>
template <typename T>
void fmax(T& a, const T& b) {
  if (a < b) a = b;
}
template <typename T>
void fmin(T& a, const T& b) {
  if (a > b) a = b;
}
using namespace std;
using ll = int64_t;
using ull = uint64_t;
struct node {
  int leftest;
  int rightest;
  ll ans;
  ll ans_l;
  ll ans_r;
  ll ans_mid;
};
node t[2 * 1048577];
int n, m;
string c;
ll mod = 998244353ll;
ll mod_pr(ll a, ll b) { return (a * b) % mod; }
ll mod_sum(ll a, ll b) { return (a + b) % mod; }
void push(int v, int tl, int tr) {}
void unite(int v, int tl, int tr) {
  if (tl == tr) {
    return;
  }
  t[v].leftest = t[2 * v].leftest;
  t[v].rightest = t[2 * v + 1].rightest;
  t[v].ans = mod_pr(t[2 * v].ans, t[2 * v + 1].ans);
  t[v].ans_l = mod_pr(t[2 * v].ans, t[2 * v + 1].ans_l);
  t[v].ans_r = mod_pr(t[2 * v].ans_r, t[2 * v + 1].ans);
  t[v].ans_mid = mod_pr(t[2 * v].ans_r, t[2 * v + 1].ans_l);
  if (t[2 * v].rightest == 1 && t[2 * v + 1].leftest < 9) {
    ll kol = 9 - t[2 * v + 1].leftest;
    t[v].ans = mod_sum(t[v].ans,
                       mod_pr(t[2 * v].ans_l, mod_pr(kol, t[2 * v + 1].ans_r)));
    t[v].ans_l = mod_sum(
        t[v].ans_l, mod_pr(t[2 * v].ans_l, mod_pr(kol, t[2 * v + 1].ans_mid)));
    t[v].ans_r = mod_sum(
        t[v].ans_r, mod_pr(t[2 * v].ans_mid, mod_pr(kol, t[2 * v + 1].ans_r)));
    t[v].ans_mid =
        mod_sum(t[v].ans_mid,
                mod_pr(t[2 * v].ans_mid, mod_pr(kol, t[2 * v + 1].ans_mid)));
  }
}
void build(int v, int tl, int tr) {
  if (tl == tr) {
    if (tl < n) {
      t[v] = node{c[tl] - '0', c[tl] - '0', c[tl] - '0' + 1ll, 1ll, 1ll, 0ll};
    } else {
      t[v] = node{100, 100, 1ll, 1ll, 1ll, 0ll};
    }
    return;
  }
  int tm = (tl + tr) / 2;
  build(2 * v, tl, tm);
  build(2 * v + 1, tm + 1, tr);
  unite(v, tl, tr);
}
void upd(int v, int tl, int tr, int x, int d) {
  if (tl == tr) {
    t[v].leftest = d;
    t[v].rightest = d;
    t[v].ans_l = t[v].ans_r = 1ll;
    t[v].ans_mid = 0ll;
    t[v].ans = d + 1;
    return;
  }
  int tm = (tl + tr) / 2;
  if (tm >= x) {
    upd(2 * v, tl, tm, x, d);
  } else {
    upd(2 * v + 1, tm + 1, tr, x, d);
  }
  unite(v, tl, tr);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  cin >> c;
  assert(c.size() == n);
  int wine = 1;
  while (wine < n) {
    wine *= 2;
  }
  build(1, 0, wine - 1);
  for (int(i) = 0; (i) < (int)(m); ++(i)) {
    int x, d;
    cin >> x >> d;
    upd(1, 0, wine - 1, x - 1, d);
    cout << t[1].ans << '\n';
  }
  return 0;
}
