#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::pair;
using std::string;
using std::vector;
using vi = vector<int>;
using pii = pair<int, int>;
using vii = vector<pii>;
using ll = long long;
int solve();
int main(int argc, char* argv[]) {
  ::std::ios::sync_with_stdio(false);
  ::std::cin.tie(0);
  ::std::cout.tie(0);
  int t = 1;
  for (int i = 1; i <= t; ++i) {
    solve();
  }
}
constexpr int MAX_N = 505050;
constexpr int MOD = 998244353;
int t[4 * MAX_N][2][2];
int n, m;
char s[MAX_N];
void pushup(int k) {
  memset(t[k], 0, sizeof(t[k]));
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 2; ++j) {
      t[k][i][j] = (t[k * 2][i][0] * 1LL * t[k * 2 + 1][0][j] +
                    t[k * 2][i][1] * 1LL * t[k * 2 + 1][1][j]) %
                   MOD;
    }
  }
}
void build(int k, int L, int R) {
  if (L == R) {
    memset(t[k], 0, sizeof(t[k]));
    t[k][1][0] = 1;
    t[k][0][0] = s[L] + 1;
    if (s[L] == 1) t[k][0][1] = 9 - s[L + 1];
    return;
  }
  int mid = (L + R) / 2;
  build(k * 2, L, mid);
  build(k * 2 + 1, mid + 1, R);
  pushup(k);
}
void change(int k, int L, int R, int P) {
  if (L == R) {
    memset(t[k], 0, sizeof(t[k]));
    t[k][1][0] = 1;
    t[k][0][0] = s[L] + 1;
    if (s[L] == 1) t[k][0][1] = 9 - s[L + 1];
    return;
  }
  int mid = (L + R) / 2;
  if (P <= mid)
    change(k * 2, L, mid, P);
  else
    change(k * 2 + 1, mid + 1, R, P);
  pushup(k);
}
int solve() {
  string str;
  cin >> n >> m;
  cin >> str;
  for (int i = 1; i <= n; ++i) s[i] = str[i - 1] - '0';
  build(1, 1, n);
  while (m--) {
    int x, y;
    cin >> x >> y;
    s[x] = y;
    if (x != 1) change(1, 1, n, x - 1);
    change(1, 1, n, x);
    cout << t[1][0][0] << '\n';
  }
  return 0;
}
