#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int mod = 998244353;
struct segment {
  int len, total, ml, mr, mid;
  int g[2];
};
int num[20];
int merge(int x, int y) {
  if (x == 1) {
    return num[x * 10 + y];
  }
  return 0;
}
int add(int x, int y) { return ((x + y) % mod + mod) % mod; }
int mul(int x, int y) { return (long long)x * y % mod; }
int mypow(int x, int c) {
  int ret = 1;
  while (c > 0) {
    if (c & 1) {
      ret = mul(ret, x);
    }
    c /= 2;
    x = mul(x, x);
  }
  return ret;
}
segment merge(segment a, segment b) {
  segment ret;
  ret.g[0] = a.g[0], ret.g[1] = b.g[1];
  ret.total =
      add(mul(a.total, b.total), mul(merge(a.g[1], b.g[0]), mul(a.mr, b.ml)));
  ret.ml =
      add(mul(a.ml, b.total), mul(merge(a.g[1], b.g[0]), mul(a.mid, b.ml)));
  ret.mr =
      add(mul(a.total, b.mr), mul(merge(a.g[1], b.g[0]), mul(a.mr, b.mid)));
  ret.mid = add(mul(a.ml, b.mr), mul(merge(a.g[1], b.g[0]), mul(a.mid, b.mid)));
  return ret;
}
char c[N];
segment seg[N * 4];
void init(int pos, int l, int r) {
  if (l == r) {
    int num = c[l] - '0';
    seg[pos].g[0] = seg[pos].g[1] = num;
    seg[pos].total = num + 1;
    seg[pos].ml = seg[pos].mr = 1;
    seg[pos].mid = 0;
    return;
  }
  int mid = (l + r) / 2;
  init(pos * 2, l, mid);
  init(pos * 2 + 1, mid + 1, r);
  seg[pos] = merge(seg[pos * 2], seg[pos * 2 + 1]);
}
void update(int pos, int l, int r, int ind, int num) {
  if (l == r) {
    seg[pos].g[0] = seg[pos].g[1] = num;
    seg[pos].total = num + 1;
    seg[pos].ml = seg[pos].mr = 1;
    seg[pos].mid = 0;
    return;
  }
  int mid = (l + r) / 2;
  if (ind <= mid) {
    update(pos * 2, l, mid, ind, num);
  } else {
    update(pos * 2 + 1, mid + 1, r, ind, num);
  }
  seg[pos] = merge(seg[pos * 2], seg[pos * 2 + 1]);
}
void solve() {
  int n, m;
  scanf("%d %d %s ", &n, &m, c + 1);
  for (int i = 10; i < 20; ++i) {
    for (int x = 0; x < 10; ++x) {
      if (i - x >= 0 && (i - x) < 10) ++num[i];
    }
  }
  init(1, 1, n);
  while (m--) {
    int x, d;
    scanf("%d %d ", &x, &d);
    update(1, 1, n, x, d);
    printf("%d\n", seg[1].total);
  }
}
int main() {
  solve();
  return 0;
}
