#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <class T, class S>
ostream &operator<<(ostream &o, pair<T, S> p) {
  return o << '(' << p.first << ", " << p.second << ')';
}
template <template <class, class...> class T, class... A>
typename enable_if<!is_same<T<A...>, string>(), ostream &>::type operator<<(
    ostream &o, T<A...> V) {
  o << '[';
  for (auto a : V) o << a << ", ";
  return o << ']';
}
constexpr long long int M = 998244353;
struct thing {
  long long int a, b, c, d;
};
namespace s {
thing f(thing F, thing G) {
  return thing{
      (F.a * G.a + F.b * G.c) % M,
      (F.a * G.b + F.b * G.d) % M,
      (F.c * G.a + F.d * G.c) % M,
      (F.c * G.b + F.d * G.d) % M,
  };
}
thing t[2 * 500010];
long long int n;
void modify(long long int p, thing value) {
  for (t[p += n] = value; p /= 2;) t[p] = f(t[2 * p], t[2 * p + 1]);
}
thing query(long long int l, long long int r) {
  thing resl{1, 0, 0, 1};
  thing resr{1, 0, 0, 1};
  for (l += n, r += n; l < r; l /= 2, r /= 2) {
    if (l & 1) resl = f(resl, t[l++]);
    if (r & 1) resr = f(t[--r], resr);
  }
  return f(resl, resr);
}
}  // namespace s
long long int sing[20];
long long int dub[20][20];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  string c;
  cin >> c;
  if (n % 2) {
    c += ';';
    ++n;
  }
  c += ':';
  for (auto &d : c) d -= '0';
  for (long long int a = 0; a < 10; ++a) {
    for (long long int b = 0; b < 10; ++b) {
      long long int s = a + b;
      if (s < 10)
        sing[s]++;
      else
        dub[s / 10][s % 10]++;
    }
  }
  sing[11] = 1;
  s::n = n / 2;
  for (long long int i = 0; i < n; i += 2) {
    {
      long long int C = sing[c[i + 1]];
      long long int D = dub[c[i + 1]][c[i + 2]];
      long long int A = dub[c[i]][c[i + 1]] + sing[c[i]] * C;
      long long int B = sing[c[i]] * D;
      s::modify(i / 2, thing{A % M, B % M, C % M, D % M});
    }
  }
  for (long long int i = 0; i < m; ++i) {
    long long int x, d;
    cin >> x >> d;
    x--;
    c[x] = d;
    long long int b = x - (x & 1);
    {
      long long int C = sing[c[b + 1]];
      long long int D = dub[c[b + 1]][c[b + 2]];
      long long int A = dub[c[b]][c[b + 1]] + sing[c[b]] * C;
      long long int B = sing[c[b]] * D;
      s::modify(b / 2, thing{A % M, B % M, C % M, D % M});
    }
    if (b != 0) {
      long long int C = sing[c[(b - 2) + 1]];
      long long int D = dub[c[(b - 2) + 1]][c[(b - 2) + 2]];
      long long int A = dub[c[(b - 2)]][c[(b - 2) + 1]] + sing[c[(b - 2)]] * C;
      long long int B = sing[c[(b - 2)]] * D;
      s::modify((b - 2) / 2, thing{A % M, B % M, C % M, D % M});
    }
    if (b + 2 != n) {
      long long int C = sing[c[(b + 2) + 1]];
      long long int D = dub[c[(b + 2) + 1]][c[(b + 2) + 2]];
      long long int A = dub[c[(b + 2)]][c[(b + 2) + 1]] + sing[c[(b + 2)]] * C;
      long long int B = sing[c[(b + 2)]] * D;
      s::modify((b + 2) / 2, thing{A % M, B % M, C % M, D % M});
    }
    thing tot = s::query(0, s::n);
    cout << (tot.a + tot.b) % M << endl;
  }
}
