#include <bits/stdc++.h>
using namespace std;
template <typename U, typename V>
void Min(U &a, const V &b) {
  if (a > b) a = b;
}
template <typename U, typename V>
void Max(U &a, const V &b) {
  if (a < b) a = b;
}
template <typename U, typename V>
void add(U &a, const V &b) {
  a = (a + b) % 998244353;
}
template <typename U>
U gcd(U a, U b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a >= b)
    return gcd(a - b, b);
  else
    return gcd(a, b - a);
}
int pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1LL * ans * a % 998244353;
    a = 1LL * a * a % 998244353;
    b >>= 1;
  }
  return ans;
}
int a[20005], b[20005], dp[20005], f[20005];
int main() {
  int T, m, n, i, j, k, K;
  scanf("%d%d", &n, &K);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  scanf("%d", &m);
  long long q;
  while (m--) {
    scanf("%d%lld", &k, &q);
    for (int i = 0; i < n; i++) b[i] = a[i];
    if (k == 1) {
      scanf("%d%d", &i, &j);
      b[i - 1] = j;
    } else {
      scanf("%d%d%d", &i, &j, &k);
      i--;
      for (int l = i; l < j; l++) {
        b[l] = (b[l] + k) % 998244353;
      }
    }
    for (int i = 0; i < n; i++) {
      b[i] = (q - b[i] + 998244353) % 998244353;
    }
    for (int j = 0; j < n + 1; j++) dp[j] = 0;
    dp[0] = 1;
    for (int i = 0; i < n; i++) {
      int l = n - i < K ? i + K - n : 0;
      int r = i + 1 >= K ? K - 1 : i;
      for (int j = r + 1 - 1; j >= l; j--) {
        dp[j + 1] = (dp[j + 1] + 1LL * dp[j] * b[i]) % 998244353;
      }
    }
    printf("%d\n", dp[K]);
  }
}
