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>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long MOD = 998244353;
long double EPS = 1e-9;
long long binpow(long long b, long long p, long long mod) {
  long long ans = 1;
  b %= mod;
  for (; p; p >>= 1) {
    if (p & 1) ans = ans * b % mod;
    b = b * b % mod;
  }
  return ans;
}
void pre() {}
namespace myNTT {
const long long MOD = 998244353, PRIMITIVE_ROOT = 3;
const long long MAXB = 1 << 20;
long long pow1(long long a, long long b) {
  if (b == 0) return 1;
  long long ret = pow1(a, b / 2);
  ret = (ret * ret) % MOD;
  if (b & 1) ret = (a * ret) % MOD;
  return ret;
}
long long modInv(long long a) {
  return a <= 1 ? a : (long long)(MOD - MOD / a) * modInv(MOD % a) % MOD;
}
void NTT(long long P[], long long n, long long oper) {
  for (long long i = 1, j = 0; i < n - 1; i++) {
    for (long long s = n; j ^= s >>= 1, ~j & s;)
      ;
    if (i < j) swap(P[i], P[j]);
  }
  for (long long d = 0; (1 << d) < n; d++) {
    long long m = 1 << d, m2 = m * 2;
    long long unit_p0 = pow1(PRIMITIVE_ROOT, (MOD - 1) / m2);
    if (oper < 0) unit_p0 = modInv(unit_p0);
    for (long long i = 0; i < n; i += m2) {
      long long unit = 1;
      for (long long j = 0; j < m; j++) {
        long long &P1 = P[i + j + m], &P2 = P[i + j];
        long long t = unit * P1 % MOD;
        P1 = (P2 - t + MOD) % MOD;
        P2 = (P2 + t) % MOD;
        unit = unit * unit_p0 % MOD;
      }
    }
  }
}
vector<long long> mul(const vector<long long>& a, const vector<long long>& b) {
  vector<long long> ret(max(0LL, (long long)a.size() + (long long)b.size() - 1),
                        0);
  static long long A[MAXB], B[MAXB], C[MAXB];
  long long len = 1;
  while (len < (long long)ret.size()) len <<= 1;
  for (long long i = 0; i < len; i++) A[i] = i < (long long)a.size() ? a[i] : 0;
  for (long long i = 0; i < len; i++) B[i] = i < (long long)b.size() ? b[i] : 0;
  NTT(A, len, 1);
  NTT(B, len, 1);
  for (long long i = 0; i < len; i++) C[i] = (long long)A[i] * B[i] % MOD;
  NTT(C, len, -1);
  for (long long i = 0, inv = modInv(len); i < (long long)ret.size(); i++)
    ret[i] = (long long)C[i] * inv % MOD;
  return ret;
}
}  // namespace myNTT
long long mod = MOD;
vector<long long> polymul(vector<long long>& X, long long k) {
  if (X.empty()) {
    vector<long long> ret;
    ret.emplace_back(1);
    return ret;
  }
  if (X.size() == 1) {
    vector<long long> temp;
    temp.emplace_back(-X[0]);
    temp.emplace_back(1);
    return temp;
  }
  long long k1 = (X.size() >> 1);
  vector<long long> v1(X.begin(), X.begin() + k1);
  vector<long long> v2(X.begin() + k1, X.end());
  vector<long long> V1 = polymul(v1, k), V2 = polymul(v2, k);
  V1 = myNTT::mul(V1, V2);
  V1.resize(min((long long)V1.size(), k + 1));
  return V1;
}
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> A;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    A.push_back(x);
  }
  long long B[n];
  for (long long i = 0; i < n; i++) {
    B[i] = A[i];
  }
  using ll = long long;
  long long Q;
  cin >> Q;
  while (Q--) {
    long long t;
    cin >> t;
    if (t == 1) {
      ll q, x, d;
      cin >> q >> x >> d;
      x--;
      A[x] = d;
      for (long long i = 0; i < n; i++) {
        A[i] = (q - A[i] + 2 * MOD) % MOD;
      }
      long long mul = 1;
      if ((k)&1) mul = -1;
      vector<long long> C = polymul(A, A.size());
      cout << (C[n - k] * mul % MOD + MOD) % MOD << '\n';
      for (long long i = 0; i < n; i++) {
        A[i] = B[i];
      }
    } else {
      ll q, L, R, d;
      cin >> q >> L >> R >> d;
      L--;
      R--;
      for (long long i = L; i <= R; i++) {
        A[i] += d;
        A[i] %= mod;
      }
      for (long long i = 0; i < n; i++) {
        A[i] = (q - A[i] + 2 * MOD) % MOD;
      }
      long long mul = 1;
      if ((k)&1) mul = -1;
      vector<long long> C = polymul(A, A.size());
      cout << (C[n - k] * mul % MOD + MOD) % MOD << '\n';
      for (long long i = 0; i < n; i++) {
        A[i] = B[i];
      }
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  pre();
  long long _t = 1;
  for (long long i = 1; i <= _t; i++) {
    solve();
  }
}