#include <bits/stdc++.h>
using namespace std;
inline int add(int _a, int _b) {
  if (_a < 0) {
    _a += 998244353;
  }
  if (_b < 0) {
    _b += 998244353;
  }
  if (_a + _b >= 998244353) {
    return _a + _b - 998244353;
  }
  return _a + _b;
}
inline int mul(int _a, int _b) {
  if (_a < 0) {
    _a += 998244353;
  }
  if (_b < 0) {
    _b += 998244353;
  }
  return ((long long int)((long long int)_a * (long long int)_b)) % 998244353;
}
struct matrix {
  int a, b, c, d;
  matrix() {}
  matrix(int _a, int _b, int _c, int _d) { a = _a, b = _b, c = _c, d = _d; }
  matrix operator*(const matrix& o) const {
    return matrix(add(mul(a, o.a), mul(b, o.c)), add(mul(a, o.b), mul(b, o.d)),
                  add(mul(c, o.a), mul(d, o.c)), add(mul(c, o.b), mul(d, o.d)));
  }
};
const int N = 5e5;
matrix tree[4 * N + 10];
int n, m;
char str[N + 5];
void mrg(int iter) { tree[iter] = tree[2 * iter + 1] * tree[2 * iter + 2]; }
void make_tree(int lo, int hi, int iter) {
  int mid = (lo + hi) >> 1;
  if (lo == hi) {
    int x = str[lo] - '0';
    int y = str[lo + 1] - '0';
    int one = x + 1, two;
    if (x * 10 + y <= 9)
      two = 0;
    else if (x * 10 + y <= 18)
      two = 18 - (x * 10 + y) + 1;
    else
      two = 0;
    tree[iter] = matrix(one, two, 1, 0);
    return;
  } else if (lo < hi) {
    make_tree(lo, mid, 2 * iter + 1);
    make_tree(mid + 1, hi, 2 * iter + 2);
    mrg(iter);
  }
}
void update(int lo, int hi, int iter, int idx, matrix mat) {
  int mid = (lo + hi) >> 1;
  if (lo == hi) {
    tree[iter] = mat;
    return;
  }
  if (idx >= lo && idx <= mid) {
    update(lo, mid, 2 * iter + 1, idx, mat);
  } else {
    update(mid + 1, hi, 2 * iter + 2, idx, mat);
  }
  mrg(iter);
}
void solve() {
  int i, j;
  make_tree(0, n - 2, 0);
  for (i = 0; i < m; ++i) {
    int idx, d;
    scanf("%d %d", &idx, &d);
    --idx;
    str[idx] = (char)(d + '0');
    if (n <= 1) {
      printf("%d", str[idx] - '0' + 1), puts("");
      continue;
    }
    if (idx < n - 1) {
      int x = str[idx] - '0';
      int y = str[idx + 1] - '0';
      int one = x + 1, two;
      if (x * 10 + y <= 9)
        two = 0;
      else if (x * 10 + y <= 18)
        two = 18 - (x * 10 + y) + 1;
      else
        two = 0;
      update(0, n - 2, 0, idx, matrix(one, two, 1, 0));
    }
    if (idx - 1 >= 0) {
      int x = str[idx - 1] - '0';
      int y = str[idx] - '0';
      int one = x + 1, two;
      if (x * 10 + y <= 9)
        two = 0;
      else if (x * 10 + y <= 18)
        two = 18 - (x * 10 + y) + 1;
      else
        two = 0;
      update(0, n - 2, 0, idx - 1, matrix(one, two, 1, 0));
    }
    int x = str[n - 1] - '0' + 1;
    int y = 1;
    int ans = add(mul(x, tree[0].a), mul(y, tree[0].b));
    printf("%d", ans), puts("");
  }
}
int main() {
  int i, j;
  scanf("%d %d", &n, &m);
  scanf("%s", str);
  solve();
}
