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;
namespace zyt {
template <typename T>
inline bool read(T &x) {
  char c;
  bool f = false;
  x = 0;
  do c = getchar();
  while (c != EOF && c != '-' && !isdigit(c));
  if (c == EOF) return false;
  if (c == '-') f = true, c = getchar();
  do x = x * 10 + c - '0', c = getchar();
  while (isdigit(c));
  if (f) x = -x;
  return true;
}
template <typename T>
inline void write(T x) {
  static char buf[20];
  char *pos = buf;
  if (x < 0) putchar('-'), x = -x;
  do *pos++ = x % 10 + '0';
  while (x /= 10);
  while (pos > buf) putchar(*--pos);
}
const int N = 2e4 + 10, B = 20, P = 998244353;
int power(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (long long)ans * a % P;
    a = (long long)a * a % P;
    b >>= 1;
  }
  return ans;
}
int getinv(const int a) { return power(a, P - 2); }
namespace Polynomial {
const int LEN = N << 2, g = 3;
int omega[LEN], winv[LEN], rev[LEN];
void init(const int n, const int lg2) {
  int w = power(g, (P - 1) / n), wi = getinv(w);
  omega[0] = 1, winv[0] = 1;
  for (int i = 1; i < n; i++) {
    omega[i] = (long long)omega[i - 1] * w % P;
    winv[i] = (long long)winv[i - 1] * wi % P;
  }
  for (int i = 0; i < n; i++)
    rev[i] = ((rev[i >> 1] >> 1) | ((i & 1) << (lg2 - 1)));
}
void NTT(int *const a, const int *const w, const int n) {
  for (int i = 0; i < n; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int l = 1; l < n; l <<= 1)
    for (int i = 0; i < n; i += (l << 1))
      for (int k = 0; k < l; k++) {
        int x = a[i + k], y = (long long)w[n / (l << 1) * k] * a[i + l + k] % P;
        a[i + k] = (x + y) % P;
        a[i + l + k] = (x - y + P) % P;
      }
}
void mul(const int *const a, const int n1, const int *const b, const int n2,
         int *const c, const int n) {
  static int x[LEN], y[LEN];
  int m = 1, lg2 = 0;
  while (m < n) m <<= 1, ++lg2;
  init(m, lg2);
  memcpy(x, a, sizeof(int[n1]));
  memset(x + n1, 0, sizeof(int[m - n1]));
  memcpy(y, b, sizeof(int[n2]));
  memset(y + n2, 0, sizeof(int[m - n2]));
  NTT(x, omega, m), NTT(y, omega, m);
  for (int i = 0; i < m; i++) x[i] = (long long)x[i] * y[i] % P;
  NTT(x, winv, m);
  int invm = getinv(m);
  for (int i = 0; i < n; i++) c[i] = (long long)x[i] * invm % P;
}
}  // namespace Polynomial
int arr[N], f[B][2][N];
void solve(const int l, const int r, const int dep, const int p) {
  if (l == r) {
    f[dep][p][0] = 1, f[dep][p][1] = arr[l];
    return;
  }
  int mid = (l + r) >> 1;
  solve(l, mid, dep + 1, 0);
  solve(mid + 1, r, dep + 1, 1);
  Polynomial::mul(f[dep + 1][0], mid - l + 2, f[dep + 1][1], r - mid + 1,
                  f[dep][p], r - l + 2);
}
int work() {
  int n, k, q;
  read(n), read(k);
  for (int i = 1; i <= n; i++) read(arr[i]);
  read(q);
  while (q--) {
    int opt;
    read(opt);
    if (opt == 1) {
      int q, i, d, bck;
      read(q), read(i), read(d);
      d %= P;
      bck = arr[i];
      arr[i] = d;
      for (int i = 1; i <= n; i++) arr[i] = (q - arr[i] + P) % P;
      solve(1, n, 0, 0);
      for (int i = 1; i <= n; i++) arr[i] = (q - arr[i] + P) % P;
      arr[i] = bck;
    } else {
      int q, L, R, d;
      read(q), read(L), read(R), read(d);
      d %= P;
      for (int i = L; i <= R; i++) arr[i] = (arr[i] + d) % P;
      for (int i = 1; i <= n; i++) arr[i] = (q - arr[i] + P) % P;
      solve(1, n, 0, 0);
      for (int i = 1; i <= n; i++) arr[i] = (q - arr[i] + P) % P;
      for (int i = L; i <= R; i++) arr[i] = (arr[i] - d + P) % P;
    }
    write(f[0][0][k]), putchar('\n');
  }
  return 0;
}
}  // namespace zyt
int main() { return zyt::work(); }
