#include <bits/stdc++.h>
using namespace std;
template <class T = long long int>
T nxt() {
  T x;
  cin >> x;
  return x;
}
long long int pw(long long int a, long long int b, long long int mod) {
  if (!b) return 1;
  if (b & 1) return a * pw(a * a % mod, b / 2, mod) % mod;
  return pw(a * a % mod, b / 2, mod) % mod;
}
const long long int N = 5e5 + 10;
const long long int MOD = 998244353;
const long long int INF = 1e18;
long long int n, q, A[N], seg[N << 2][4];
string s;
void Merge(int id, int l, int mid, int r) {
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      seg[id][(i << 1) | j] = seg[2 * id][i << 1] * seg[2 * id + 1][j] % MOD;
      seg[id][(i << 1) | j] += (A[mid - 1] == 1) * (9 - A[mid]) *
                               seg[2 * id][(i << 1) | 1] % MOD *
                               seg[2 * id + 1][2 | j] % MOD;
      seg[id][(i << 1) | j] %= MOD;
    }
  }
}
void Build(int id, int l, int r) {
  if (r - l == 1) {
    seg[id][0b00] = A[l] + 1;
    seg[id][0b01] = seg[id][0b10] = 1;
    seg[id][0b11] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  Build(2 * id, l, mid);
  Build(2 * id + 1, mid, r);
  Merge(id, l, mid, r);
}
void Modify(int id, int l, int r, int ind, int val) {
  if (r - l == 1) {
    A[l] = val;
    seg[id][0b00] = A[l] + 1;
    seg[id][0b01] = seg[id][0b10] = 1;
    seg[id][0b11] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (ind < mid)
    Modify(2 * id, l, mid, ind, val);
  else
    Modify(2 * id + 1, mid, r, ind, val);
  Merge(id, l, mid, r);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> q >> s;
  for (int i = 0; i < n; i++) {
    A[i] = s[i] - '0';
  }
  Build(1, 0, n);
  while (q--) {
    int ind, d;
    cin >> ind >> d;
    ind--;
    Modify(1, 0, n, ind, d);
    cout << seg[1][0b00] << '\n';
  }
  return 0;
}
