#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 998244353;
int n, m, t[1 << 19];
struct segTree {
  struct {
    ll kk, bk, kb, bb;
  } a[1 << 20];
  void upd(int p, int l, int r) {
    int mid = l + r >> 1, v = t[mid] == 1 ? 9 - t[mid + 1] : 0;
    a[p].kk = a[p * 2].kb * a[p * 2 + 1].bk % mod;
    if (l < mid && mid + 1 < r)
      (a[p].kk += a[p * 2].kk * a[p * 2 + 1].kk % mod * v) %= mod;
    a[p].bk = a[p * 2].bb * a[p * 2 + 1].bk % mod;
    if (mid + 1 < r)
      (a[p].bk += a[p * 2].bk * a[p * 2 + 1].kk % mod * v) %= mod;
    a[p].kb = a[p * 2].kb * a[p * 2 + 1].bb % mod;
    if (l < mid) (a[p].kb += a[p * 2].kk * a[p * 2 + 1].kb % mod * v) %= mod;
    a[p].bb = a[p * 2].bb * a[p * 2 + 1].bb % mod;
    (a[p].bb += a[p * 2].bk * a[p * 2 + 1].kb % mod * v) %= mod;
  }
  void build(int p = 1, int l = 1, int r = n) {
    if (l == r) {
      a[p] = {1, 1, 1, t[l] + 1};
      return;
    }
    int mid = l + r >> 1;
    build(p * 2, l, mid);
    build(p * 2 + 1, mid + 1, r);
    upd(p, l, r);
  }
  void ins(int x, int p = 1, int l = 1, int r = n) {
    if (l == r) {
      a[p] = {1, 1, 1, t[l] + 1};
      return;
    }
    int mid = l + r >> 1;
    if (x <= mid)
      ins(x, p * 2, l, mid);
    else
      ins(x, p * 2 + 1, mid + 1, r);
    upd(p, l, r);
  }
} tr;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    char c;
    scanf(" %c", &c);
    t[i] = c - '0';
  }
  tr.build();
  while (m--) {
    int p, v;
    scanf("%d%d", &p, &v);
    t[p] = v;
    tr.ins(p);
    printf("%lld\n", tr.a[1].bb);
  }
  return 0;
}
