#include <bits/stdc++.h>
using namespace std;
template <unsigned MOD>
class modular_int {
 public:
 protected:
  unsigned x;

 public:
  modular_int inv() const {
    unsigned a = MOD, b = x;
    int u = 0, v = 1;
    while (b) {
      int t = a / b;
      a -= t * b, std::swap(a, b);
      u -= t * v, std::swap(u, v);
    }
    if (u < 0) u += MOD;
    return modular_int(u);
  }
  inline modular_int pow(long long y) const {
    modular_int b = *this, r = 1;
    if (y < 0) b = b.inv(), y = -y;
    for (; y; y >>= 1, b *= b)
      if (y & 1) r *= b;
    return r;
  }

 public:
  modular_int() { x = 0; }
  modular_int(const modular_int &y) { x = y.x; }
  modular_int(modular_int &&y) { x = y.x; }
  inline void clear() { *this = modular_int(); }
  inline int to_int() const { return (int)x; }
  inline unsigned value() const { return x; }

 public:
  modular_int(int y) {
    if (y < 0 || (int)MOD <= y) y %= (int)MOD;
    if (y < 0) y += MOD;
    x = y;
  }
  modular_int(unsigned y) {
    if (MOD <= y)
      x = y % MOD;
    else
      x = y;
  }
  modular_int(long long y) {
    if (y < 0 || MOD <= y) y %= MOD;
    if (y < 0) y += MOD;
    x = y;
  }
  modular_int(unsigned long long y) {
    if (MOD <= y)
      x = y % MOD;
    else
      x = y;
  }
  modular_int &operator=(const modular_int &y) {
    x = y.x;
    return *this;
  }
  modular_int &operator=(const int &y) { return *this = modular_int(y); }
  modular_int &operator=(const long long &y) { return *this = modular_int(y); }
  modular_int &operator=(const unsigned int &y) {
    return *this = modular_int(y);
  }
  modular_int &operator=(const unsigned long long &y) {
    return *this = modular_int(y);
  }
  modular_int &operator+=(const modular_int &y) {
    if ((x += y.x) >= MOD) x -= MOD;
    return *this;
  }
  modular_int &operator-=(const modular_int &y) {
    if ((x -= y.x) & (1u << 31)) x += MOD;
    return *this;
  }
  modular_int &operator*=(const modular_int &y) {
    x = (unsigned long long)x * y.x % MOD;
    return *this;
  }
  modular_int &operator/=(const modular_int &y) {
    x = (unsigned long long)x * y.inv().x % MOD;
    return *this;
  }
  modular_int &operator+=(const int &y) { return *this += modular_int(y); }
  modular_int &operator-=(const int &y) { return *this -= modular_int(y); }
  modular_int &operator*=(const int &y) { return *this *= modular_int(y); }
  modular_int &operator/=(const int &y) { return *this /= modular_int(y); }
  modular_int &operator+=(const long long &y) {
    return *this += modular_int(y);
  }
  modular_int &operator-=(const long long &y) {
    return *this -= modular_int(y);
  }
  modular_int &operator*=(const long long &y) {
    return *this *= modular_int(y);
  }
  modular_int &operator/=(const long long &y) {
    return *this /= modular_int(y);
  }
  modular_int &operator+=(const unsigned int &y) {
    return *this += modular_int(y);
  }
  modular_int &operator-=(const unsigned int &y) {
    return *this -= modular_int(y);
  }
  modular_int &operator*=(const unsigned int &y) {
    return *this *= modular_int(y);
  }
  modular_int &operator/=(const unsigned int &y) {
    return *this /= modular_int(y);
  }
  modular_int &operator+=(const unsigned long long &y) {
    return *this += modular_int(y);
  }
  modular_int &operator-=(const unsigned long long &y) {
    return *this -= modular_int(y);
  }
  modular_int &operator*=(const unsigned long long &y) {
    return *this *= modular_int(y);
  }
  modular_int &operator/=(const unsigned long long &y) {
    return *this /= modular_int(y);
  }
  friend modular_int operator+(modular_int x, const modular_int &y) {
    return x += y;
  }
  friend modular_int operator-(modular_int x, const modular_int &y) {
    return x -= y;
  }
  friend modular_int operator*(modular_int x, const modular_int &y) {
    return x *= y;
  }
  friend modular_int operator/(modular_int x, const modular_int &y) {
    return x *= y.inv();
  }
  friend modular_int operator+(modular_int x, const int &y) { return x += y; }
  friend modular_int operator-(modular_int x, const int &y) { return x -= y; }
  friend modular_int operator*(modular_int x, const int &y) { return x *= y; }
  friend modular_int operator/(modular_int x, const int &y) { return x /= y; }
  friend modular_int operator+(modular_int x, const long long &y) {
    return x += y;
  }
  friend modular_int operator-(modular_int x, const long long &y) {
    return x -= y;
  }
  friend modular_int operator*(modular_int x, const long long &y) {
    return x *= y;
  }
  friend modular_int operator/(modular_int x, const long long &y) {
    return x /= y;
  }
  friend modular_int operator+(modular_int x, const unsigned &y) {
    return x += y;
  }
  friend modular_int operator-(modular_int x, const unsigned &y) {
    return x -= y;
  }
  friend modular_int operator*(modular_int x, const unsigned &y) {
    return x *= y;
  }
  friend modular_int operator/(modular_int x, const unsigned &y) {
    return x /= y;
  }
  friend modular_int operator+(modular_int x, const unsigned long long &y) {
    return x += y;
  }
  friend modular_int operator-(modular_int x, const unsigned long long &y) {
    return x -= y;
  }
  friend modular_int operator*(modular_int x, const unsigned long long &y) {
    return x *= y;
  }
  friend modular_int operator/(modular_int x, const unsigned long long &y) {
    return x /= y;
  }
  modular_int operator-() const { return (x ? MOD - x : 0); }
  modular_int operator++() const { return *this += 1; }
  modular_int operator--() const { return *this -= 1; }
  modular_int operator++(int) const {
    modular_int ret = *this;
    *this += 1;
    return ret;
  }
  modular_int operator--(int) const {
    modular_int ret = *this;
    *this -= 1;
    return ret;
  }
  friend bool operator<(const modular_int &x, const modular_int &y) {
    return x.x < y.x;
  }
  friend bool operator==(const modular_int &x, const modular_int &y) {
    return x.x == y.x;
  }
  friend bool operator!=(const modular_int &x, const modular_int &y) {
    return x.x != y.x;
  }
  friend std::ostream &operator<<(std::ostream &os, modular_int x) {
    return os << x.x;
  }
  friend std::istream &operator>>(std::istream &is, modular_int &x) {
    is >> x.x;
    x.x %= MOD;
    return is;
  }
};
template <typename T>
class matrix2d {
 public:
 private:
  T arr[2][2];

