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 N = 2e4 + 10;
const long long mod = 998244353;
const long long G = 3;
inline long long read() {
  long long p = 0;
  long long f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    p = p * 10 + ch - '0';
    ch = getchar();
  }
  return p * f;
}
long long rt, tot, lc[N << 2], rc[N << 2];
long long R[N << 2];
long long qpow(long long x, long long k, long long mo) {
  long long s = 1;
  while (k) {
    if (k & 1) s = (s * x) % mo;
    x = (x * x) % mo;
    k >>= 1;
  }
  return s;
}
void DFT(long long *a, long long n, long long fh) {
  for (long long i = 0; i < n; i++)
    if (R[i] > i) swap(a[R[i]], a[i]);
  for (long long i = 1; i < n; i <<= 1) {
    long long gn = qpow(G, (mod - 1) / (i << 1), mod);
    for (long long j = 0; j < n; j += (i << 1)) {
      long long g = 1;
      for (long long k = 0; k < i; k++, g = g * gn % mod) {
        long long x = a[j + k];
        long long y = a[j + k + i] * g % mod;
        a[j + k] = (x + y) % mod;
        a[j + k + i] = (x - y + mod) % mod;
      }
    }
  }
  if (fh == -1) reverse(a + 1, a + n);
}
long long K;
long long a[N << 2], b[N << 2], c[N << 2];
vector<long long> FFT(vector<long long> na, vector<long long> nb) {
  long long m = na.size() - 1 + nb.size() - 1;
  long long l = 0, n;
  for (n = 1; n <= m; n <<= 1) l++;
  for (long long i = 0; i < n; i++) a[i] = b[i] = 0;
  for (long long i = 0; i < na.size(); i++) a[i] = na[i];
  for (long long i = 0; i < nb.size(); i++) b[i] = nb[i];
  for (long long i = 0; i < n; i++)
    R[i] = (R[i >> 1] >> 1) | ((i & 1) << (l - 1));
  DFT(a, n, 1);
  DFT(b, n, 1);
  for (long long i = 0; i < n; i++) c[i] = a[i] * b[i] % mod;
  DFT(c, n, -1);
  for (long long i = 0; i < n; i++)
    c[i] = (long long)(c[i] * qpow(n, mod - 2, mod) % mod);
  m = min(m, K);
  vector<long long> nc;
  for (long long i = 0; i <= m; i++) nc.push_back(c[i]);
  return nc;
}
long long Q, ya[N], yb[N];
vector<long long> build(long long &u, long long L, long long R) {
  if (!u) u = ++tot;
  if (L == R) {
    vector<long long> v;
    v.push_back(1);
    v.push_back(yb[L]);
    return v;
  }
  long long mid = (L + R) >> 1;
  vector<long long> na = build(lc[u], L, mid);
  vector<long long> nb = build(rc[u], mid + 1, R);
  return FFT(na, nb);
}
long long n;
int main() {
  n = read();
  K = read();
  for (long long i = 1; i <= n; i++) {
    ya[i] = read();
  }
  Q = read();
  rt = tot = 0;
  while (Q--) {
    long long op = read();
    if (op == 1) {
      long long q = read();
      long long k = read();
      long long d = read();
      for (long long i = 1; i <= n; i++) yb[i] = ya[i];
      yb[k] = d;
      for (long long i = 1; i <= n; i++) {
        yb[i] = q - yb[i];
        if (yb[i] < 0) yb[i] += mod;
      }
    } else {
      long long q = read();
      long long l = read();
      long long r = read();
      long long d = read();
      for (long long i = 1; i <= n; i++) yb[i] = ya[i];
      for (long long i = l; i <= r; i++) yb[i] += d;
      for (long long i = 1; i <= n; i++) {
        yb[i] = q - yb[i];
        if (yb[i] < 0) yb[i] += mod;
      }
    }
    vector<long long> ans = build(rt, 1, n);
    printf("%lld\n", (ans[K] + mod) % mod);
  }
  return 0;
}