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;
const long long g = 3;
const long long maxn = 5e5 + 2;
const long long mod = 998244353;
long long ori[maxn];
long long add[maxn];
long long tt[maxn];
long long aa[maxn];
long long bb[maxn];
long long rev[maxn];
long long pow(long long a, long long n) {
  long long res = 1;
  long long base = a;
  while (n) {
    if (n & 1) res = res * base % mod;
    base = base * base % mod;
    n /= 2;
  }
  return res;
}
inline void ntt(long long* a, long long tot, long long inv) {
  for (long long i = 0; i < tot; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (long long nowlen = 2; nowlen <= tot; nowlen *= 2) {
    long long step = pow(g, (mod - 1) / (nowlen));
    if (inv == -1) step = pow(pow(g, mod - 2), (mod - 1) / (nowlen));
    for (long long s = 0; s < tot; s += nowlen) {
      long long* LL = a + s;
      long long* RR = a + s + nowlen / 2;
      long long now = 1;
      for (long long i = 0; i < nowlen / 2; ++i) {
        long long L = LL[i];
        long long R = RR[i] * now;
        R %= mod;
        a[s + i] = (L + R) % mod;
        a[s + i + nowlen / 2] = (L - R + mod) % mod;
        now = now * step % mod;
      }
    }
  }
}
long long cal(long long* a, long long aend, long long* b, long long bend) {
  long long tot = aend + bend;
  long long bit = 1;
  while ((1 << bit) <= tot) {
    bit++;
  }
  tot = 1 << bit;
  for (long long i = aend + 1; i <= tot; i++) {
    a[i] = 0;
  }
  for (long long i = bend + 1; i <= tot; i++) {
    b[i] = 0;
  }
  for (long long i = 0; i < tot; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (bit - 1));
  ntt(a, tot, 1);
  ntt(b, tot, 1);
  for (long long i = 0; i < tot; i++) a[i] = b[i] * a[i] % mod;
  ntt(a, tot, -1);
  long long inn = pow(tot, mod - 2);
  for (long long i = 0; i < tot; i++) {
    a[i] *= inn;
    a[i] %= mod;
  }
  return tot;
}
vector<long long> func(long long l, long long r) {
  if (l == r) {
    vector<long long> v;
    v.push_back(1);
    v.push_back(tt[l]);
    return v;
  }
  long long mid = l + r;
  mid >>= 1;
  vector<long long> L = func(l, mid);
  vector<long long> R = func(mid + 1, r);
  for (long long i = 0; i <= r - mid; i++) {
    bb[i] = R[i];
  }
  for (long long i = 0; i <= mid - l + 1; i++) {
    aa[i] = L[i];
  }
  cal(aa, mid - l + 1, bb, r - mid);
  vector<long long> v;
  for (long long i = 0; i <= r - l + 1; i++) v.push_back(aa[i]);
  return v;
}
void solve() {
  long long n, k;
  scanf("%lld %lld", &n, &k);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &ori[i]);
  }
  long long q1;
  scanf("%lld", &q1);
  while (q1--) {
    long long t, q;
    scanf("%lld", &t);
    if (t == 1) {
      long long i, d;
      scanf("%lld %lld %lld", &q, &i, &d);
      add[i] += d - ori[i];
      add[i + 1] -= d - ori[i];
    } else if (t == 2) {
      long long l, r, d;
      scanf("%lld %lld %lld %lld", &q, &l, &r, &d);
      add[l] += d;
      add[r + 1] -= d;
    }
    long long nowadd = 0;
    for (long long i = 1; i <= n; i++) {
      nowadd += add[i];
      add[i] = 0;
      tt[i] = q - (ori[i] + nowadd);
    }
    vector<long long> ANS = func(1, n);
    printf("%lld\n", (ANS[k] % mod + mod) % mod);
  }
}
signed main() { solve(); }
