#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 20;
const int maxk = 11;
const int mod = 998244353;
int dp[maxn][maxk];
int val1[maxk], val[maxk];
int n;
string s;
inline void mkay(int &a) {
  if (a >= mod)
    a -= mod;
  else if (a < 0)
    a += mod;
}
int bpw(int a, int b) {
  if (!b) return 1;
  int x = bpw(a, b / 2);
  x = 1LL * x * x % mod;
  if (b & 1) x = 1LL * x * a % mod;
  return x;
}
set<int> st;
int res = 1;
int find_bef(int pos1) {
  auto it = st.lower_bound(pos1);
  it--;
  return *it + 1;
}
void build(int start = 0) {
  if (start == n) return;
  int val = start;
  while (start < n && s[start] == '1') start++;
  if (start == n) start--;
  st.insert(start);
  res = 1LL * res * dp[start - val][s[start] - '0'] % mod;
  build(start + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  st.insert(-1);
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++) {
      if (i + j >= 10)
        val1[(i + j) % 10]++;
      else
        val[i + j]++;
    }
  int q;
  cin >> n >> q >> s;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j < 10; j++) {
      if (!i)
        dp[i][j] = val[j];
      else if (i == 1)
        mkay(dp[i][j] = val1[j] + 1LL * val[1] * val[j] % mod);
      else {
        mkay(dp[i][j] += 1LL * dp[i - 1][j] * val[1] % mod);
        mkay(dp[i][j] += 1LL * dp[i - 2][j] * val1[1] % mod);
      }
    }
  build();
  while (q--) {
    int p, d;
    cin >> p >> d;
    p--;
    char last = s[p];
    if (last - '0' == d) {
      cout << res << endl;
      continue;
    }
    s[p] = d + '0';
    int l = find_bef(p);
    if (d == 1) {
      res = 1LL * res * bpw(dp[p - l][last - '0'], mod - 2) % mod;
      if (p == n - 1) {
        res = 1LL * res * dp[p - l][d] % mod;
        cout << res << endl;
        continue;
      }
      auto it = st.upper_bound(p);
      int r = *it;
      res = 1LL * res * bpw(dp[r - p - 1][s[r] - '0'], mod - 2) % mod;
      res = 1LL * res * dp[r - l][s[r] - '0'] % mod;
      st.erase(p);
    } else if (last == '1') {
      if (p == n - 1) {
        res = 1LL * res * bpw(dp[p - l][last - '0'], mod - 2) % mod;
        res = 1LL * res * dp[p - l][d] % mod;
        cout << res << endl;
        continue;
      }
      auto it = st.upper_bound(p);
      int r = *it;
      res = 1LL * res * bpw(dp[r - l][s[r] - '0'], mod - 2) % mod;
      res = 1LL * res * dp[r - p - 1][s[r] - '0'] % mod;
      res = 1LL * res * dp[p - l][d] % mod;
      st.insert(p);
    } else {
      res = 1LL * res * bpw(dp[p - l][last - '0'], mod - 2) % mod;
      res = 1LL * res * dp[p - l][d] % mod;
    }
    cout << res << endl;
  }
}
