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;
using ll = long long;
template <typename T>
using posteriority_queue = priority_queue<T, vector<T>, greater<T> >;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1},
          dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U>
inline bool chmax(T &a, U b) {
  return a < b ? (a = b, true) : false;
}
template <typename T, typename U>
inline bool chmin(T &a, U b) {
  return a > b ? (a = b, true) : false;
}
template <typename T>
void unique(vector<T> &a) {
  a.erase(unique((a).begin(), (a).end()), a.end());
}
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;
int mod = MOD;
struct ModInt {
  unsigned val;
  ModInt() : val(0) {}
  ModInt(ll x) : val(x >= 0 ? x % mod : x % mod + mod) {}
  ModInt pow(ll exponent) {
    ModInt tmp = *this, res = 1;
    while (exponent > 0) {
      if (exponent & 1) res *= tmp;
      tmp *= tmp;
      exponent >>= 1;
    }
    return res;
  }
  ModInt &operator+=(const ModInt &x) {
    if ((val += x.val) >= mod) val -= mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &x) {
    if ((val += mod - x.val) >= mod) val -= mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &x) {
    val = static_cast<unsigned long long>(val) * x.val % mod;
    return *this;
  }
  ModInt &operator/=(const ModInt &x) {
    unsigned a = x.val, b = mod;
    int u = 1, v = 0;
    while (b) {
      unsigned tmp = a / b;
      swap(a -= tmp * b, b);
      swap(u -= tmp * v, v);
    }
    return *this *= u;
  }
  bool operator==(const ModInt &x) const { return val == x.val; }
  bool operator!=(const ModInt &x) const { return val != x.val; }
  bool operator<(const ModInt &x) const { return val < x.val; }
  bool operator<=(const ModInt &x) const { return val <= x.val; }
  bool operator>(const ModInt &x) const { return val > x.val; }
  bool operator>=(const ModInt &x) const { return val >= x.val; }
  ModInt &operator++() {
    if (++val == mod) val = 0;
    return *this;
  }
  ModInt operator++(int) {
    ModInt res = *this;
    ++*this;
    return res;
  }
  ModInt &operator--() {
    val = (val == 0 ? mod : val) - 1;
    return *this;
  }
  ModInt operator--(int) {
    ModInt res = *this;
    --*this;
    return res;
  }
  ModInt operator+() const { return *this; }
  ModInt operator-() const { return ModInt(val ? mod - val : 0); }
  ModInt operator+(const ModInt &x) const { return ModInt(*this) += x; }
  ModInt operator-(const ModInt &x) const { return ModInt(*this) -= x; }
  ModInt operator*(const ModInt &x) const { return ModInt(*this) *= x; }
  ModInt operator/(const ModInt &x) const { return ModInt(*this) /= x; }
  friend ostream &operator<<(ostream &os, const ModInt &x) {
    return os << x.val;
  }
  friend istream &operator>>(istream &is, ModInt &x) {
    ll val;
    is >> val;
    x = ModInt(val);
    return is;
  }
};
ModInt abs(const ModInt &x) { return x; }
struct Combinatorics {
  int val;
  vector<ModInt> fact, fact_inv, inv;
  Combinatorics(int val = 10000000)
      : val(val), fact(val + 1), fact_inv(val + 1), inv(val + 1) {
    fact[0] = 1;
    for (int i = (1); i < (val + 1); ++i) fact[i] = fact[i - 1] * i;
    fact_inv[val] = ModInt(1) / fact[val];
    for (int i = val; i > 0; --i) fact_inv[i - 1] = fact_inv[i] * i;
    for (int i = (1); i < (val + 1); ++i) inv[i] = fact[i - 1] * fact_inv[i];
  }
  ModInt nCk(int n, int k) {
    if (n < 0 || n < k || k < 0) return ModInt(0);
    return fact[n] * fact_inv[k] * fact_inv[n - k];
  }
  ModInt nPk(int n, int k) {
    if (n < 0 || n < k || k < 0) return ModInt(0);
    return fact[n] * fact_inv[n - k];
  }
  ModInt nHk(int n, int k) {
    if (n < 0 || k < 0) return ModInt(0);
    return (k == 0 ? ModInt(1) : nCk(n + k - 1, k));
  }
};
struct NTT {
  NTT(int mod_) {
    for (int i = 0;; ++i) {
      assert(i < 23);
      if (primes[i][0] == mod_) {
        mod = mod_;
        n_max = 1 << primes[i][2];
        root = ModInt(primes[i][1]).pow((mod - 1) >> primes[i][2]);
        break;
      }
    }
  }
  void sub_dft(vector<ModInt> &a) {
    int n = a.size();
    calc(n);
    int shift = __builtin_ctz(butterfly.size()) - __builtin_ctz(n);
    for (int i = (0); i < (n); ++i) {
      int j = butterfly[i] >> shift;
      if (i < j) swap(a[i], a[j]);
    }
    for (int block = 1; block < n; block <<= 1) {
      int den = __builtin_ctz(block);
      for (int i = 0; i < n; i += (block << 1))
        for (int j = (0); j < (block); ++j) {
          ModInt tmp = a[i + j + block] * omega[den][j];
          a[i + j + block] = a[i + j] - tmp;
          a[i + j] += tmp;
        }
    }
  }
  template <typename T>
  vector<ModInt> dft(const vector<T> &a) {
    int n = a.size(), lg = 1;
    while ((1 << lg) < n) ++lg;
    vector<ModInt> A(1 << lg, 0);
    for (int i = (0); i < (n); ++i) A[i] = a[i];
    sub_dft(A);
    return A;
  }
  void idft(vector<ModInt> &a) {
    int n = a.size();
    sub_dft(a);
    reverse(a.begin() + 1, a.end());
    ModInt inv_n = ModInt(1) / n;
    for (int i = (0); i < (n); ++i) a[i] *= inv_n;
  }
  template <typename T>
  vector<ModInt> convolution(const vector<T> &a, const vector<T> &b) {
    int a_sz = a.size(), b_sz = b.size(), sz = a_sz + b_sz - 1, lg = 1;
    while ((1 << lg) < sz) ++lg;
    int n = 1 << lg;
    vector<ModInt> A(n, 0), B(n, 0);
    for (int i = (0); i < (a_sz); ++i) A[i] = a[i];
    for (int i = (0); i < (b_sz); ++i) B[i] = b[i];
    sub_dft(A);
    sub_dft(B);
    for (int i = (0); i < (n); ++i) A[i] *= B[i];
    idft(A);
    A.resize(sz);
    return A;
  }