 public:
  matrix2d(T x = 0) {
    arr[0][0] = arr[1][1] = x;
    arr[1][0] = arr[0][1] = T(0);
  }
  matrix2d(const matrix2d &x) { memcpy(arr, x.arr, sizeof(arr)); }
  T *operator[](const int x) { return arr[x]; }
  friend matrix2d operator*(const matrix2d &a, const matrix2d &b) {
    matrix2d c(0);
    c.arr[0][0] = a.arr[0][0] * b.arr[0][0] + a.arr[0][1] * b.arr[1][0];
    c.arr[0][1] = a.arr[0][0] * b.arr[0][1] + a.arr[0][1] * b.arr[1][1];
    c.arr[1][0] = a.arr[1][0] * b.arr[0][0] + a.arr[1][1] * b.arr[1][0];
    c.arr[1][1] = a.arr[1][0] * b.arr[0][1] + a.arr[1][1] * b.arr[1][1];
    return c;
  }
  friend matrix2d operator+(const matrix2d &a, const matrix2d &b) {
    matrix2d c(0);
    c.arr[0][0] = a.arr[0][0] + b.arr[0][0];
    c.arr[0][1] = a.arr[0][1] + b.arr[0][1];
    c.arr[1][0] = a.arr[1][0] + b.arr[1][0];
    c.arr[1][1] = a.arr[1][1] + b.arr[1][1];
    return c;
  }
  friend matrix2d operator-(const matrix2d &a, const matrix2d &b) {
    matrix2d c(0);
    c.arr[0][0] = a.arr[0][0] - b.arr[0][0];
    c.arr[0][1] = a.arr[0][1] - b.arr[0][1];
    c.arr[1][0] = a.arr[1][0] - b.arr[1][0];
    c.arr[1][1] = a.arr[1][1] - b.arr[1][1];
    return c;
  }
  matrix2d inv() const {
    matrix2d c(*this);
    swap(c[0][1], c[1][0]);
    return c;
  }
};
using mint = modular_int<998244353>;
using mat = matrix2d<mint>;
static const int Maxn = 5e5 + 5;
int n, m;
char str[Maxn];
int a[Maxn];
mat b[Maxn];
struct node {
  node() { memset(this, 0, sizeof(*this)); }
  node(const node &x) { *this = x; }
  mat v;
  inline void apply(int l, int r, mat x) { v = x; }
};
inline void pullup(node &a, const node &b, const node &c) { a.v = c.v * b.v; }
class segment_tree {
 private:
  int N;
  vector<node> tr;
  inline void pushup(int p) { pullup(tr[p], tr[(p << 1)], tr[(p << 1 | 1)]); }
  template <typename... Args>
  void modify(int p, int l, int r, int L, int R, Args... args) {
    if (L == l && r == R) return tr[p].apply(l, r, args...);
    pushdown(p, l, r);
    int mid = (l + r) >> 1;
    if (R <= mid)
      modify((p << 1), l, mid, L, R, args...);
    else if (L > mid)
      modify((p << 1 | 1), mid + 1, r, L, R, args...);
    else {
      modify((p << 1), l, mid, L, mid, args...);
      modify((p << 1 | 1), mid + 1, r, mid + 1, R, args...);
    }
    pushup(p);
  }
  node query(int p, int l, int r, int L, int R) {
    if (L == l && r == R) return tr[p];
    pushdown(p, l, r);
    int mid = (l + r) >> 1;
    if (R <= mid) return query((p << 1), l, mid, L, R);
    if (L > mid) return query((p << 1 | 1), mid + 1, r, L, R);
    node left = query((p << 1), l, mid, L, mid);
    node right = query((p << 1 | 1), mid + 1, r, mid + 1, R);
    node ans;
    pullup(ans, left, right);
    return ans;
  }

