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 mod = (119 << 23) + 1, root = 62;
void ntt(vector<long long>& a, vector<long long>& rt, vector<long long>& rev,
         int n) {
  for (int i = 0; i < (n); ++i)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int k = 1; k < n; k *= 2)
    for (int i = 0; i < n; i += 2 * k)
      for (int j = 0; j < (k); ++j) {
        long long z = rt[j + k] * a[i + j + k] % mod, &ai = a[i + j];
        a[i + j + k] = (z > ai ? ai - z + mod : ai - z);
        ai += (ai + z >= mod ? z - mod : z);
      }
}
long long modpow(long long a, long long e) {
  if (e == 0) return 1;
  long long x = modpow(a * a % mod, e >> 1);
  return e & 1 ? x * a % mod : x;
}
vector<long long> conv(const vector<long long>& a, const vector<long long>& b) {
  if (a.empty() || b.empty()) return {};
  int s = (int)(a).size() + (int)(b).size() - 1, B = 32 - __builtin_clz(s),
      n = 1 << B;
  vector<long long> L(a), R(b), out(n), rt(n, 1), rev(n);
  L.resize(n), R.resize(n);
  for (int i = 0; i < (n); ++i) rev[i] = (rev[i / 2] | (i & 1) << B) / 2;
  long long curL = mod / 2, inv = modpow(n, mod - 2);
  for (int k = 2; k < n; k *= 2) {
    long long z[] = {1, modpow(root, curL /= 2)};
    for (int i = k; i < (2 * k); ++i) rt[i] = rt[i / 2] * z[i & 1] % mod;
  }
  ntt(L, rt, rev, n);
  ntt(R, rt, rev, n);
  for (int i = 0; i < (n); ++i)
    out[-i & (n - 1)] = L[i] * R[i] % mod * inv % mod;
  ntt(out, rt, rev, n);
  return {out.begin(), out.begin() + s};
}
vector<long long> prep(vector<long long> a) {
  int n = a.size(), k = n;
  vector<long long> dp(k + 1), ndp(k + 1);
  dp[0] = 1;
  for (int i = 0; i < n; i++) {
    ndp[0] = dp[0];
    for (int j = 1; j <= k; j++) {
      ndp[j] = (dp[j] + dp[j - 1] * a[i]) % mod;
    }
    swap(dp, ndp);
  }
  return dp;
}
const int nax = 1e5;
long long fac[nax], ifac[nax], inv[nax];
vector<long long> add(vector<long long> a, long long d) {
  int n = a.size();
  vector<long long> x = a, y(n, 1);
  for (int i = 1; i < n; i++) y[i] = y[i - 1] * d % mod;
  for (int i = 0; i < n; i++) {
    x[i] = x[i] * fac[n - 1 - i] % mod;
    y[i] = y[i] * ifac[i] % mod;
  }
  vector<long long> r = conv(x, y);
  r.resize(n);
  for (int i = 0; i < n; i++) r[i] = r[i] * ifac[n - 1 - i] % mod;
  return r;
}
struct Query {
  long long l, r, d, q;
};
int main() {
  fac[0] = ifac[0] = 1;
  for (int i = 1; i < nax; i++) {
    inv[i] = i == 1 ? 1 : mod - mod / i * inv[mod % i] % mod;
    fac[i] = fac[i - 1] * i % mod;
    ifac[i] = ifac[i - 1] * inv[i] % mod;
    assert(fac[i] * ifac[i] % mod == 1);
  }
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (long long& v : a) {
    cin >> v;
    v *= -1;
  }
  int q;
  cin >> q;
  vector<Query> query;
  set<int> split = {0, n};
  for (int qi = 0; qi < q; qi++) {
    int type;
    cin >> type;
    if (type == 1) {
      int qq, i, d;
      cin >> qq >> i >> d;
      i--;
      split.insert(i);
      split.insert(i + 1);
      query.push_back({i, i + 1, d + a[i], qq});
    } else {
      int qq, l, r, d;
      cin >> qq >> l >> r >> d;
      l--;
      split.insert(l);
      split.insert(r);
      query.push_back({l, r, d, qq});
    }
  }
  map<int, int> spliti;
  int c = 0;
  vector<int> splits;
  for (int s : split) {
    splits.push_back(s);
    spliti[s] = c++;
  }
  vector<vector<long long> > parts;
  for (int i = 0; i + 1 < (int)splits.size(); i++) {
    vector<long long> part(a.begin() + splits[i], a.begin() + splits[i + 1]);
    parts.push_back(prep(part));
  }
  for (int qi = 0; qi < q; qi++) {
    Query Q = query[qi];
    vector<long long> ans = {1};
    for (int i = 0; i + 1 < (int)splits.size(); i++) {
      vector<long long> toadd;
      if (Q.l <= splits[i] && Q.r >= splits[i + 1]) {
        toadd = add(parts[i], Q.q - Q.d);
      } else
        toadd = add(parts[i], Q.q);
      ans = conv(ans, toadd);
    }
    assert((int)ans.size() == n + 1);
    cout << (ans[k] + mod) % mod << endl;
  }
}