#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const long long inf = 1e9 + 7;
const double eps = 1e-9;
inline long long add(const long long &x, const long long &y) {
  return (x + y) % mod;
}
inline long long mul(const long long &x, const long long &y) {
  return (x * y) % mod;
}
inline long long mul(const long long &x, const long long &y,
                     const long long &z) {
  return mul(mul(x, y), z);
}
struct node {
  long long dp[4];
};
long long n, q;
string c;
long long a[500005];
node t[2000005];
node comb(node u, node v, long long tm) {
  node res;
  res.dp[0] = mul(u.dp[2], v.dp[1]);
  res.dp[1] = mul(u.dp[3], v.dp[1]);
  res.dp[2] = mul(u.dp[2], v.dp[3]);
  res.dp[3] = mul(u.dp[3], v.dp[3]);
  long long val = a[tm] * 10 + a[tm + 1];
  if (10 <= val && val <= 18) {
    long long tmp = 9 - (val - 9) + 1;
    res.dp[0] = add(res.dp[0], mul(u.dp[0], v.dp[0], tmp));
    res.dp[1] = add(res.dp[1], mul(u.dp[1], v.dp[0], tmp));
    res.dp[2] = add(res.dp[2], mul(u.dp[0], v.dp[2], tmp));
    res.dp[3] = add(res.dp[3], mul(u.dp[1], v.dp[2], tmp));
  }
  return res;
}
void pull(long long u, long long tm) {
  t[u] = comb(t[2 * u], t[2 * u + 1], tm);
}
void upd(long long u, long long tl, long long tr, long long x, long long val) {
  if (tl == tr) {
    a[tl] = val;
    t[u].dp[0] = 0;
    t[u].dp[1] = t[u].dp[2] = 1;
    t[u].dp[3] = a[tl] + 1;
  } else {
    long long tm = (tl + tr) / 2;
    if (x <= tm)
      upd(2 * u, tl, tm, x, val);
    else
      upd(2 * u + 1, tm + 1, tr, x, val);
    pull(u, tm);
  }
}
void upd(long long x, long long val) { upd(1, 1, n, x, val); }
void solve() {
  cin >> n >> q >> c;
  for (long long i = 1; i <= n; ++i) {
    a[i] = c[i - 1] - '0';
    upd(i, a[i]);
  }
  while (q--) {
    long long x, val;
    cin >> x >> val;
    upd(x, val);
    cout << t[1].dp[3] << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  for (long long tc = 1; tc <= test; ++tc) solve();
  return 0;
}
