#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector", 2, 3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <typename T>
void read(T &a) {
  T x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  a = x * f;
}
template <typename T>
void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10) return (void)putchar(x + '0');
  write(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
void writeln(T x) {
  write(x);
  putchar('\n');
}
template <typename T>
void writes(T x) {
  write(x);
  putchar(' ');
}
template <typename T, typename... Args>
void read(T &t, Args &...args) {
  read(t);
  read(args...);
}
template <typename T, typename... Args>
void writes(T t, Args... args) {
  writes(t);
  writes(args...);
}
template <typename T, typename... Args>
void writeln(T t, Args... args) {
  writes(t);
  writes(args...);
  putchar('\n');
}
const long long mod = 998244353;
long long n, m, a[500005];
struct Matrix {
  long long a[2][2];
  Matrix() { memset(a, 0, sizeof(a)); }
  Matrix operator*(const Matrix &tmp) {
    Matrix res;
    for (long long i = 0; i < 2; i++)
      for (long long k = 0; k < 2; k++)
        for (long long j = 0; j < 2; j++)
          res.a[i][j] = (res.a[i][j] + a[i][k] * tmp.a[k][j]) % mod;
    return res;
  }
  void print() {
    for (long long i = 0; i < 2; i++, cout << endl)
      for (long long j = 0; j < 2; j++) cout << a[i][j] << ' ';
  }
};
struct Segment_Tree {
  Matrix sum[500005 << 2];
  void pushup(long long now) { sum[now] = sum[now << 1 | 1] * sum[now << 1]; }
  void build(long long now, long long l, long long r) {
    if (l == r) {
      sum[now].a[0][0] = a[l] + 1;
      sum[now].a[1][0] = 1;
      sum[now].a[0][1] = (a[l - 1] == 1) ? 9 - a[l] : 0;
      return;
    }
    long long mid = (l + r) >> 1;
    build(now << 1, l, mid);
    build(now << 1 | 1, mid + 1, r);
    pushup(now);
  }
  void update(long long now, long long l, long long r, long long p) {
    if (l == r) {
      sum[now].a[0][0] = a[l] + 1;
      sum[now].a[1][0] = 1;
      sum[now].a[0][1] = (a[l - 1] == 1) ? 9 - a[l] : 0;
      return;
    }
    long long mid = (l + r) >> 1;
    if (p <= mid) update(now << 1, l, mid, p);
    if (p > mid) update(now << 1 | 1, mid + 1, r, p);
    pushup(now);
  }
} T;
signed main() {
  read(n, m);
  for (long long i = 1; i <= n; i++) scanf("%1lld", &a[i]);
  T.build(1, 1, n);
  Matrix bas;
  bas.a[0][0] = 1;
  bas.a[1][0] = 1;
  while (m--) {
    long long x, d;
    read(x, d);
    a[x] = d;
    T.update(1, 1, n, x);
    if (x < n) T.update(1, 1, n, x + 1);
    writeln((T.sum[1] * bas).a[0][0]);
  }
  return 0;
}
