#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3fll;
const long long M = 998244353;
const long long maxn = 5e5 + 107;
const double pi = acos(-1.0);
const double eps = 0.0000000001;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <typename T>
inline void pr2(T x, int k = 64) {
  long long i;
  for (i = 0; i < k; i++) fprintf(stderr, "%d", (x >> i) & 1);
  putchar(' ');
}
template <typename T>
inline void add_(T &A, int B, long long MOD = M) {
  A += B;
  (A >= MOD) && (A -= MOD);
}
template <typename T>
inline void mul_(T &A, long long B, long long MOD = M) {
  A = (A * B) % MOD;
}
template <typename T>
inline void mod_(T &A, long long MOD = M) {
  A %= MOD;
  A += MOD;
  A %= MOD;
}
template <typename T>
inline void max_(T &A, T B) {
  (A < B) && (A = B);
}
template <typename T>
inline void min_(T &A, T B) {
  (A > B) && (A = B);
}
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
inline long long powMM(long long a, long long b, long long mod = M) {
  long long ret = 1;
  for (; b; b >>= 1ll, a = a * a % mod)
    if (b & 1) ret = ret * a % mod;
  return ret;
}
int startTime;
void startTimer() { startTime = clock(); }
void printTimer() {
  fprintf(stderr, "/--- Time: %ld milliseconds ---/\n", clock() - startTime);
}
struct matrix {
  int A[2][2];
  matrix() { memset(A, 0, sizeof(A)); };
  matrix(int a, int b, int c, int d) {
    memset(A, 0, sizeof(A));
    A[0][0] = a;
    A[0][1] = b;
    A[1][0] = c;
    A[1][1] = d;
  }
} T[maxn * 4];
matrix mul(matrix &A, matrix &B) {
  matrix C;
  int i, j, k;
  for (i = 0; i <= 1; i++)
    for (j = 0; j <= 1; j++)
      for (k = 0; k <= 1; k++)
        C.A[i][j] = ((long long)A.A[i][k] * B.A[k][j] + C.A[i][j]) % M;
  return C;
}
int one[107], two[107];
int A[maxn];
inline void update(int x, int pos, int L, int R) {
  if (L == R) {
    T[x] = matrix(one[A[pos]], 1, two[A[pos - 1] * 10 + A[pos]], 0);
    return;
  }
  int mid = (L + R) / 2;
  if (pos <= mid)
    update(x << 1, pos, L, mid);
  else
    update(x << 1 | 1, pos, mid + 1, R);
  T[x] = mul(T[x << 1], T[x << 1 | 1]);
}
char str[maxn];
int main() {
  int n, m, i, j;
  for (i = 0; i <= 9; i++)
    for (j = 0; j <= 9; j++)
      if (i + j < 10)
        one[i + j]++;
      else
        two[i + j]++;
  scanf("%d%d", &n, &m);
  scanf("%s", str + 1);
  for (i = 1; i <= n; i++) {
    A[i] = str[i] - '0';
    update(1, i, 1, n);
  }
  for (i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    A[x] = y;
    update(1, x, 1, n);
    if (x != n) update(1, x + 1, 1, n);
    printf("%d\n", T[1].A[0][0]);
  }
}
