#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int modpow(int b, int e) {
  int a = 1;
  while (e) {
    if (e & 1) a = 1LL * a * b % MOD;
    b = 1LL * b * b % MOD;
    e >>= 1;
  }
  return a;
}
const int root = modpow(3, 119);
const int root_1 = modpow(root, MOD - 2);
const int root_pw = 1 << 23;
struct poly {
  int *arr;
  int deg;
  poly(int n = 0) {
    arr = new int[n];
    deg = n;
    for (int i = 0; i != n; ++i) arr[i] = 0;
  }
  int degree() { return deg; }
  int &operator[](int i) { return arr[i]; }
};
void fft(poly &a, bool invert, int n) {
  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_1 : root;
    for (int i = len; i < root_pw; i <<= 1)
      wlen = (int)(1LL * wlen * wlen % MOD);
    for (int i = 0; i < n; i += len) {
      int w = 1;
      for (int j = 0; j < len / 2; j++) {
        int u = a[i + j], v = (int)(1LL * a[i + j + len / 2] * w % MOD);
        a[i + j] = u + v < MOD ? u + v : u + v - MOD;
        a[i + j + len / 2] = u - v >= 0 ? u - v : u - v + MOD;
        w = (int)(1LL * w * wlen % MOD);
      }
    }
  }
  if (invert) {
    int n_1 = modpow(n, MOD - 2);
    for (int i = 0; i != n; ++i) a[i] = (int)(1LL * a[i] * n_1 % MOD);
  }
}
void print(poly &a) {
  for (int i = 0; i != a.degree(); ++i) cout << a[i] << ' ';
  cout << '\n';
}
void mult(poly &a, poly &b, poly &c) {
  int n = a.degree();
  fft(a, 0, n);
  fft(b, 0, n);
  for (int i = 0; i != n; ++i) c[i] = 1LL * a[i] * b[i] % MOD;
  fft(a, 1, n);
  fft(b, 1, n);
  fft(c, 1, n);
}
int main() {
  int n, k;
  cin >> n >> k;
  int r = 1;
  while (r < n) r <<= 1;
  int arr[n];
  for (int i = 0; i != n; ++i) cin >> arr[i];
  int q;
  poly polys[2 * r];
  for (int j = 0; j != r; ++j) {
    polys[r + j] = poly(4);
    polys[r + j][0] = 1;
  }
  for (int i = r - 1; i != 0; --i) polys[i] = poly(2 * polys[2 * i].degree());
  for (cin >> q; q--;) {
    int t;
    cin >> t;
    if (t == 1) {
      int qq, i, d;
      cin >> qq >> i >> d;
      for (int j = 0; j != n; ++j) {
        polys[r + j][0] = qq - arr[j];
        polys[r + j][1] = 1;
      }
      polys[r + i - 1][0] = qq - d;
    } else {
      int qq, l, rr, d;
      cin >> qq >> l >> rr >> d;
      for (int j = 0; j != n; ++j) {
        polys[r + j][0] = qq - arr[j];
        polys[r + j][1] = 1;
      }
      for (int i = l - 1; i != rr; ++i) polys[r + i][0] -= d;
    }
    for (int i = r; i != 2 * r; ++i)
      for (int j = 0; j != 2; ++j) {
        polys[i][j] %= MOD;
        polys[i][j] += MOD;
        polys[i][j] %= MOD;
      }
    for (int i = r - 1; i != 0; --i)
      mult(polys[2 * i], polys[2 * i + 1], polys[i]);
    cout << (polys[1][n - k] + MOD) % MOD << '\n';
  }
  return 0;
}

### Prompt

In CPP, your task is to solve the following 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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int modpow(int b, int e) {
  int a = 1;
  while (e) {
    if (e & 1) a = 1LL * a * b % MOD;
    b = 1LL * b * b % MOD;
    e >>= 1;
  }
  return a;
}
const int root = modpow(3, 119);
const int root_1 = modpow(root, MOD - 2);
const int root_pw = 1 << 23;
struct poly {
  int *arr;
  int deg;
  poly(int n = 0) {
    arr = new int[n];
    deg = n;
    for (int i = 0; i != n; ++i) arr[i] = 0;
  }
  int degree() { return deg; }
  int &operator[](int i) { return arr[i]; }
};
void fft(poly &a, bool invert, int n) {
  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_1 : root;
    for (int i = len; i < root_pw; i <<= 1)
      wlen = (int)(1LL * wlen * wlen % MOD);
    for (int i = 0; i < n; i += len) {
      int w = 1;
      for (int j = 0; j < len / 2; j++) {
        int u = a[i + j], v = (int)(1LL * a[i + j + len / 2] * w % MOD);
        a[i + j] = u + v < MOD ? u + v : u + v - MOD;
        a[i + j + len / 2] = u - v >= 0 ? u - v : u - v + MOD;
        w = (int)(1LL * w * wlen % MOD);
      }
    }
  }
  if (invert) {
    int n_1 = modpow(n, MOD - 2);
    for (int i = 0; i != n; ++i) a[i] = (int)(1LL * a[i] * n_1 % MOD);
  }
}
void print(poly &a) {
  for (int i = 0; i != a.degree(); ++i) cout << a[i] << ' ';
  cout << '\n';
}
void mult(poly &a, poly &b, poly &c) {
  int n = a.degree();
  fft(a, 0, n);
  fft(b, 0, n);
  for (int i = 0; i != n; ++i) c[i] = 1LL * a[i] * b[i] % MOD;
  fft(a, 1, n);
  fft(b, 1, n);
  fft(c, 1, n);
}
int main() {
  int n, k;
  cin >> n >> k;
  int r = 1;
  while (r < n) r <<= 1;
  int arr[n];
  for (int i = 0; i != n; ++i) cin >> arr[i];
  int q;
  poly polys[2 * r];
  for (int j = 0; j != r; ++j) {
    polys[r + j] = poly(4);
    polys[r + j][0] = 1;
  }
  for (int i = r - 1; i != 0; --i) polys[i] = poly(2 * polys[2 * i].degree());
  for (cin >> q; q--;) {
    int t;
    cin >> t;
    if (t == 1) {
      int qq, i, d;
      cin >> qq >> i >> d;
      for (int j = 0; j != n; ++j) {
        polys[r + j][0] = qq - arr[j];
        polys[r + j][1] = 1;
      }
      polys[r + i - 1][0] = qq - d;
    } else {
      int qq, l, rr, d;
      cin >> qq >> l >> rr >> d;
      for (int j = 0; j != n; ++j) {
        polys[r + j][0] = qq - arr[j];
        polys[r + j][1] = 1;
      }
      for (int i = l - 1; i != rr; ++i) polys[r + i][0] -= d;
    }
    for (int i = r; i != 2 * r; ++i)
      for (int j = 0; j != 2; ++j) {
        polys[i][j] %= MOD;
        polys[i][j] += MOD;
        polys[i][j] %= MOD;
      }
    for (int i = r - 1; i != 0; --i)
      mult(polys[2 * i], polys[2 * i + 1], polys[i]);
    cout << (polys[1][n - k] + MOD) % MOD << '\n';
  }
  return 0;
}

```