#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int gcd(int A, int B) {
  if (!B) return A;
  return gcd(B, A % B);
}
const int MAXN = 5e5 + 5;
long long int t[4 * MAXN][2][2];
char s[MAXN];
void push(long long int k) {
  memset(t[k], 0, sizeof(t[k]));
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      t[k][i][j] = 1LL * t[2 * k][i][0] * 1LL * t[2 * k + 1][0][j] +
                   1LL * t[2 * k][i][1] * 1LL * t[2 * k + 1][1][j];
      t[k][i][j] %= (long long int)(998244353);
    }
  }
}
void build(int v, int l, int r) {
  if (l == r) {
    memset(t[v], 0, sizeof(t[v]));
    t[v][1][0] = 1;
    t[v][0][0] = s[l] + 1;
    if (s[l] == 1) t[v][0][1] = 9 - s[l + 1];
    return;
  }
  int mid = (l + r) / 2;
  build(2 * v, l, mid);
  build(2 * v + 1, mid + 1, r);
  push(v);
}
void upd(int v, int l, int r, int pos) {
  if (l == r) {
    memset(t[v], 0, sizeof(t[v]));
    t[v][1][0] = 1;
    t[v][0][0] = s[l] + 1;
    if (s[l] == 1) t[v][0][1] = 9 - s[l + 1];
    return;
  }
  int mid = (l + r) / 2;
  if (pos <= mid)
    upd(2 * v, l, mid, pos);
  else
    upd(2 * v + 1, mid + 1, r, pos);
  push(v);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n; i++) s[i] -= '0';
  build(1, 1, n);
  while (m--) {
    int x, y;
    cin >> x >> y;
    s[x] = y;
    if (x != 1) upd(1, 1, n, x - 1);
    upd(1, 1, n, x);
    cout << t[1][0][0] << '\n';
  }
}
