#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
const int maxn = 5e5 + 10;
int N, M;
char s[maxn];
long long C[100];
long long mul(long long x, long long y) { return x * y % mod; }
long long add(long long x, long long y) {
  long long ret = x + y;
  if (ret > mod) ret %= mod;
  return ret;
}
void init() {
  for (int i = 0; i <= 18; ++i) {
    for (int a = 0; a <= 9; ++a) {
      for (int b = 0; b <= 9; ++b) {
        C[i] += (a + b == i);
      }
    }
  }
}
struct Matrix {
  long long a[2][2];
  Matrix operator*(Matrix other) const {
    Matrix mt;
    int i, j, k;
    for (i = 0; i < 2; ++i) {
      for (j = 0; j < 2; ++j) {
        mt.a[i][j] = 0;
        for (k = 0; k < 2; ++k) {
          mt.a[i][j] = add(mt.a[i][j], mul(a[i][k], other.a[k][j]));
        }
      }
    }
    return mt;
  }
};
Matrix tree[1048596];
Matrix gen(int pos) {
  Matrix ret;
  ret.a[1][0] = 1;
  ret.a[1][1] = 0;
  ret.a[0][0] = C[s[pos] - '0'];
  ret.a[0][1] = 0;
  if (pos != N && s[pos] == '1') {
    ret.a[0][1] = C[(s[pos] - '0') * 10 + (s[pos + 1] - '0')];
  }
  return ret;
}
void update(int pt, int l, int r, int index, Matrix mt) {
  if (l > r || pt < l || pt > r) return;
  if (l == r) {
    tree[index] = mt;
    return;
  }
  if (pt <= ((l + r) >> 1)) {
    update(pt, l, ((l + r) >> 1), (index << 1), mt);
  } else {
    update(pt, ((l + r) >> 1) + 1, r, (index << 1 | 1), mt);
  }
  tree[index] = tree[(index << 1)] * tree[(index << 1 | 1)];
}
void build(int l, int r, int index) {
  if (l == r) {
    tree[index] = gen(l);
  } else {
    build(l, ((l + r) >> 1), (index << 1));
    build(((l + r) >> 1) + 1, r, (index << 1 | 1));
    tree[index] = tree[(index << 1)] * tree[(index << 1 | 1)];
  }
}
int main() {
  init();
  scanf("%d %d", &N, &M);
  scanf("%s", s + 1);
  build(1, N, 1);
  while (M--) {
    int pos, val;
    scanf("%d %d", &pos, &val);
    s[pos] = '0' + val;
    Matrix m = gen(pos);
    update(pos, 1, N, 1, m);
    if (pos != 1) {
      Matrix mm = gen(pos - 1);
      update(pos - 1, 1, N, 1, mm);
    }
    printf("%lld\n", tree[1].a[0][0]);
  }
}
