#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 998244353;
const long long int INF = 2000000000;
const long long BIG = 1446803456761533460LL;
const long long int maxn = 500010;
long long int n, m, A[maxn];
long long int seg[maxn * 4][4];
void merge(long long int x, long long int l, long long int r) {
  seg[x][0] = 1LL * seg[(x << 1)][0] * seg[((x << 1) | 1)][0] % MOD;
  seg[x][1] = 1LL * seg[(x << 1)][0] * seg[((x << 1) | 1)][1] % MOD;
  seg[x][2] = 1LL * seg[(x << 1)][2] * seg[((x << 1) | 1)][0] % MOD;
  seg[x][3] = 1LL * seg[(x << 1)][2] * seg[((x << 1) | 1)][1] % MOD;
  long long int a = A[((l + r) >> 1) - 1], b = A[((l + r) >> 1)];
  if (a == 1) {
    seg[x][0] = ((seg[x][0]) +
                 (1LL * (9 - b) * seg[(x << 1)][1] * seg[((x << 1) | 1)][2])) %
                MOD;
    if (r - ((l + r) >> 1) > 1)
      seg[x][1] = ((seg[x][1]) + (1LL * (9 - b) * seg[(x << 1)][1] *
                                  seg[((x << 1) | 1)][3])) %
                  MOD;
    if (((l + r) >> 1) - l > 1)
      seg[x][2] = ((seg[x][2]) + (1LL * (9 - b) * seg[(x << 1)][3] *
                                  seg[((x << 1) | 1)][2])) %
                  MOD;
    if (r - ((l + r) >> 1) > 1 && ((l + r) >> 1) - l > 1)
      seg[x][3] = ((seg[x][3]) + (1LL * (9 - b) * seg[(x << 1)][3] *
                                  seg[((x << 1) | 1)][3])) %
                  MOD;
  }
}
void build(long long int x = 1, long long int l = 0, long long int r = n) {
  if (r - l == 1) {
    seg[x][1] = seg[x][2] = seg[x][3] = 1;
    seg[x][0] = A[l] + 1;
  } else {
    build((x << 1), l, ((l + r) >> 1));
    build(((x << 1) | 1), ((l + r) >> 1), r);
    merge(x, l, r);
  }
}
void update(long long int p, long long int x = 1, long long int l = 0,
            long long int r = n) {
  if (r - l == 1) {
    seg[x][1] = seg[x][2] = seg[x][3] = 1;
    seg[x][0] = A[l] + 1;
  } else {
    if (p < ((l + r) >> 1))
      update(p, (x << 1), l, ((l + r) >> 1));
    else
      update(p, ((x << 1) | 1), ((l + r) >> 1), r);
    merge(x, l, r);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (long long int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    A[i] = c - '0';
  }
  build();
  for (long long int i = 0; i < m; ++i) {
    long long int x, d;
    cin >> x >> d;
    --x;
    A[x] = d;
    update(x);
    cout << seg[1][0] << '\n';
  }
}
