#include <bits/stdc++.h>   using namespace std;   const long long int mod = 998244353;   vector<long long int> roots;   long long int powermod(long long int a, long long int n, long long int p) {     long long int ans = 1;     while (n > 0) {       if (n & 1) ans = (ans * a) % p;       n >>= 1;       a = a * a % p;     }     return ans;   }   long long int primitive_root(long long int p) {     vector<long long int> fact;     int phi = p - 1, n = phi;     for (int i = 2; i * i <= n; ++i) {       if (n % i == 0) {         fact.push_back(i);         while (n % i == 0) n /= i;       }     }     if (n > 1) fact.push_back(n);     for (int res = 2; res <= p; ++res) {       bool ok = true;       for (int i = 0; i < fact.size() && ok; ++i)         ok &= powermod(res, phi / fact[i], p) != 1;       if (ok) return res;     }     return -1;   }   long long int mod_inverse(long long int a, long long int p) {     vector<long long int> A = {p, 1, 0};     vector<long long int> B = {a, 0, 1};     while (B[0] != 1) {       long long int ratio = A[0] / B[0];       A[0] -= ratio * B[0];       A[1] -= ratio * B[1];       A[2] -= ratio * B[2];       swap(A, B);     }     return (p + (B[2] % p)) % p;   }   void find_root() {     long long int val = mod - 1;     int start = 1 << 20;     while (start > 0) {       if (val % start == 0) {         long long int c = val / start;         roots.push_back(powermod(primitive_root(mod), c, mod));       }       start >>= 1;     }     reverse(roots.begin(), roots.end());   }   void initFFT(vector<long long int>& W, vector<long long int>& rbit,                bool inverse, long long int root) {     int n = W.size();     for (int i = 0; i < n; ++i) {       int k = i, power = n >> 1, ans = 0;       while (k > 0) {         if (k & 1) ans += power;         power >>= 1;         k >>= 1;       }       rbit[ans] = i;     }     W[0] = 1;     for (int i = 1; i < n; ++i) W[i] = (W[i - 1] * root) % mod;     if (inverse) {       for (int i = 1; i < n / 2; ++i) swap(W[i], W[n - i]);     }   }   vector<long long int> FFT(vector<long long int> P, bool inverse,                             long long int root) {     int n = P.size();     vector<long long int> W(n), rbit(n);     initFFT(W, rbit, inverse, root);     vector<long long int> Q(n);     for (int i = 0; i < n; ++i) Q[i] = P[rbit[i]];     for (int l = 1; l < n; l <<= 1) {       int step = n / (l << 1);       for (int i = 0; i < n; i += l << 1) {         int j = 0;         for (int k = 0; k < l; ++k) {           long long int u = Q[i + k], v = (W[j] * Q[i + k + l]) % mod;           Q[i + k] = (u + v) % mod;           Q[i + k + l] = (mod + (u - v) % mod) % mod;           j += step;         }       }     }     if (inverse) {       long long int inv = mod_inverse(n, mod);       for (int i = 0; i < n; ++i) {         Q[i] = (Q[i] * inv) % mod;       }     }     return Q;   }   vector<long long int> multiply(vector<long long int>& A,                                  vector<long long int>& B) {     long long int n = 1, root = 0;     while (n < A.size() + B.size()) {       ++root;       n <<= 1;     }     root = roots[root];     A.resize(n, 0);     B.resize(n, 0);     vector<long long int> DFTA = FFT(A, false, root);     vector<long long int> DFTB = FFT(B, false, root);     for (int i = 0; i < n; ++i) DFTA[i] = DFTA[i] * DFTB[i] % mod;     DFTA = FFT(DFTA, true, root);     return DFTA;   }   vector<long long int> A;   void query(int k, int q, int l, int r, int d, int type) {     int n = A.size();     vector<vector<long long int> > B(n);     for (int i = 0; i < n; ++i) {       if (i < l or i > r)         B[i] = {1, q - A[i]};       else if (type == 2)         B[i] = {1, q - d - A[i]};       else         B[i] = {1, q - d};     }     while (B.size() > 1) {       vector<vector<long long int> > C;       for (int i = 0; i < B.size(); i += 2) {         if (i == B.size() - 1)           C.push_back(B.back());         else           C.push_back(multiply(B[i], B[i + 1]));       }       B = C;     }     cout << (B[0][k] % mod + mod) % mod <<   n ;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     find_root();     int n, k;     cin >> n >> k;     A = vector<long long int>(n);     for (int i = 0; i < n; ++i) cin >> A[i];     int Q;     cin >> Q;     for (int i = 0; i < Q; ++i) {       int type;       cin >> type;       if (type == 1) {         int q, l, d;         cin >> q >> l >> d;         query(k, q, l - 1, l - 1, d, type);       } else {         int q, l, r, d;         cin >> q >> l >> r >> d;         query(k, q, l - 1, r - 1, d, type);       }     }   }