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 arr = 2e5 + 10;
const int ar = 2e3 + 10;
const long double pi = acos(-1);
const long double eps = 1e-10;
const long long md = 1e9 + 7;
void inc(int& a, int b) {
  a += b;
  if (a >= (long long)(998244353ll)) {
    a -= (long long)(998244353ll);
  }
}
int bpow(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) {
      res = 1ll * res * a % (long long)(998244353ll);
    }
    n /= 2;
    a = 1ll * a * a % (long long)(998244353ll);
  }
  return res;
}
const int K = 16;
const int N = (1ll << K);
int rev_N;
int pw[N];
int rpw[N];
void init() {
  int root = -1;
  for (int i = 2;; i++) {
    if (bpow(i, N) == 1) {
      int cur = 1;
      for (int j = 1; j < N; j++) {
        cur = 1ll * cur * i % (long long)(998244353ll);
        if (cur == 1) {
          break;
        }
      }
      if (cur != 1) {
        root = i;
        break;
      }
    }
  }
  pw[0] = 1;
  for (int i = 1; i < N; i++) {
    pw[i] = 1ll * pw[i - 1] * root % (long long)(998244353ll);
  }
  int rroot = bpow(root, (long long)(998244353ll) - 2);
  rpw[0] = 1;
  for (int i = 1; i < N; i++) {
    rpw[i] = 1ll * rpw[i - 1] * rroot % (long long)(998244353ll);
  }
}
void fft(int* a, int* pw) {
  for (int i = 0; i < N; i++) {
    int r = 0;
    for (int j = 0; j < K; j++) {
      if (i & (1ll << j)) {
        r |= (1ll << (K - j - 1));
      }
    }
    if (i < r) {
      swap(a[i], a[r]);
    }
  }
  for (int i = 1, pl = N / 2; i < N; i *= 2, pl /= 2) {
    for (int j = 0; j < N; j += 2 * i) {
      for (int k = j, cur = 0; k < j + i; k++, cur += pl) {
        int L = a[k];
        int R = 1ll * pw[cur] * a[k + i] % (long long)(998244353ll);
        a[k] = L + R;
        if (a[k] >= (long long)(998244353ll)) {
          a[k] -= (long long)(998244353ll);
          ;
        }
        a[k + i] = L - R;
        if (a[k + i] < 0) {
          a[k + i] += (long long)(998244353ll);
        }
      }
    }
  }
}
void make_mult(int* a, int* b, int* c) {
  fft(a, pw);
  fft(b, pw);
  for (int i = 0; i < N; i++) {
    c[i] = 1ll * a[i] * b[i] % (long long)(998244353ll);
  }
  fft(c, rpw);
  for (int i = 0; i < N; i++) {
    c[i] = 1ll * c[i] * rev_N % (long long)(998244353ll);
  }
}
const int B = 1000;
int fft_bl[N / B + 10][N];
int a[N];
int b[N];
int dp[B + 10][B + 10];
int ans_fft[N];
int main() {
  init();
  rev_N = bpow(N, (long long)(998244353ll) - 2);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  auto get_ans = [&](int q) {
    for (int i = 0; i < n; i++) {
      b[i] = q - a[i];
      b[i] %= (long long)(998244353ll);
      if (b[i] < 0) {
        b[i] += (long long)(998244353ll);
      }
    }
    int num = 0;
    for (int bl_st = 0; bl_st < n; bl_st += B) {
      int L = bl_st;
      int R = min(n - 1, L + B - 1);
      memset(dp, 0, sizeof(dp));
      dp[0][0] = 1;
      for (int j = L; j <= R; j++) {
        for (int t = 0; t <= j - L; t++) {
          inc(dp[j - L + 1][t], dp[j - L][t]);
          inc(dp[j - L + 1][t + 1],
              1ll * dp[j - L][t] * b[j] % (long long)(998244353ll));
        }
      }
      for (int j = 0; j <= B; j++) {
        fft_bl[num][j] = dp[R - L + 1][j];
      }
      for (int j = B + 1; j < N; j++) {
        fft_bl[num][j] = 0;
      }
      num++;
    }
    memset(ans_fft, 0, sizeof(ans_fft));
    ans_fft[0] = 1;
    for (int i = 0; i < num; i++) {
      make_mult(ans_fft, fft_bl[i], ans_fft);
    }
    return ans_fft[k];
  };
  int Q;
  cin >> Q;
  while (Q--) {
    int type, q;
    cin >> type >> q;
    if (type == 1) {
      int pos, d;
      cin >> pos >> d;
      pos--;
      int buf = a[pos];
      a[pos] = d;
      cout << get_ans(q) << "\n";
      a[pos] = buf;
    } else {
      int l, r, d;
      cin >> l >> r >> d;
      l--;
      r--;
      for (int j = l; j <= r; j++) {
        a[j] += d;
      }
      cout << get_ans(q) << "\n";
      for (int j = l; j <= r; j++) {
        a[j] -= d;
      }
    }
  }
}