#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long mod = 998244353;
long long b[5][5];
struct matrix {
  long long s[4][4], n, m;
  void mul(matrix &a) {
    for (long long i = 1; i <= 3; i++) {
      for (long long j = 1; j <= 3; j++) b[i][j] = 0;
    }
    for (long long i = 1; i <= m; i++) {
      for (long long j = 1; j <= n; j++) {
        for (long long k = 1; k <= a.m; k++) {
          b[j][k] += s[j][i] * a.s[i][k];
        }
      }
    }
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= m; j++) {
        s[i][j] = b[i][j] % mod;
      }
    }
  }
};
matrix val[1 << 20];
char a[500005];
matrix t;
long long num[10] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
void build(long long x, long long tl, long long tr) {
  if (tl == tr) {
    val[x].n = val[x].m = 3;
    val[x].s[2][1] = val[x].s[3][2] = 1;
    val[x].s[3][3] = (a[tl] - '0') + 1;
    if (tl > 1 && a[tl - 1] - '0' == 1) {
      val[x].s[2][3] = num[a[tl] - '0'];
    }
    return;
  }
  long long mid = (tl + tr) >> 1;
  build(x << 1, tl, mid);
  build((x << 1) | 1, mid + 1, tr);
  val[x] = val[x << 1];
  val[x].mul(val[(x << 1) | 1]);
}
void update(long long x, long long l, long long r, long long it) {
  if (l == r) {
    val[x].s[3][3] = (a[l] - '0') + 1;
    return;
  }
  long long mid = (l + r) >> 1;
  if (mid >= it) {
    update(x << 1, l, mid, it);
  } else
    update((x << 1) | 1, mid + 1, r, it);
  val[x] = val[x << 1];
  val[x].mul(val[(x << 1) | 1]);
}
void update1(long long x, long long l, long long r, long long it) {
  if (l == r) {
    val[x].s[2][3] = num[a[l] - '0'];
    return;
  }
  long long mid = (l + r) >> 1;
  if (mid >= it) {
    update1(x << 1, l, mid, it);
  } else
    update1((x << 1) | 1, mid + 1, r, it);
  val[x] = val[x << 1];
  val[x].mul(val[(x << 1) | 1]);
}
void update2(long long x, long long l, long long r, long long it) {
  if (l == r) {
    val[x].s[2][3] = 0;
    return;
  }
  long long mid = (l + r) >> 1;
  if (mid >= it) {
    update2(x << 1, l, mid, it);
  } else
    update2((x << 1) | 1, mid + 1, r, it);
  val[x] = val[x << 1];
  val[x].mul(val[(x << 1) | 1]);
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  t.n = 1;
  t.m = 3;
  t.s[1][1] = t.s[1][2] = 0;
  t.s[1][3] = 1;
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  build(1, 1, n);
  matrix now = t;
  now.mul(val[1]);
  for (long long i = 1; i <= m; i++) {
    long long it;
    char to;
    cin >> it >> to;
    char lst = a[it];
    a[it] = to;
    if (it < n && (to == '1' && lst != '1')) update1(1, 1, n, it + 1);
    if (it < n && (to != '1' && lst == '1')) update2(1, 1, n, it + 1);
    if (it > 1 && a[it - 1] == '1') update1(1, 1, n, it);
    update(1, 1, n, it);
    now = t;
    now.mul(val[1]);
    cout << now.s[1][3] << '\n';
  }
  return 0;
}
