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 int N = 20005;
const int MOD = 998244353;
int n, k;
namespace FFT {
const int LN = 23;
const int N = 1 << LN;
const int MOD = 998244353;
const int PRIMITIVE_ROOT = 3;
int root[N];
int power(int x, int y) {
  int ret = 1;
  for (; y; y >>= 1) {
    if (y & 1) ret = 1LL * ret * x % MOD;
    x = 1LL * x * x % MOD;
  }
  return ret;
}
void init_fft() {
  const int UNITY = power(PRIMITIVE_ROOT, MOD - 1 >> LN);
  root[0] = 1;
  for (int i = 1; i < N; i++) {
    root[i] = 1LL * UNITY * root[i - 1] % MOD;
  }
}
void fft(int n, vector<int> &a, bool invert) {
  for (int i = 1, j = 0; i < n; ++i) {
    int bit = n >> 1;
    for (; j >= bit; bit >>= 1) j -= bit;
    j += bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    int wlen = (invert ? root[N - N / len] : root[N / len]);
    for (int i = 0; i < n; i += len) {
      int w = 1;
      for (int j = 0; j < len >> 1; j++) {
        int u = a[i + j];
        int v = 1LL * a[i + j + len / 2] * w % MOD;
        a[i + j] = (u + v) % MOD;
        a[i + j + len / 2] = (u - v + MOD) % MOD;
        w = 1LL * w * wlen % MOD;
      }
    }
  }
  if (invert) {
    int inv = power(n, MOD - 2);
    for (int i = 0; i < n; i++) a[i] = 1LL * a[i] * inv % MOD;
  }
}
void multiply(vector<int> a, vector<int> b, vector<int> &c) {
  int len = 1 << 32 - __builtin_clz(a.size() + b.size() - 2);
  a.resize(len, 0);
  b.resize(len, 0);
  fft(len, a, false);
  fft(len, b, false);
  c.resize(len);
  for (int i = 0; i < len; ++i) c[i] = 1LL * a[i] * b[i] % MOD;
  fft(len, c, true);
}
}  // namespace FFT
vector<int> sum[N << 2];
void build(int node, int l, int r, vector<int> &a) {
  if (l == r) {
    sum[node] = {1, a[l]};
    return;
  }
  int mid = l + r >> 1;
  build(node * 2 + 1, l, mid + 0, a);
  build(node * 2 + 2, mid + 1, r, a);
  FFT::multiply(sum[node * 2 + 1], sum[node * 2 + 2], sum[node]);
  sum[node].resize(min(k + 1, (int)sum[node].size()));
}
int main() {
  FFT::init_fft();
  scanf("%d %d", &n, &k);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  int q;
  scanf("%d", &q);
  while (q--) {
    int t, q;
    scanf("%d %d", &t, &q);
    vector<int> b = a;
    if (t == 1) {
      int i, d;
      scanf("%d %d", &i, &d);
      --i;
      b[i] = d;
    } else if (t == 2) {
      int l, r, d;
      scanf("%d %d %d", &l, &r, &d);
      --l, --r;
      for (int i = l; i <= r; ++i) (b[i] += d) %= MOD;
    }
    for (int &num : b) {
      num = (q - num) % MOD;
      if (num < 0) num += MOD;
    }
    build(0, 0, n - 1, b);
    if (sum[0][k] < 0) sum[0][k] += MOD;
    printf("%d\n", sum[0][k]);
  }
  return 0;
}