#include <bits/stdc++.h>
using namespace std;
vector<long long> cnt;
const long long MOD = 998244353;
struct SegmentTree {
  vector<long long> a;
  vector<vector<long long> > t;
  long long n;
  SegmentTree(string s) {
    n = s.size();
    a.resize(n);
    for (long long i = 0; i < n; i++) {
      a[i] = s[i] - '0';
    }
    t.resize(4, vector<long long>(n * 4));
    build(1, 0, n);
  }
  void update(long long v, long long m) {
    long long vl = 2 * v, vr = 2 * v + 1;
    long long val = (a[m - 1] ? cnt[a[m - 1] * 10 + a[m]] : 0);
    t[3][v] =
        (t[3][vl] * t[3][vr] % MOD + t[2][vl] * t[1][vr] * val % MOD) % MOD;
    t[2][v] =
        (t[3][vl] * t[2][vr] % MOD + t[2][vl] * t[0][vr] * val % MOD) % MOD;
    t[1][v] =
        (t[1][vl] * t[3][vr] % MOD + t[0][vl] * t[1][vr] * val % MOD) % MOD;
    t[0][v] =
        (t[1][vl] * t[2][vr] % MOD + t[0][vl] * t[0][vr] * val % MOD) % MOD;
  }
  void build(long long v, long long l, long long r) {
    if (r - l == 1) {
      t[3][v] = cnt[a[l]];
      t[1][v] = t[2][v] = 1;
      return;
    }
    long long m = (l + r) / 2, vl = 2 * v, vr = 2 * v + 1;
    build(vl, l, m);
    build(vr, m, r);
    update(v, m);
  }
  long long get() { return t[3][1]; }
  void change(long long v, long long l, long long r, long long pos,
              long long val) {
    if (r - l == 1) {
      a[l] = val;
      t[3][v] = cnt[a[l]];
      return;
    }
    long long m = (l + r) / 2, vl = 2 * v, vr = 2 * v + 1;
    if (pos < m)
      change(vl, l, m, pos, val);
    else
      change(vr, m, r, pos, val);
    update(v, m);
  }
};
void solve() {
  cnt.resize(200);
  for (long long i = 0; i < 10; i++) {
    for (long long j = 0; j < 10; j++) {
      cnt[i + j]++;
    }
  }
  long long n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  SegmentTree tree(s);
  for (long long i = 0; i < m; i++) {
    long long x, d;
    cin >> x >> d;
    tree.change(1, 0, n, x - 1, d);
    cout << tree.get() << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout.precision(30);
  long long t = 1;
  while (t--) solve();
}
