#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5, mod = 998244353;
int n, m, num[N];
struct Data {
  int lnum, rnum, val[2][2];
  inline Data(int _lnum = 0, int _rnum = 0, int _00 = 0, int _01 = 0,
              int _10 = 0, int _11 = 0) {
    lnum = _lnum, rnum = _rnum;
    val[0][0] = _00, val[0][1] = _01;
    val[1][0] = _10, val[1][1] = _11;
  }
  inline Data operator+(const Data& b) {
    if (val[0][0] == 0) return b;
    if (b.val[0][0] == 0) return *this;
    Data ans;
    ans.lnum = lnum, ans.rnum = b.rnum;
    for (int l = 0; l < 2; l++) {
      for (int r = 0; r < 2; r++) {
        (ans.val[l][r] += 1ll * val[l][0] * b.val[0][r] % mod) %= mod;
        (ans.val[l][r] += 1ll * val[l][1] * b.val[1][r] % mod * (rnum == 1) *
                          (9 - b.lnum) % mod) %= mod;
      }
    }
    return ans;
  }
};
struct SegmentTree {
  Data w[N << 2];
  inline void pushup(int p) { w[p] = w[p << 1] + w[p << 1 | 1]; }
  void modify(int p, int l, int r, int pos, int num) {
    if (l == pos && pos == r)
      return w[p] = (Data){num, num, num + 1, 1, 1, 0}, void();
    if (pos <= ((l + r) >> 1))
      modify(p << 1, l, ((l + r) >> 1), pos, num);
    else
      modify(p << 1 | 1, ((l + r) >> 1) + 1, r, pos, num);
    pushup(p);
  }
  int query() { return w[1].val[0][0]; }
} smt;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%1d", &num[i]);
    smt.modify(1, 1, n, i, num[i]);
  }
  for (int a, b; m; m--) {
    scanf("%d%d", &a, &b);
    smt.modify(1, 1, n, a, b);
    printf("%d\n", smt.query());
  }
  return 0;
}
