#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 9;
const int M = 1e3 + 9;
const int INF = 2e9 + 9;
const long double EPS = 1e-16;
const long double BEPS = 1e-8;
const int MOD = 998244353;
struct matrix {
  long long a[2][2];
  matrix(long long a1 = 0, long long a2 = 0, long long a3 = 0,
         long long a4 = 0) {
    a[0][0] = a1;
    a[0][1] = a2;
    a[1][0] = a3;
    a[1][1] = a4;
  }
};
matrix operator*(matrix &m1, matrix &m2) {
  matrix res;
  res.a[0][0] = (m1.a[0][0] * m2.a[0][0] + m1.a[0][1] * m2.a[1][0]) % MOD;
  res.a[0][1] = (m1.a[0][0] * m2.a[0][1] + m1.a[0][1] * m2.a[1][1]) % MOD;
  res.a[1][0] = (m1.a[1][0] * m2.a[0][0] + m1.a[1][1] * m2.a[1][0]) % MOD;
  res.a[1][1] = (m1.a[1][0] * m2.a[0][1] + m1.a[1][1] * m2.a[1][1]) % MOD;
  return res;
}
ostream &operator<<(ostream &out, matrix &mat) {
  out << mat.a[0][0] << " " << mat.a[0][1] << "\n";
  out << mat.a[1][0] << " " << mat.a[1][1] << "\n";
  return out;
}
matrix t[N * 4];
int a[N];
void update(int v, matrix matr, int pos, int l, int r) {
  if (l + 1 == r) {
    t[v] = matr;
    return;
  }
  int m = (l + r) / 2;
  if (pos < m)
    update(v * 2, matr, pos, l, m);
  else
    update(v * 2 + 1, matr, pos, m, r);
  t[v] = t[v * 2 + 1] * t[v * 2];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  string s;
  cin >> n >> m >> s;
  reverse(s.begin(), s.end());
  for (int i = 0; i < N * 4; i++) {
    t[i].a[0][0] = t[i].a[1][1] = 1;
  }
  for (int i = 0; i < n; i++) {
    a[i] = s[i] - '0';
  }
  for (int i = 0; i < n; i++) {
    matrix cur_mat;
    int alpha_num = a[i], beta_num = 0;
    if (i > 0) beta_num = a[i] * 10 + a[i - 1];
    cur_mat.a[1][0] = 1;
    if (beta_num < 10 || beta_num > 18) beta_num = 0;
    if (!i)
      cur_mat.a[0][0] = alpha_num + 1;
    else {
      cur_mat.a[0][0] = alpha_num + 1;
      if (beta_num) cur_mat.a[0][1] = 18 - beta_num + 1;
    }
    update(1, cur_mat, i, 0, n);
  }
  while (m) {
    matrix mat1, mat2;
    int ind, val;
    cin >> ind >> val;
    ind = n - ind;
    a[ind] = val;
    mat1.a[0][0] = a[ind] + 1;
    mat1.a[1][0] = 1;
    if (ind) {
      int beta_num = a[ind] * 10 + a[ind - 1];
      if (beta_num >= 10 && beta_num <= 18) mat1.a[0][1] = 18 - beta_num + 1;
    }
    update(1, mat1, ind, 0, n);
    if (ind + 1 < n) {
      mat2.a[0][0] = a[ind + 1] + 1;
      int beta_num = a[ind + 1] * 10 + a[ind];
      if (beta_num >= 10 && beta_num <= 18) mat2.a[0][1] = 18 - beta_num + 1;
      mat2.a[1][0] = 1;
      update(1, mat2, ind + 1, 0, n);
    }
    cout << t[1].a[0][0] << '\n';
    m--;
  }
  return 0;
}
