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 Fread {
const int MAXN = 1 << 20;
char buf[MAXN], *S, *T;
inline char getchar() {
  if (S == T) {
    T = (S = buf) + fread(buf, 1, MAXN, stdin);
    if (S == T) return EOF;
  }
  return *S++;
}
}  // namespace Fread
namespace Fwrite {
const int MAXN = 1 << 20;
char buf[MAXN], *S = buf, *T = buf + MAXN;
inline void flush() {
  fwrite(buf, 1, S - buf, stdout);
  S = buf;
}
inline void putchar(char c) {
  *S++ = c;
  if (S == T) flush();
}
struct _ {
  ~_() { flush(); }
} __;
}  // namespace Fwrite
template <typename T>
inline void read(T& x) {
  x = 0;
  int f = 1;
  char ch = Fread::getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = Fread::getchar();
  }
  while (isdigit(ch))
    x = (x << 3) + (x << 1) + (ch ^ '0'), ch = Fread::getchar();
  x *= f;
}
template <typename T>
inline void write(T x, bool _enter = 0, bool _space = 0) {
  if (!x)
    Fwrite::putchar('0');
  else {
    if (x < 0) Fwrite::putchar('-'), x = -x;
    static char dig[41];
    int top = 0;
    while (x) dig[++top] = (x % 10) ^ '0', x /= 10;
    while (top) Fwrite::putchar(dig[top--]);
  }
  if (_enter) Fwrite::putchar('\n');
  if (_space) Fwrite::putchar(' ');
}
namespace Fastio {
struct reader {
  template <typename T>
  reader& operator>>(T& x) {
    ::read(x);
    return *this;
  }
  reader& operator>>(char& c) {
    c = Fread::getchar();
    while (c == '\n' || c == ' ') c = Fread::getchar();
    return *this;
  }
  reader& operator>>(char* str) {
    int len = 0;
    char ch = Fread::getchar();
    while (ch != '\n' && ch != ' ') str[len++] = ch, ch = Fread::getchar();
    str[len] = '\0';
    return *this;
  }
  reader& operator>>(std::string& s) {
    std::cin >> s;
    return *this;
  }
} cin;
const char endl = '\n';
struct writer {
  template <typename T>
  writer& operator<<(T x) {
    ::write(x, 0, 0);
    return *this;
  }
  writer& operator<<(char c) {
    Fwrite::putchar(c);
    return *this;
  }
  writer& operator<<(const char* str) {
    int cur = 0;
    while (str[cur]) Fwrite::putchar(str[cur++]);
    return *this;
  }
} cout;
}  // namespace Fastio
const int MOD = 998244353;
inline int mod1(int x) { return x < MOD ? x : x - MOD; }
inline int mod2(int x) { return x < 0 ? x + MOD : x; }
inline void add(int& x, int y) { x = mod1(x + y); }
inline void sub(int& x, int y) { x = mod2(x - y); }
inline int pow_mod(int x, int i) {
  int y = 1;
  while (i) {
    if (i & 1) y = (long long)y * x % MOD;
    x = (long long)x * x % MOD;
    i >>= 1;
  }
  return y;
}
const int MAXN = 2e4;
int n, K, a[MAXN + 5], b[MAXN + 5], res[20][MAXN + 5], f[MAXN * 4 + 5],
    g[MAXN * 4 + 5], rev[MAXN * 4 + 5];
void NTT(int* a, int n, int flag) {
  for (int i = 0; i < n; ++i)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 1; i < n; i <<= 1) {
    int T = pow_mod(3, (MOD - 1) / (i << 1));
    if (flag == -1) T = pow_mod(T, MOD - 2);
    for (int j = 0; j < n; j += (i << 1)) {
      for (int k = 0, t = 1; k < i; ++k, t = (long long)t * T % MOD) {
        int Nx = a[j + k], Ny = (long long)a[i + j + k] * t % MOD;
        a[j + k] = mod1(Nx + Ny);
        a[i + j + k] = mod2(Nx - Ny);
      }
    }
  }
  if (flag == -1) {
    int invn = pow_mod(n, MOD - 2);
    for (int i = 0; i < n; ++i) a[i] = (long long)a[i] * invn % MOD;
  }
}
void mul(int* a, int* b, int n, int m) {
  int lim = 1, ct = 0;
  while (lim <= n + m) lim <<= 1, ct++;
  for (int i = 0; i < lim; ++i)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (ct - 1));
  for (int i = 0; i < n; ++i) f[i] = a[i];
  for (int i = n; i < lim; ++i) f[i] = 0;
  for (int i = 0; i < m; ++i) g[i] = b[i];
  for (int i = m; i < lim; ++i) g[i] = 0;
  NTT(f, lim, 1);
  NTT(g, lim, 1);
  for (int i = 0; i < lim; ++i) f[i] = (long long)f[i] * g[i] % MOD;
  NTT(f, lim, -1);
  for (int i = 0; i < n + m; ++i) a[i] = f[i];
}
void solve(int l, int r, int dep) {
  if (l == r) {
    res[dep][0] = 1;
    res[dep][1] = b[l];
    return;
  }
  int mid = (l + r) >> 1;
  solve(l, mid, dep + 1);
  for (int i = 0; i <= mid - l + 1; ++i) res[dep][i] = res[dep + 1][i];
  solve(mid + 1, r, dep + 1);
  mul(res[dep], res[dep + 1], mid - l + 2, r - mid + 1);
}
int main() {
  Fastio::cin >> n >> K;
  for (int i = 1; i <= n; ++i) Fastio::cin >> a[i], a[i] = mod1(a[i]);
  int q;
  Fastio::cin >> q;
  while (q--) {
    int op;
    Fastio::cin >> op;
    for (int i = 1; i <= n; ++i) b[i] = a[i];
    if (op == 1) {
      int x, i, y;
      Fastio::cin >> x >> i >> y;
      x = mod1(x);
      y = mod1(y);
      b[i] = y;
      for (int i = 1; i <= n; ++i) b[i] = mod2(x - b[i]);
      solve(1, n, 0);
      Fastio::cout << res[0][K] << Fastio::endl;
    } else {
      int x, l, r, y;
      Fastio::cin >> x >> l >> r >> y;
      x = mod1(x);
      y = mod1(y);
      for (int i = l; i <= r; ++i) add(b[i], y);
      for (int i = 1; i <= n; ++i) b[i] = mod2(x - b[i]);
      solve(1, n, 0);
      Fastio::cout << res[0][K] << Fastio::endl;
    }
  }
  return 0;
}
