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;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long MOD = 998244353;
struct base {
  double x, y;
  base() { x = y = 0; }
  base(double _x, double _y) { x = _x, y = _y; }
  base(double _x) { x = _x, y = 0; }
  void operator=(double _x) { x = _x, y = 0; }
  double real() { return x; }
  double imag() { return y; }
  base operator+(const base& b) { return base(x + b.x, y + b.y); }
  void operator+=(const base& b) { x += b.x, y += b.y; }
  base operator*(const base& b) {
    return base(x * b.x - y * b.y, x * b.y + y * b.x);
  }
  void operator*=(const base& b) {
    double p = x * b.x - y * b.y, q = x * b.y + y * b.x;
    x = p, y = q;
  }
  void operator/=(double k) { x /= k, y /= k; }
  base operator-(const base& b) { return base(x - b.x, y - b.y); }
  void operator-=(const base& b) { x -= b.x, y -= b.y; }
  base conj() { return base(x, -y); }
  base operator/(double k) { return base(x / k, y / k); }
  void Print() { cerr << x << " + " << y << "i\n"; }
};
double PI = 2.0 * acos(0.0);
const long long MAXN = 19;
const long long maxn = (1 << MAXN);
base W[maxn], invW[maxn], P1[maxn], Q1[maxn];
void precompute_powers() {
  for (long long i = 0; i < maxn / 2; i++) {
    double ang = (2 * PI * i) / maxn;
    double _cos = cos(ang), _sin = sin(ang);
    W[i] = base(_cos, _sin);
    invW[i] = base(_cos, -_sin);
  }
}
void fft(vector<base>& a, bool invert) {
  long long n = (long long)a.size();
  for (long long i = 1, j = 0; i < n; ++i) {
    long long bit = n >> 1;
    for (; j >= bit; bit >>= 1) {
      j -= bit;
    }
    j += bit;
    if (i < j) {
      swap(a[i], a[j]);
    }
  }
  for (long long len = 2; len <= n; len <<= 1) {
    for (long long i = 0; i < n; i += len) {
      long long ind = 0, add = maxn / len;
      for (long long j = 0; j < len / 2; ++j) {
        base u = a[i + j],
             v = (a[i + j + len / 2] * (invert ? invW[ind] : W[ind]));
        a[i + j] = (u + v);
        a[i + j + len / 2] = (u - v);
        ind += add;
      }
    }
  }
  if (invert)
    for (long long i = 0; i < n; ++i) {
      a[i] /= n;
    }
}
const long long md = 1e9 + 7;
const long long mod2 = 4ll * md * 1ll * md;
vector<long long> mul_big_mod(vector<long long> a, vector<long long> b,
                              long long mod) {
  long long n1 = a.size(), n2 = b.size();
  long long final_size = a.size() + b.size() - 1;
  long long n = 1;
  while (n < final_size) {
    n <<= 1;
  }
  vector<base> P(n), Q(n);
  long long SQRTMOD = (long long)sqrt(mod) + 10;
  for (long long i = 0; i < n1; i++) {
    P[i] = base(a[i] % SQRTMOD, a[i] / SQRTMOD);
  }
  for (long long i = 0; i < n2; i++) {
    Q[i] = base(b[i] % SQRTMOD, b[i] / SQRTMOD);
  }
  fft(P, 0);
  fft(Q, 0);
  base A1, A2, B1, B2, X, Y;
  for (long long i = 0; i < n; i++) {
    X = P[i];
    Y = P[(n - i) % n].conj();
    A1 = (X + Y) * base(0.5, 0);
    A2 = (X - Y) * base(0, -0.5);
    X = Q[i];
    Y = Q[(n - i) % n].conj();
    B1 = (X + Y) * base(0.5, 0);
    B2 = (X - Y) * base(0, -0.5);
    P1[i] = A1 * B1 + A2 * B2 * base(0, 1);
    Q1[i] = A1 * B2 + A2 * B1;
  }
  for (long long i = 0; i < n; i++) {
    P[i] = P1[i], Q[i] = Q1[i];
  }
  fft(P, 1);
  fft(Q, 1);
  a.resize(final_size);
  for (long long i = 0; i < final_size; i++) {
    long long x = (long long)(P[i].real() + 0.5);
    long long y = (long long)(P[i].imag() + 0.5) % mod;
    long long z = (long long)(Q[i].real() + 0.5);
    a[i] = (x + ((y * SQRTMOD + z) % mod) * SQRTMOD) % mod;
  }
  return a;
}
long long const MAG = 250;
vector<long long> solve(vector<long long> b) {
  long long sz = (long long)b.size();
  if (sz < MAG) {
    vector<long long> c;
    c.resize(sz + 1);
    for (long long i = 0; i <= sz; i++) {
      c[i] = 0;
    }
    c[0] = 1;
    for (long long i = 0; i < sz; i++) {
      long long x = b[i];
      for (long long j = i; j >= 0; j--) {
        c[j + 1] = (c[j + 1] * x + c[j]) % MOD;
      }
      c[0] = (c[0] * x) % MOD;
    }
    return c;
  }
  vector<long long> b1, b2;
  for (long long i = 0; i < sz; i++) {
    if (i & 1) {
      b1.push_back(b[i]);
    } else {
      b2.push_back(b[i]);
    }
  }
  return mul_big_mod(solve(b1), solve(b2), MOD);
}
long long const N = 1e5 + 4;
long long a[N];
long long aa[N];
void solve(long long n, long long k) {
  for (long long i = 0; i < n; i++) {
    a[i] = aa[i];
  }
  long long t;
  long long q;
  scanf("%lld%lld", &t, &q);
  if (t == 1) {
    long long p;
    long long d;
    scanf("%lld%lld", &p, &d);
    p--;
    a[p] = d;
  } else {
    long long l, r;
    long long d;
    scanf("%lld%lld%lld", &l, &r, &d);
    l--;
    for (long long i = l; i < r; i++) {
      a[i] += d;
    }
  }
  for (long long i = 0; i < n; i++) {
    a[i] = (q - a[i]) % MOD;
    if (a[i] < 0) {
      a[i] += MOD;
    }
  }
  vector<long long> z;
  z.resize(n);
  for (long long i = 0; i < n; i++) {
    z[i] = a[i];
  }
  z = solve(z);
  printf("%lld\n", z[n - k]);
}
int32_t main() {
  precompute_powers();
  long long n, k, q;
  scanf("%lld%lld", &n, &k);
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &aa[i]);
  }
  scanf("%lld", &q);
  while (q--) {
    solve(n, k);
  }
  return 0;
}