#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 7;
const int inf = INT_MAX;
const long long inff = 1e18;
const long long mod = 998244353;
int a[maxn];
int func(int x) { return max(0, (10 - abs(x - 9))); }
struct node {
  int cnt, l0, r0, lr0, L, R;
  node() : cnt(0), l0(0), r0(0), lr0(0), L(0), R(0) {}
  node(int x, int _l, int _r)
      : cnt(func(x)), l0(1), r0(1), lr0(0), L(_l), R(_r) {}
};
node operator+(node A, node B) {
  node ret;
  ret.L = A.L, ret.R = B.R;
  ret.cnt = (A.cnt * 1ll * B.cnt) % mod;
  ret.l0 = (A.l0 * 1ll * B.cnt) % mod;
  ret.r0 = (A.cnt * 1ll * B.r0) % mod;
  ret.lr0 = (A.l0 * 1ll * B.r0) % mod;
  if (a[A.R] != 0) {
    int tmp = 10 * a[A.R] + a[B.L];
    ret.cnt = (ret.cnt + A.r0 * 1ll * B.l0 * func(tmp)) % mod;
    ret.l0 = (ret.l0 + A.lr0 * 1ll * B.l0 * func(tmp)) % mod;
    ret.r0 = (ret.r0 + A.r0 * 1ll * B.lr0 * func(tmp)) % mod;
    ret.lr0 = (ret.lr0 + A.lr0 * 1ll * B.lr0 * func(tmp)) % mod;
  }
  return ret;
}
struct segtree {
  node seg[maxn * 4];
  void Build(int now, int l, int r) {
    if (l == r) {
      seg[now] = node(a[l], l, r);
      return;
    }
    int m = (l + r) >> 1;
    Build(now * 2, l, m);
    Build(now * 2 + 1, m + 1, r);
    seg[now] = seg[now * 2] + seg[now * 2 + 1];
  }
  void modify(int now, int l, int r, int x, int v) {
    if (l == r) {
      a[x] = v;
      seg[now] = node(v, l, r);
      return;
    }
    int m = (l + r) >> 1;
    if (x <= m)
      modify(now * 2, l, m, x, v);
    else
      modify(now * 2 + 1, m + 1, r, x, v);
    seg[now] = seg[now * 2] + seg[now * 2 + 1];
  }
  int query() { return seg[1].cnt; }
} tree;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) a[i + 1] = s[i] - '0';
  tree.Build(1, 1, n);
  while (q--) {
    int x, y;
    cin >> x >> y;
    tree.modify(1, 1, n, x, y);
    cout << tree.query() << '\n';
  }
}
