#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x1fffffffffffffff;
const double INFD = 1e20;
const double EPS = 1e-9;
const double PI = atan(1) * 4;
const long long M = 998244353;
long long add(long long x, long long y) { return (x + y) % M; }
long long mul(long long x, long long y) { return (x * y) % M; }
long long scan() {
  long long r;
  scanf("%lld", &r);
  return r;
}
void scanstr(char *buf) { scanf("%s", buf); }
tuple<long long, long long, long long, long long, long long, long long> fab(
    long long lc_val, long long lc_val_no_l, long long lc_val_no_r,
    long long lc_val_no_lr, long long lc_digit_l, long long lc_digit_r,
    long long rc_val, long long rc_val_no_l, long long rc_val_no_r,
    long long rc_val_no_lr, long long rc_digit_l, long long rc_digit_r) {
  if (lc_val >= INF)
    return make_tuple(rc_val, rc_val_no_l, rc_val_no_r, rc_val_no_lr,
                      rc_digit_l, rc_digit_r);
  if (rc_val >= INF)
    return make_tuple(lc_val, lc_val_no_l, lc_val_no_r, lc_val_no_lr,
                      lc_digit_l, lc_digit_r);
  long long mg_val, mg_val_no_l, mg_val_no_r, mg_val_no_lr, mg_digit_l,
      mg_digit_r;
  long long combined = (((lc_digit_r * 10 + rc_digit_l) >= 10 &&
                         (lc_digit_r * 10 + rc_digit_l) <= 18)
                            ? (19 - (lc_digit_r * 10 + rc_digit_l))
                            : 0);
  mg_val =
      add(mul(lc_val, rc_val), mul(mul(lc_val_no_r, rc_val_no_l), combined));
  mg_val_no_l = add(mul(lc_val_no_l, rc_val),
                    mul(mul(lc_val_no_lr, rc_val_no_l), combined));
  mg_val_no_r = add(mul(lc_val, rc_val_no_r),
                    mul(mul(lc_val_no_r, rc_val_no_lr), combined));
  mg_val_no_lr = add(mul(lc_val_no_l, rc_val_no_r),
                     mul(mul(lc_val_no_lr, rc_val_no_lr), combined));
  mg_digit_l = lc_digit_l;
  mg_digit_r = rc_digit_r;
  return make_tuple(mg_val, mg_val_no_l, mg_val_no_r, mg_val_no_lr, mg_digit_l,
                    mg_digit_r);
}
struct SegTree {
  long long sl;
  long long sr;
  long long val;
  long long val_no_l;
  long long val_no_r;
  long long val_no_lr;
  long long digit_l;
  long long digit_r;
  SegTree *cl;
  SegTree *cr;
};
SegTree *segtree_new(long long sl, long long sr) {
  SegTree *result = new SegTree();
  result->sl = sl;
  result->sr = sr;
  result->val = result->val_no_l = result->val_no_r = 1;
  result->val_no_lr = (sl == sr) ? 0 : 1;
  result->digit_l = result->digit_r = 0;
  result->cl = result->cr = NULL;
  return result;
}
bool segtree_trysplit(SegTree *root) {
  if (root == NULL || root->sl == root->sr || root->cl) return false;
  long long sep = (root->sl + root->sr) / 2;
  root->cl = segtree_new(root->sl, sep);
  root->cr = segtree_new(sep + 1, root->sr);
  return true;
}
tuple<long long, long long, long long, long long, long long, long long>
segtree_get(SegTree *root, long long ql, long long qr) {
  if (root == NULL || ql > root->sr || qr < root->sl || ql > qr)
    return make_tuple(INF, INF, INF, INF, INF, INF);
  if (ql <= root->sl && qr >= root->sr)
    return make_tuple(root->val, root->val_no_l, root->val_no_r,
                      root->val_no_lr, root->digit_l, root->digit_r);
  segtree_trysplit(root);
  long long lc_val, lc_val_no_l, lc_val_no_r, lc_val_no_lr, lc_digit_l,
      lc_digit_r;
  long long rc_val, rc_val_no_l, rc_val_no_r, rc_val_no_lr, rc_digit_l,
      rc_digit_r;
  tie(lc_val, lc_val_no_l, lc_val_no_r, lc_val_no_lr, lc_digit_l, lc_digit_r) =
      segtree_get(root->cl, ql, qr);
  tie(rc_val, rc_val_no_l, rc_val_no_r, rc_val_no_lr, rc_digit_l, rc_digit_r) =
      segtree_get(root->cr, ql, qr);
  return fab(lc_val, lc_val_no_l, lc_val_no_r, lc_val_no_lr, lc_digit_l,
             lc_digit_r, rc_val, rc_val_no_l, rc_val_no_r, rc_val_no_lr,
             rc_digit_l, rc_digit_r);
}
void segtree_update(SegTree *root, long long pos, long long newval) {
  if (root == NULL || pos < root->sl || pos > root->sr) return;
  if (root->sl == root->sr) {
    root->val = ((newval) + 1);
    root->digit_l = root->digit_r = newval;
  } else {
    segtree_trysplit(root);
    segtree_update(root->cl, pos, newval);
    segtree_update(root->cr, pos, newval);
    tie(root->val, root->val_no_l, root->val_no_r, root->val_no_lr,
        root->digit_l, root->digit_r) =
        fab(root->cl->val, root->cl->val_no_l, root->cl->val_no_r,
            root->cl->val_no_lr, root->cl->digit_l, root->cl->digit_r,
            root->cr->val, root->cr->val_no_l, root->cr->val_no_r,
            root->cr->val_no_lr, root->cr->digit_l, root->cr->digit_r);
  }
}
void segtree_dump(SegTree *root) {
  if (root == NULL) return;
  cerr << "[" << root->sl << "," << root->sr << "] : val=" << root->val
       << ", valNoL=" << root->val_no_l << ", valNoR" << root->val_no_r
       << ", digitL=" << root->digit_l << ", digitR=" << root->digit_r << endl;
  segtree_dump(root->cl);
  segtree_dump(root->cr);
}
void segtree_free(SegTree *root) {
  if (root == NULL) return;
  segtree_free(root->cl);
  segtree_free(root->cr);
  delete root;
}
char buf[500001];
int main() {
  long long n = scan();
  long long m = scan();
  scanstr(buf);
  SegTree *segtree = segtree_new(0, n - 1);
  for (long long i = 0; i < n; ++i) {
    segtree_update(segtree, i, buf[i] - 48);
  }
  for (long long i = 0; i < m; ++i) {
    long long x = scan() - 1;
    long long d = scan();
    segtree_update(segtree, x, d);
    long long val;
    tie(val, ignore, ignore, ignore, ignore, ignore) =
        segtree_get(segtree, 0, n - 1);
    cout << val << endl;
  }
  return 0;
}
