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;
template <class T, class U>
void ckmin(T &a, U b) {
  if (a > b) a = b;
}
template <class T, class U>
void ckmax(T &a, U b) {
  if (a < b) a = b;
}
int N, K, Q;
vector<long long> arr, tmp;
long long root = 3;
vector<long long> roots;
vector<long long> seg[33013 << 1];
long long ans;
long long expo(long long a, long long e) {
  if (e == 0) return 1;
  if (e & 1) return expo(a * a % 998244353, e >> 1) * a % 998244353;
  return expo(a * a % 998244353, e >> 1);
}
void init(int deg) {
  roots.resize(deg);
  roots[0] = 1;
  roots[1] = expo(root, (998244353 - 1) / deg);
  for (auto i = (2); i < (deg); i++) {
    roots[i] = roots[i - 1] * roots[1] % 998244353;
  }
  return;
}
void ntt(vector<long long> &f) {
  int deg = ((int)((f).size()));
  vector<long long> g(deg);
  for (int i = deg >> 1; i; i >>= 1) {
    for (int j = 0; j < deg; j += i) {
      int t = (2 * j >= deg ? 2 * j - deg : 2 * j);
      for (auto k = (0); k < (i); k++) {
        g[j + k] = f[t + k] + roots[j] * f[t + k + i];
        g[j + k] %= 998244353;
      }
    }
    swap(f, g);
  }
  return;
}
vector<long long> poly_mult(vector<long long> a, vector<long long> b) {
  int siz = ((int)((a).size())) + ((int)((b).size())) - 1,
      siz1 = (1 << (32 - __builtin_clz(siz)));
  if (((int)((a).size())) * ((int)((b).size())) <= 100) {
    vector<long long> res(siz);
    for (auto i = (0); i < (((int)((a).size()))); i++) {
      for (auto j = (0); j < (((int)((b).size()))); j++) {
        res[i + j] += a[i] * b[j];
        res[i + j] %= 998244353;
      }
    }
    return res;
  }
  a.resize(siz1);
  b.resize(siz1);
  init(siz1);
  ntt(a);
  ntt(b);
  long long isiz = expo(siz1, 998244353 - 2);
  for (auto i = (0); i < (siz1); i++) {
    a[i] *= b[i];
    a[i] %= 998244353;
  }
  ntt(a);
  for (auto i = (0); i < (siz1); i++) {
    a[i] *= isiz;
    a[i] %= 998244353;
  }
  reverse(a.begin() + 1, a.end());
  a.resize(siz);
  return a;
}
void poly_debug(vector<long long> f, int d) {
  for (int i = d; i >= 0; i--) {
    cerr << "(" << f[i] << ")x^" << i;
    if (i) {
      cerr << '+';
    } else {
      cerr << endl;
    }
  }
  return;
}
void build(int w, int L, int R) {
  if (L == R) {
    seg[w].resize(2);
    seg[w][1] = 1;
    seg[w][0] = -arr[L];
    seg[w][0] %= 998244353;
    if (seg[w][0] < 0) seg[w][0] += 998244353;
    return;
  }
  int mid = (L + R) >> 1;
  build(w << 1, L, mid);
  build(w << 1 | 1, mid + 1, R);
  seg[w] = poly_mult(seg[w << 1], seg[w << 1 | 1]);
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K;
  for (auto i = (0); i < (N); i++) {
    int x;
    cin >> x;
    tmp.push_back(x);
  }
  cin >> Q;
  while (Q--) {
    arr = tmp;
    int qid;
    cin >> qid;
    if (qid == 1) {
      long long q, d;
      int i;
      cin >> q >> i >> d;
      i--;
      arr[i] = d;
      for (auto j = (0); j < (N); j++) {
        arr[j] = q - arr[j];
      }
    }
    if (qid == 2) {
      long long q, d;
      int l, r;
      cin >> q >> l >> r >> d;
      l--;
      r--;
      for (auto i = (l); i < (r + 1); i++) {
        arr[i] += d;
      }
      for (auto j = (0); j < (N); j++) {
        arr[j] = q - arr[j];
      }
    }
    build(1, 0, N - 1);
    ans = seg[1][N - K];
    if (K & 1) ans = -ans;
    if (ans < 0) ans += 998244353;
    cout << ans << '\n';
  }
  return 0;
}
