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;
const int N = 1e5 + 1;
const int MOD = 998244353;
int add(int a, int b) { return (a += b) >= MOD ? a - MOD : a; }
int sub(int a, int b) { return (a -= b) < 0 ? a + MOD : a; }
int mul(int a, int b) { return (long long)a * b % MOD; }
int power(int a, long long n) {
  int res = 1;
  while (n) {
    if (n & 1LL) res = mul(res, a);
    a = mul(a, a);
    n >>= 1LL;
  }
  return res;
}
int inv(int u) { return power(u, MOD - 2); }
const int INV_2 = inv(2);
void debug(vector<int> c) {
  for (int u : c) {
    cout << u << ' ';
  }
  cout << endl;
}
struct NTT {
  int base = 1;
  int maxBase = 0;
  int root;
  vector<int> w = {0, 1};
  vector<int> rev = {0, 1};
  NTT() {
    for (int u = MOD - 1; u % 2 == 0; maxBase++, u >>= 1)
      ;
    root = 2;
    while (power(root, 1 << maxBase) != 1 ||
           power(root, 1 << (maxBase - 1)) == 1) {
      root++;
    }
  }
  void ensure(int curBase) {
    assert(curBase <= maxBase);
    if (curBase <= base) {
      return;
    }
    rev.resize(1 << curBase);
    for (int i = 0; i < (1 << curBase); i++) {
      rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (curBase - 1));
    }
    w.resize(1 << curBase);
    while (base < curBase) {
      int wc = power(root, 1 << (maxBase - base - 1));
      for (int i = (1 << (base - 1)); i < (1 << base); i++) {
        w[i << 1] = w[i];
        w[i << 1 | 1] = mul(w[i], wc);
      }
      base++;
    }
  }
  void fft(vector<int> &a) {
    int curBase = 0;
    while ((1 << curBase) < a.size()) {
      curBase++;
    }
    int shift = base - curBase;
    for (int i = 0; i < a.size(); i++) {
      if (i < (rev[i] >> shift)) {
        swap(a[i], a[rev[i] >> shift]);
      }
    }
    for (int k = 1; k < a.size(); k <<= 1) {
      for (int i = 0; i < k; i++) {
        for (int j = i; j < a.size(); j += k * 2) {
          int foo = a[j];
          int bar = mul(a[j + k], w[i + k]);
          a[j] = add(foo, bar);
          a[j + k] = sub(foo, bar);
        }
      }
    }
  }
  vector<int> mult(vector<int> a, vector<int> b) {
    int sz = a.size() + b.size() - 1;
    int curBase = 0;
    while ((1 << curBase) < sz) {
      curBase++;
    }
    ensure(curBase);
    a.resize(1 << curBase, 0);
    b.resize(1 << curBase, 0);
    fft(a);
    fft(b);
    for (int i = 0; i < (1 << curBase); i++) {
      a[i] = mul(mul(a[i], b[i]), inv(1 << curBase));
    }
    reverse(a.begin() + 1, a.end());
    fft(a);
    a.resize(sz);
    return a;
  }
  vector<int> polyInv(vector<int> r, vector<int> f) {
    vector<int> foo = mult(r, f);
    foo.resize(f.size());
    foo[0] = sub(2, foo[0]);
    for (int i = 1; i < foo.size(); i++) {
      foo[i] = sub(0, foo[i]);
    }
    vector<int> res = mult(r, foo);
    res.resize(f.size());
    return res;
  }
  vector<int> polySqrt(vector<int> s, vector<int> invS, vector<int> f) {
    vector<int> res = mult(f, invS);
    res.resize(f.size());
    for (int i = 0; i < s.size(); i++) {
      res[i] = add(res[i], s[i]);
    }
    for (int i = 0; i < res.size(); i++) {
      res[i] = mul(res[i], INV_2);
    }
    return res;
  }
  vector<int> getSqrt(vector<int> c, int sz) {
    vector<int> sqrtC = {1}, invSqrtC = {1};
    for (int k = 1; k < (1 << sz); k <<= 1) {
      vector<int> foo(c.begin(), c.begin() + (k * 2));
      vector<int> bar = sqrtC;
      bar.resize(bar.size() * 2, 0);
      vector<int> tempInv = polyInv(invSqrtC, bar);
      sqrtC = polySqrt(sqrtC, tempInv, foo);
      invSqrtC = polyInv(invSqrtC, sqrtC);
    }
    return sqrtC;
  }
  vector<int> getInv(vector<int> c, int sz) {
    vector<int> res = {INV_2};
    for (int k = 1; k < (1 << sz); k <<= 1) {
      vector<int> foo(c.begin(), c.begin() + (k * 2));
      res = polyInv(res, foo);
    }
    return res;
  }
} ntt;
vector<int> calc(int l, int r, vector<int> &a) {
  if (r - l == 1) {
    vector<int> res{1, a[l]};
    return res;
  }
  int mid = (l + r) / 2;
  vector<int> pLeft = calc(l, mid, a);
  vector<int> pRight = calc(mid, r, a);
  vector<int> ans = ntt.mult(pLeft, pRight);
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int q;
  cin >> q;
  while (q--) {
    int type;
    cin >> type;
    vector<int> b(n);
    b = a;
    if (type == 1) {
      int q, i, d;
      cin >> q >> i >> d;
      i--;
      b[i] = d;
      for (int i = 0; i < n; ++i) {
        b[i] = (q - b[i]) % MOD;
        b[i] = (b[i] % MOD + MOD) % MOD;
      }
    } else {
      int q, l, r, d;
      cin >> q >> l >> r >> d;
      l--;
      r--;
      for (int i = l; i <= r; ++i) {
        b[i] = (b[i] + d) % MOD;
      }
      for (int i = 0; i < n; ++i) {
        b[i] = (q - b[i]) % MOD;
        b[i] = (b[i] % MOD + MOD) % MOD;
      }
    }
    vector<int> p = calc(0, n, b);
    cout << p[k] << endl;
  }
  return 0;
}
