#include <bits/stdc++.h>
using namespace std;
const long long Inf = 1e10;
const long long MaxN = 5e5 + 5;
const long long md = 998244353;
long long binpow(long long n, long long m, long long mod = md) {
  long long Res = 1;
  while (m) {
    if (m & 1) {
      Res *= n;
      Res %= mod;
    }
    n *= n;
    n %= mod;
    m >>= 1;
  }
  return Res;
}
struct Vert {
  long long val[4];
  long long len;
} Tree[MaxN * 4];
long long Mt[MaxN];
int add(int a, int b) {
  a += b;
  if (a >= md) a -= md;
  return a;
}
int mul(int a, int b) { return a * 1ll * b % md; }
Vert merge(const Vert& a, const Vert& b, int l, int r) {
  Vert c;
  int na = a.len == 1 ? 0 : 1;
  int nb = b.len == 1 ? 0 : 2;
  c.len = a.len + b.len;
  c.val[0] = mul(a.val[na], b.val[nb]);
  c.val[1] = mul(a.val[na], b.val[3]);
  c.val[2] = mul(a.val[3], b.val[nb]);
  c.val[3] = mul(a.val[3], b.val[3]);
  if (l == 1) {
    na = a.len == 1 ? 2 : 0;
    nb = b.len == 1 ? 1 : 0;
    c.val[na + nb] =
        add(c.val[na + nb], mul(mul(a.val[0], b.val[0]), 19 - (l * 10 + r)));
    c.val[1 + na] =
        add(c.val[1 + na], mul(mul(a.val[0], b.val[1]), 19 - (l * 10 + r)));
    c.val[2 + nb] =
        add(c.val[2 + nb], mul(mul(a.val[2], b.val[0]), 19 - (l * 10 + r)));
    c.val[3] = add(c.val[3], mul(mul(a.val[2], b.val[1]), 19 - (l * 10 + r)));
  }
  return c;
}
void Build(long long l, long long r, long long id) {
  if (l == r) {
    Tree[id].val[0] = 1;
    Tree[id].val[3] = Mt[l] + 1;
    Tree[id].len = 1;
  } else {
    long long mid = (l + r) / 2;
    Build(l, mid, id * 2 + 1);
    Build(mid + 1, r, id * 2 + 2);
    Tree[id] = merge(Tree[id * 2 + 1], Tree[id * 2 + 2], Mt[mid], Mt[mid + 1]);
  }
}
void edit(long long l, long long r, long long x, long long a, long long id) {
  if (l == r) {
    Tree[id].val[3] = Mt[l] + 1;
  } else {
    long long mid = (l + r) / 2;
    if (x <= mid)
      edit(l, mid, x, a, id * 2 + 1);
    else if (x > mid)
      edit(mid + 1, r, x, a, id * 2 + 2);
    Tree[id] = merge(Tree[id * 2 + 1], Tree[id * 2 + 2], Mt[mid], Mt[mid + 1]);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  long long N, M;
  cin >> N >> M;
  string s;
  cin >> s;
  for (int i = 0; i < (s).size(); i++) {
    Mt[i] = s[i] - '0';
  }
  Build(0, N - 1, 0);
  long long t = 1;
  while (M--) {
    long long x, d;
    cin >> x >> d;
    x--;
    Mt[x] = d;
    if (t == 50) cerr << 1;
    edit(0, N - 1, x, d, 0);
    cout << Tree[0].val[3] << '\n';
    t++;
  }
  return 0;
}