 public:
  segment_tree() = default;
  template <typename... Args>
  inline void build(int len, Args... args) {
    N = len, tr.assign((N + 1) << 2, node());
    build(1, 1, N, args...);
  }
  template <typename... Args>
  inline void modify(int L, int R, Args... args) {
    if (L > R) return;
    modify(1, 1, N, L, R, args...);
  }
  inline node query(int L, int R) {
    if (L > R) return node();
    return query(1, 1, N, L, R);
  }

 private:
  void build(int p, int l, int r, mat *arr) {
    if (l == r) {
      tr[p].v = arr[l];
      return;
    }
    int mid = (l + r) >> 1;
    build((p << 1), l, mid, arr);
    build((p << 1 | 1), mid + 1, r, arr);
    pushup(p);
  }
  void pushdown(int p, int l, int r) { int mid = (l + r) >> 1; }
} sgt;
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", str + 1);
  for (int i = 1; i <= n; ++i) {
    a[i] = str[i] - 48;
    b[i][0][0] = a[i] + 1;
    b[i][0][1] = (a[i - 1] == 1) * (9 - a[i]);
    b[i][1][0] = 1;
    b[i][1][1] = 0;
  }
  sgt.build(n, b);
  while (m--) {
    int x, d;
    scanf("%d%d", &x, &d);
    a[x] = d;
    b[x][0][0] = a[x] + 1;
    b[x][0][1] = (a[x - 1] == 1) * (9 - a[x]);
    b[x][1][0] = 1;
    b[x][1][1] = 0;
    sgt.modify(x, x, b[x]);
    if (x != n) {
      b[x + 1][0][0] = a[x + 1] + 1;
      b[x + 1][0][1] = (a[x] == 1) * (9 - a[x + 1]);
      b[x + 1][1][0] = 1;
      b[x + 1][1][1] = 0;
      sgt.modify(x + 1, x + 1, b[x + 1]);
    }
    mat dp;
    dp[0][0] = 1;
    dp[0][1] = 0;
    dp[1][0] = 0;
    dp[1][1] = 0;
    printf("%u\n", (sgt.query(1, n).v * dp)[0][0].value());
  }
  return 0;
}
