#include <bits/stdc++.h>
using namespace std;
const long long P = 998244353, G = 3, Gi = 332748118;
const int N = 4e4 + 100;
long long fpow(long long x, long long p) {
  long long res = 1;
  while (p) {
    if (p & 1LL) res = res * x % P;
    x = x * x % P;
    p >>= 1;
  }
  return res;
}
int t[N];
void NTT(vector<long long> &A, int limit, int opt) {
  for (int i = 0; i < limit; i++)
    if (i < t[i]) swap(A[i], A[t[i]]);
  for (int i = 1; i < limit; i <<= 1) {
    long long wn = fpow((opt == 1) ? G : Gi, (P - 1) / (i << 1));
    for (int p = i << 1, j = 0; j < limit; j += p) {
      long long w = 1;
      for (int k = 0; k < i; k++, w = w * wn % P) {
        long long x = A[j + k], y = w * A[j + i + k] % P;
        A[j + k] = (x + y) % P;
        A[j + i + k] = (x - y + P) % P;
      }
    }
  }
}
long long x[N], y[N];
vector<long long> solve(int l, int r) {
  if (l == r) {
    vector<long long> a;
    a.push_back(1);
    a.push_back(y[l]);
    return a;
  }
  vector<long long> a, b;
  int mid = (l + r) >> 1, limit = 1, k = 0;
  a = solve(l, mid);
  b = solve(mid + 1, r);
  while (limit <= r - l + 1) limit <<= 1, k++;
  for (int i = 0; i < limit; ++i)
    t[i] = (t[i >> 1] >> 1) | ((i & 1) << (k - 1));
  for (int i = a.size(); i < limit; ++i) a.push_back(0);
  for (int i = b.size(); i < limit; ++i) b.push_back(0);
  NTT(a, limit, 1);
  NTT(b, limit, 1);
  for (int i = 0; i < limit; i++) a[i] = a[i] * b[i] % P;
  NTT(a, limit, -1);
  limit = fpow(limit, P - 2);
  for (int i = 0; i <= r - l + 1; ++i) a[i] = a[i] * limit % P;
  return a;
}
int n, k, q, op, l, r;
long long p, d;
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%lld", &x[i]);
  scanf("%d", &q);
  while (q--) {
    scanf("%d %lld", &op, &p);
    for (int i = 1; i <= n; ++i) y[i] = (p - x[i] + P) % P;
    if (op == 1) {
      scanf("%d %lld", &l, &d);
      y[l] = (p - d + P) % P;
    } else {
      scanf("%d %d %lld", &l, &r, &d);
      for (int i = l; i <= r; ++i) y[i] = (y[i] - d + P) % P;
    }
    vector<long long> ans = solve(1, n);
    printf("%lld\n", ans[k]);
  }
}
