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
#include <bits/stdc++.h>
using namespace std;
bool codejam = 0;
void solve();
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(20);
  long long t = 1;
  long long tt = t;
  while (t--) {
    if (codejam) cout << "Case #" << tt - t << ": ";
    solve();
  }
  return 0;
}
const long long mod = 998244353;
const long long M = 998244353;
long long powr(long long a, long long b) {
  a %= mod;
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = ((long long)ans * a) % mod;
    }
    a = ((long long)a * a) % mod;
    b >>= 1;
  }
  return ans;
}
long long inv(long long a, long long b) { return powr(a, b - 2); }
class NTT {
  long long p, g, n, logn;

 public:
  NTT(long long P, long long G, long long LOGN) {
    p = P;
    long long g1 = G;
    logn = LOGN;
    n = (1 << LOGN);
    assert((p - 1) % n == 0);
    g = powr(g1, (p - 1) >> logn);
  }
  long long bitrevcopy(long long i) {
    long long ret = 0;
    for (long long j = 0; j < logn; j++)
      if (i & (1 << j)) ret |= (1 << (logn - 1 - j));
    return ret;
  }
  void fft(vector<long long> &a, bool invert) {
    for (long long i = 0; i < n; i++) {
      long long br = bitrevcopy(i);
      if (i < br) swap(a[i], a[br]);
    }
    for (long long i = 1; i <= logn; i++) {
      long long mul = powr(g, 1 << (logn - i));
      if (invert) mul = inv(mul, p);
      long long add = (1 << i);
      for (long long k = 0; k < n; k += add) {
        long long w = 1;
        long long lim = (add >> 1);
        for (long long j = 0; j < lim; j++) {
          long long u = (w * a[k + j + lim]) % p, v = a[k + j];
          a[k + j] = u + v;
          if (a[k + j] >= p) a[k + j] -= p;
          a[k + j + lim] = v - u;
          if (a[k + j + lim] < 0) a[k + j + lim] += p;
          w = (w * mul) % p;
        }
      }
    }
    if (invert) {
      long long _inv = inv(n, p);
      for (long long i = 0; i < n; i++) {
        a[i] = (a[i] * _inv) % p;
      }
    }
  }
};
vector<long long> mul(vector<long long> &a, vector<long long> &b) {
  long long sz = 1;
  long long LG = 0;
  while (sz < a.size() + b.size()) sz <<= 1, LG++;
  NTT ntt(mod, 3, LG);
  a.resize(sz, 0);
  b.resize(sz, 0);
  ntt.fft(a, 0);
  ntt.fft(b, 0);
  for (long long i = 0; i <= sz - 1; i += 1) {
    a[i] = ((long long)a[i] * b[i]) % mod;
  }
  ntt.fft(a, 1);
  return a;
}
const long long NN = 2e4 + 55;
long long arr[NN], inp[NN];
vector<long long> get(long long l, long long r) {
  if (l == r) {
    vector<long long> lol;
    lol.push_back(1);
    lol.push_back(arr[l]);
    return lol;
  }
  long long mid = (l + r) >> 1;
  auto lol = get(l, mid);
  auto lol2 = get(mid + 1, r);
  lol = mul(lol, lol2);
  return lol;
}
void solve() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> inp[i];
  }
  long long q;
  cin >> q;
  for (long long lol = 1; lol <= q; lol += 1) {
    long long type, qq;
    cin >> type >> qq;
    if (type == 1) {
      long long idx, val;
      cin >> idx >> val;
      for (long long i = 1; i <= n; i += 1) {
        if (i == idx)
          arr[i] = val;
        else
          arr[i] = inp[i];
        arr[i] = (qq - arr[i] + M) % M;
      }
    } else {
      long long l, r, val;
      cin >> l >> r >> val;
      for (long long i = 1; i <= n; i += 1) {
        if (i >= l and i <= r)
          arr[i] = inp[i] + val;
        else
          arr[i] = inp[i];
        arr[i] = (qq - arr[i] + M) % M;
      }
    }
    auto ans = get(1, n);
    cout << ans[k] << '\n';
  }
}
