#include <bits/stdc++.h>
using namespace std;
struct node {
  node *l, *r;
  long long ans[2][2];
  int a, b;
  node(int _a, int _b) : l(NULL), r(NULL), a(_a), b(_b) {
    memset(ans, 0, sizeof(ans));
  }
} * root;
int mod = 998244353;
int a[500005];
int cal(int first) {
  if (first < 10 || first > 18) return 0;
  return 9 - (first - 10);
}
void pull(node *n) {
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      n->ans[i][j] = (n->l->ans[i][0] * n->r->ans[0][j] +
                      n->l->ans[i][1] * n->r->ans[1][j] % mod *
                          cal(a[n->l->b] * 10 + a[n->r->a])) %
                     mod;
}
void build(node *n) {
  if (n->a == n->b) {
    n->ans[0][0] = a[n->a] + 1;
    n->ans[1][0] = 1;
    n->ans[0][1] = 1;
    return;
  }
  int mid = (n->a + n->b) / 2;
  n->l = new node(n->a, mid);
  n->r = new node(mid + 1, n->b);
  build(n->l);
  build(n->r);
  pull(n);
}
void revise(node *n, int first, int d) {
  if (n->a == n->b) {
    a[n->a] = d;
    n->ans[0][0] = d + 1;
    n->ans[1][0] = 1;
    n->ans[0][1] = 1;
    return;
  }
  int mid = (n->a + n->b) / 2;
  if (first <= mid)
    revise(n->l, first, d);
  else
    revise(n->r, first, d);
  pull(n);
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  root = new node(1, n);
  for (int i = 1; i <= n; i++) {
    char c;
    scanf(" %c", &c);
    a[i] = c - '0';
  }
  build(root);
  while (m--) {
    int first, d;
    scanf("%d %d", &first, &d);
    revise(root, first, d);
    printf("%lld\n", root->ans[0][0]);
  }
}