 private:
  const int primes[23][3] = {
      {16957441, 329, 14}, {17006593, 26, 15},  {19529729, 770, 17},
      {167772161, 3, 25},  {469762049, 3, 26},  {645922817, 3, 23},
      {897581057, 3, 23},  {924844033, 5, 21},  {935329793, 3, 22},
      {943718401, 7, 22},  {950009857, 7, 21},  {962592769, 7, 21},
      {975175681, 17, 21}, {976224257, 3, 20},  {985661441, 3, 22},
      {998244353, 3, 23},  {1004535809, 3, 21}, {1007681537, 3, 20},
      {1012924417, 5, 21}, {1045430273, 3, 20}, {1051721729, 6, 20},
      {1053818881, 7, 20}, {1224736769, 3, 24}};
  int n_max;
  ModInt root;
  vector<int> butterfly{0};
  vector<vector<ModInt> > omega{{1}};
  void calc(int n) {
    int prev_n = butterfly.size();
    if (n <= prev_n) return;
    butterfly.resize(n);
    int prev_lg = omega.size(), lg = __builtin_ctz(n);
    for (int i = (1); i < (prev_n); ++i) butterfly[i] <<= lg - prev_lg;
    for (int i = (prev_n); i < (n); ++i)
      butterfly[i] = (butterfly[i >> 1] >> 1) | ((i & 1) << (lg - 1));
    omega.resize(lg);
    for (int i = (prev_lg); i < (lg); ++i) {
      omega[i].resize(1 << i);
      ModInt tmp = root.pow((mod - 1) / (1 << (i + 1)));
      for (int j = (0); j < (1 << (i - 1)); ++j) {
        omega[i][j << 1] = omega[i - 1][j];
        omega[i][(j << 1) + 1] = omega[i - 1][j] * tmp;
      }
    }
  }
};
int main() {
  NTT ntt(MOD);
  int n, k;
  cin >> n >> k;
  vector<ll> a(n);
  for (int i = (0); i < (n); ++i) cin >> a[i];
  int Q;
  cin >> Q;
  while (Q--) {
    int type, l, r;
    ll q, d;
    cin >> type >> q;
    if (type == 1) {
      int i;
      cin >> i >> d;
      --i;
      l = r = i;
      d -= a[i];
    } else {
      cin >> l >> r >> d;
      --l;
      --r;
    }
    vector<ll> b(n);
    for (int i = (0); i < (n); ++i) b[i] = q - a[i];
    for (int i = (l); i < (r + 1); ++i) b[i] -= d;
    for (int i = (0); i < (n); ++i) {
      b[i] %= MOD;
      if (b[i] < 0) b[i] += MOD;
    }
    vector<vector<ModInt> > node(n << 1);
    for (int i = (0); i < (n); ++i) node[n + i] = {1, b[i]};
    for (int i = n - 1; i > 0; --i) {
      node[i] = ntt.convolution(node[i << 1], node[(i << 1) + 1]);
      if (node[i].size() > k + 1) node[i].resize(k + 1);
    }
    cout << node[1][k] << '\n';
  }
  return 0;
}