Problem: While roaming the mystic areas of Stonefalls, in order to drop legendary loot, an adventurer was given a quest as follows. He was given an array A = {a_1,a_2,...,a_N } of length N, and a number K.

Define array B as B(q, A) =  { q-a_1, q-a_2, ..., q-a_N }. Define function F as F(B,K) being sum of products of all K-tuples of elements in array B. For example, if the array B is [2,3,4,5], and with K=3, sum of products of all 3-tuples is $$$F(B, 3) = 2*3*4+2*3*5+3*4*5+2*4*5$$$

He was then given a number Q, number of queries of two types: 

  * Type 1: Given q, i, and d calculate F(B(q, A), K) where we make change to initial array as A[i] = d. 
  * Type 2: Given q, L, R, and d calculate F(B(q, A), K) where we make change to initial array as A[i] = A[i] + d for all i in range [L, R] inclusive. 



All changes are temporarily made to initial array, and don't propagate to following queries. Help the adventurer calculate the answer to a quest, and finally get that loot!

Input

In the first two lines, numbers N (1 ≤ N ≤ 2*10^4) and K (1 ≤ K ≤ N), the length of initial array A, and tuple size, followed by a_1,a_2,a_3,…,a_N (0 ≤ a_i ≤ 10^9) , elements of array A, in the next line. Then follows number Q (Q ≤ 10), number of queries. In the next Q lines come queries of the form: 

  * 1 q i d, for type 1, 
  * 2 q L R d, for type 2, 



as explained above (0 ≤ q, d ≤ 10^9, 1 ≤ i,L,R ≤ N)

Output

Print Q lines, the answers to queries, modulo 998244353.

Example

Input


5
2
1 2 3 4 5
3
1 6 1 1
1 6 5 2
2 6 2 3 1


Output


85
127
63

Note

In the first query array A = [1, 2, 3, 4, 5], B = [5, 4, 3, 2, 1], sum of products of 2-tuples = 85.

In second query array A = [1, 2, 3, 4, 2], B = [5, 4, 3, 2, 4], sum of products of 2-tuples = 127

In third query array A = [1, 3, 4, 4, 5], B = [5, 3, 2, 2, 1], sum of products of 2-tuples = 63

Solution (in CPP):

Solution:
#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);
    }
  }
}