#include <bits/stdc++.h>
using namespace std;
const long long N = 998244353;
struct mat {
  long long a[2][2];
};
mat mul(mat a, mat b) {
  mat c;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      c.a[i][j] = 0;
      for (int k = 0; k < 2; k++) c.a[i][j] += a.a[i][k] * b.a[k][j];
      c.a[i][j] %= N;
    }
  }
  return c;
}
mat make_mat(long long x, long long y) {
  mat ret;
  ret.a[0][0] = x;
  ret.a[1][0] = y;
  ret.a[0][1] = 1;
  ret.a[1][1] = 0;
  return ret;
}
mat val[2000005];
void pushup(int x) { val[x] = mul(val[(x << 1)], val[((x << 1) | 1)]); }
void modify(int x, int l, int r, int pos, mat v) {
  if (l == r) {
    val[x] = v;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid) modify((x << 1), l, mid, pos, v);
  if (pos > mid) modify(((x << 1) | 1), mid + 1, r, pos, v);
  pushup(x);
}
int n, m, x, y, d[500005];
string s;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  cin >> s;
  reverse(s.begin(), s.end());
  s = ' ' + s;
  for (int i = 1; i <= n; i++) {
    d[i] = s[i] - '0';
    modify(1, 1, n, i,
           make_mat(d[i] + 1, (i == 1 ? 0 : (d[i] == 1) * (9 - d[i - 1]))));
  }
  while (m--) {
    cin >> x >> y;
    x = n - x + 1;
    d[x] = y;
    modify(1, 1, n, x,
           make_mat(d[x] + 1, (x == 1 ? 0 : (d[x] == 1) * (9 - d[x - 1]))));
    if (x < n)
      modify(1, 1, n, x + 1,
             make_mat(d[x + 1] + 1, (d[x + 1] == 1) * (9 - d[x])));
    cout << val[1].a[0][0] << '\n';
  }
  return 0;
}
