#include <bits/stdc++.h>
template <typename... Args>
void load_vars(Args&&... args) {
  (std::cin >> ... >> args);
}
template <typename T>
void load_1d_vec(std::vector<T>& v) {
  for (T& x : v) std::cin >> x;
}
template <typename T>
void load_pairs_vec(std::vector<std::vector<T> >& v, int n_lines, int shift = 0,
                    bool both = false) {
  for (int i = 0; i < n_lines; ++i) {
    T x, y;
    std::cin >> x >> y;
    x -= shift;
    y -= shift;
    v[x].push_back(y);
    if (both) {
      v[y].push_back(x);
    }
  }
}
template <typename T, typename S>
void load_triples_vec(std::vector<std::vector<std::pair<T, S> > >& v,
                      int n_lines, int shift = 0, bool both = false) {
  for (int i = 0; i < n_lines; ++i) {
    T x;
    S y;
    int z;
    std::cin >> x >> y >> z;
    x -= shift;
    y -= shift;
    v[x].push_back({y, z});
    if (both) {
      v[y].push_back({x, z});
    }
  }
}
template <typename T, typename S>
void load_2vecs_parallel(std::vector<T>& v1, std::vector<S>& v2, int n_lines) {
  for (int i = 0; i < n_lines; ++i) {
    T x;
    S y;
    std::cin >> x >> y;
    v1[i] = x;
    v2[i] = y;
  }
}
int n, m;
std::string s;
std::vector<int> x;
std::vector<char> d;
void take_input() {
  load_vars(n, m, s);
  x = std::vector<int>(m);
  d = std::vector<char>(m);
  load_2vecs_parallel(x, d, m);
}
const int ALPH_SIZE = 10;
const int N = (int)5e5 + ALPH_SIZE - 1;
int dp[N][ALPH_SIZE];
const int MOD = 998244353;
int res = 1;
std::set<std::pair<int, int> > lr;
int mul(int a, int b) { return (a * 1LL * b) % MOD; }
void getLR(int& l, int& r, int pos) {
  l = r = -1;
  auto it = lr.lower_bound({pos, n});
  if (it == lr.begin()) return;
  --it;
  if (not(it->first <= pos and pos <= it->second)) return;
  l = it->first, r = it->second;
}
int bp(int a, int n) {
  int res = 1;
  for (; n > 0; n >>= 1) {
    if (n & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
  }
  return res;
}
int inv(int a) {
  int ia = bp(a, MOD - 2);
  assert(mul(a, ia) == 1);
  return ia;
}
void updRes(int l, int r, int c) {
  assert(l <= r);
  int val = dp[r - l + (r + 1 != n)][r + 1 == n ? 1 : s[r + 1] - '0'];
  if (c == 1) {
    assert(!lr.count({l, r}));
    lr.insert({l, r});
    res = mul(res, val);
  } else {
    assert(lr.count({l, r}));
    lr.erase({l, r});
    res = mul(res, inv(val));
  }
}
int main(int argc, char const* argv[]) {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  take_input();
  for (int i = 0; i < ALPH_SIZE; ++i) {
    dp[0][i] = i + 1;
    dp[1][i] = 2 * (i + 1) + (9 - i);
  }
  for (int i = 2; i < N; ++i) {
    for (int j = 0; j < ALPH_SIZE; ++j) {
      dp[i][j] = (2LL * dp[i - 1][j] + 8LL * dp[i - 2][j]) % MOD;
    }
  }
  for (int l = 0; l < n;) {
    int r = l;
    while (r < n and s[r] == '1') {
      ++r;
    }
    res = mul(res, dp[r - l - (r == n)][r == n ? 1 : s[r] - '0']);
    if (l != r) {
      lr.insert({l, r - 1});
    }
    l = r + 1;
  }
  for (int i = 0; i < m; ++i) {
    int pos = x[i] - 1;
    char ch = d[i];
    if (ch == '1') {
      if (s[pos] != '1') {
        int l1, r1, l2, r2;
        getLR(l1, r1, pos - 1);
        getLR(l2, r2, pos + 1);
        int l = pos, r = pos;
        if (l1 != -1) {
          assert(r1 == pos - 1);
          updRes(l1, r1, -1);
          l = l1;
        } else {
          res = mul(res, inv(dp[0][s[pos] - '0']));
        }
        if (l2 != -1) {
          assert(l2 == pos + 1);
          updRes(l2, r2, -1);
          r = r2;
        } else {
          if (pos + 1 != n) {
            res = mul(res, inv(dp[0][s[pos + 1] - '0']));
          }
        }
        s[pos] = ch;
        updRes(l, r, 1);
      }
    } else {
      if (s[pos] != '1') {
        if (pos - 1 >= 0 and s[pos - 1] == '1') {
          int l, r;
          getLR(l, r, pos - 1);
          updRes(l, r, -1);
          s[pos] = ch;
          updRes(l, r, 1);
        } else {
          res = mul(res, dp[0][ch - '0']);
          res = mul(res, inv(dp[0][s[pos] - '0']));
          s[pos] = ch;
        }
      } else {
        int l, r;
        getLR(l, r, pos);
        assert(l != -1 and r != -1);
        updRes(l, r, -1);
        s[pos] = ch;
        if (l == r) {
          res = mul(res, dp[0][s[pos] - '0']);
          if (pos + 1 < n) {
            res = mul(res, dp[0][s[pos + 1] - '0']);
          }
        } else if (pos == l) {
          res = mul(res, dp[0][s[pos] - '0']);
          updRes(l + 1, r, 1);
        } else if (pos == r) {
          if (pos + 1 != n) {
            res = mul(res, dp[0][s[pos + 1] - '0']);
          }
          updRes(l, r - 1, 1);
        } else {
          updRes(l, pos - 1, 1);
          updRes(pos + 1, r, 1);
        }
      }
    }
    std::cout << res << '\n';
  }
  return 0;
}
