#include <bits/stdc++.h>
#pragma GCC optimize( \
    "Ofast,vpt,unroll-loops,shrink-wrap-separate,loop-nest-optimize")
using namespace std;
const int nax = 524288, lgax = 25, bit = 64, mod = 998244353, inf = 1000000007;
const long long llax = 9e18;
struct S {
  long long a, p, s, ps, lval, rval;
} t[nax << 1];
int cnt[100];
S comb(S& l, S& r) {
  long long x = l.rval ? cnt[l.rval * 10 + r.lval] : 0;
  return {(l.a * r.a + l.p * x % mod * r.s) % mod,
          (l.a * r.p + l.p * x % mod * r.ps) % mod,
          (l.s * r.a + l.ps * x % mod * r.s) % mod,
          (l.s * r.p + l.ps * x % mod * r.ps) % mod,
          l.lval,
          r.rval};
}
void build() {
  for (int i = nax - 1; i > 0; --i) t[i] = comb(t[i << 1], t[i << 1 | 1]);
}
void upd(int p, int c) {
  t[p += nax] = {cnt[c], 1, 1, 0, c, c};
  for (p >>= 1; p; p >>= 1) t[p] = comb(t[p << 1], t[p << 1 | 1]);
}
long long query() { return t[1].a; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  string s;
  cin >> n >> m;
  for (int i = 0; i < 10; ++i)
    for (int j = 0; j < 10; ++j) ++cnt[i + j];
  cin >> s;
  for (int i = 0; i < n; ++i)
    t[i + nax] = {cnt[s[i] - '0'], 1, 1, 0, s[i] - '0', s[i] - '0'};
  for (int i = n; i < nax; ++i) t[i + nax] = {1, 0, 0, 0, 0, 0};
  build();
  while (m--) {
    int p, c;
    cin >> p >> c;
    upd(--p, c);
    cout << query() << '\n';
  }
  return 0;
}
