#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
const int MOD = 998244353;
int add(int a, int b) { return (a += b) >= MOD ? a - MOD : a; }
int sub(int a, int b) { return (a -= b) < 0 ? a + MOD : a; }
int mul(int a, int b) { return (long long)a * b % MOD; }
int power(int a, long long n) {
  int res = 1;
  while (n) {
    if (n & 1LL) res = mul(res, a);
    a = mul(a, a);
    n >>= 1LL;
  }
  return res;
}
int inv(int u) { return power(u, MOD - 2); }
const int INV_2 = inv(2);
void debug(vector<int> c) {
  for (int u : c) {
    cout << u << ' ';
  }
  cout << endl;
}
struct NTT {
  int base = 1;
  int maxBase = 0;
  int root;
  vector<int> w = {0, 1};
  vector<int> rev = {0, 1};
  NTT() {
    for (int u = MOD - 1; u % 2 == 0; maxBase++, u >>= 1)
      ;
    root = 2;
    while (power(root, 1 << maxBase) != 1 ||
           power(root, 1 << (maxBase - 1)) == 1) {
      root++;
    }
  }
  void ensure(int curBase) {
    assert(curBase <= maxBase);
    if (curBase <= base) {
      return;
    }
    rev.resize(1 << curBase);
    for (int i = 0; i < (1 << curBase); i++) {
      rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (curBase - 1));
    }
    w.resize(1 << curBase);
    while (base < curBase) {
      int wc = power(root, 1 << (maxBase - base - 1));
      for (int i = (1 << (base - 1)); i < (1 << base); i++) {
        w[i << 1] = w[i];
        w[i << 1 | 1] = mul(w[i], wc);
      }
      base++;
    }
  }
  void fft(vector<int> &a) {
    int curBase = 0;
    while ((1 << curBase) < a.size()) {
      curBase++;
    }
    int shift = base - curBase;
    for (int i = 0; i < a.size(); i++) {
      if (i < (rev[i] >> shift)) {
        swap(a[i], a[rev[i] >> shift]);
      }
    }
    for (int k = 1; k < a.size(); k <<= 1) {
      for (int i = 0; i < k; i++) {
        for (int j = i; j < a.size(); j += k * 2) {
          int foo = a[j];
          int bar = mul(a[j + k], w[i + k]);
          a[j] = add(foo, bar);
          a[j + k] = sub(foo, bar);
        }
      }
    }
  }
  vector<int> mult(vector<int> a, vector<int> b) {
    int sz = a.size() + b.size() - 1;
    int curBase = 0;
    while ((1 << curBase) < sz) {
      curBase++;
    }
    ensure(curBase);
    a.resize(1 << curBase, 0);
    b.resize(1 << curBase, 0);
    fft(a);
    fft(b);
    for (int i = 0; i < (1 << curBase); i++) {
      a[i] = mul(mul(a[i], b[i]), inv(1 << curBase));
    }
    reverse(a.begin() + 1, a.end());
    fft(a);
    a.resize(sz);
    return a;
  }
  vector<int> polyInv(vector<int> r, vector<int> f) {
    vector<int> foo = mult(r, f);
    foo.resize(f.size());
    foo[0] = sub(2, foo[0]);
    for (int i = 1; i < foo.size(); i++) {
      foo[i] = sub(0, foo[i]);
    }
    vector<int> res = mult(r, foo);
    res.resize(f.size());
    return res;
  }
  vector<int> polySqrt(vector<int> s, vector<int> invS, vector<int> f) {
    vector<int> res = mult(f, invS);
    res.resize(f.size());
    for (int i = 0; i < s.size(); i++) {
      res[i] = add(res[i], s[i]);
    }
    for (int i = 0; i < res.size(); i++) {
      res[i] = mul(res[i], INV_2);
    }
    return res;
  }
  vector<int> getSqrt(vector<int> c, int sz) {
    vector<int> sqrtC = {1}, invSqrtC = {1};
    for (int k = 1; k < (1 << sz); k <<= 1) {
      vector<int> foo(c.begin(), c.begin() + (k * 2));
      vector<int> bar = sqrtC;
      bar.resize(bar.size() * 2, 0);
      vector<int> tempInv = polyInv(invSqrtC, bar);
      sqrtC = polySqrt(sqrtC, tempInv, foo);
      invSqrtC = polyInv(invSqrtC, sqrtC);
    }
    return sqrtC;
  }
  vector<int> getInv(vector<int> c, int sz) {
    vector<int> res = {INV_2};
    for (int k = 1; k < (1 << sz); k <<= 1) {
      vector<int> foo(c.begin(), c.begin() + (k * 2));
      res = polyInv(res, foo);
    }
    return res;
  }
} ntt;
vector<int> calc(int l, int r, vector<int> &a) {
  if (r - l == 1) {
    vector<int> res{1, a[l]};
    return res;
  }
  int mid = (l + r) / 2;
  vector<int> pLeft = calc(l, mid, a);
  vector<int> pRight = calc(mid, r, a);
  vector<int> ans = ntt.mult(pLeft, pRight);
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int q;
  cin >> q;
  while (q--) {
    int type;
    cin >> type;
    vector<int> b(n);
    b = a;
    if (type == 1) {
      int q, i, d;
      cin >> q >> i >> d;
      i--;
      b[i] = d;
      for (int i = 0; i < n; ++i) {
        b[i] = (q - b[i]) % MOD;
        b[i] = (b[i] % MOD + MOD) % MOD;
      }
    } else {
      int q, l, r, d;
      cin >> q >> l >> r >> d;
      l--;
      r--;
      for (int i = l; i <= r; ++i) {
        b[i] = (b[i] + d) % MOD;
      }
      for (int i = 0; i < n; ++i) {
        b[i] = (q - b[i]) % MOD;
        b[i] = (b[i] % MOD + MOD) % MOD;
      }
    }
    vector<int> p = calc(0, n, b);
    cout << p[k] << endl;
  }
  return 0;
}
