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;
long long invs[(1 << 19)], f[(1 << 19)], fi[(1 << 19)];
long long inv(long long x) {
  return x == 1 ? 1
                : (((inv(998244353 % x) * (998244353 - 998244353 / x)) +
                    998244353) %
                   998244353);
}
long long binom(long long n, long long k) {
  return (
      ((f[n] * (((fi[n - k] * fi[k]) + 998244353) % 998244353)) + 998244353) %
      998244353);
}
void ginv() {
  invs[1] = 1;
  f[0] = fi[0] = 1;
  for (int i = 2; i != (1 << 19); ++i)
    invs[i] =
        (((invs[998244353 % i] * (998244353 - 998244353 / i)) + 998244353) %
         998244353);
  for (int i = 1; i != (1 << 19); ++i)
    f[i] = (((f[i - 1] * i) + 998244353) % 998244353);
  for (int i = 1; i != (1 << 19); ++i)
    fi[i] = (((fi[i - 1] * invs[i]) + 998244353) % 998244353);
}
long long qp(long long a, long long b) {
  long long r = 1;
  do
    if (b & 1) r = (((r * a) + 998244353) % 998244353);
  while (a = (((a * a) + 998244353) % 998244353), b >>= 1);
  return r;
}
long long inv(long long x, long long p) {
  return x == 1 ? 1 : inv(p % x, p) * (p - p / x) % p;
}
long long qpm(long long a, long long b, long long q) {
  long long r = 1;
  do
    if (b & 1) r = r * a % q;
  while (a = a * a % q, b >>= 1);
  return r;
}
long long msqrt(long long n, long long p) {
  if (!n) return 0;
  long long q = p - 1, s = 0, z = 2;
  q >>= (s = __builtin_ctzll(q));
  if (s == 1) return qpm(n, (p + 1) / 4, p);
  while (qpm(z, (p - 1) / 2, p) == 1) ++z;
  long long c = qpm(z, q, p), t = qpm(n, q, p), r = qpm(n, (q + 1) / 2, p),
            m = s;
  while (t % p != 1) {
    long long i = 1;
    while (qpm(t, 1ll << i, p) != 1) ++i;
    long long b = qpm(c, 1ll << (m - i - 1), p);
    r = r * b % p;
    c = (b * b) % p;
    t = (t * c) % p;
    m = i;
  }
  return min(r, p - r);
}
namespace poly {
istream& operator>>(istream& is, vector<long long>& p) {
  for (long long& w : p) is >> w;
  return is;
}
ostream& operator<<(ostream& os, const vector<long long>& p) {
  for (long long w : p) os << w << ' ';
  return os;
}
int fr[(1 << 19)], fs;
long long pa[(1 << 19)], pb[(1 << 19)], pc[(1 << 19)], pd[3][(1 << 19)];
void init(int s) {
  for (fs = 1; fs < s; fs <<= 1)
    ;
  for (int i = 0; i != fs; ++i)
    fr[i] = (fr[i >> 1] >> 1) | (i & 1 ? (fs >> 1) : 0);
}
vector<long long> add(const vector<long long>& p1,
                      const vector<long long>& p2) {
  int n1 = p1.size(), n2 = p2.size(), n3 = max(n1, n2);
  vector<long long> pr(n3, 0);
  for (int i = 0; i != n3; ++i) {
    if (i < n1) pr[i] = (((pr[i] + p1[i]) + 998244353) % 998244353);
    if (i < n2) pr[i] = (((pr[i] + p2[i]) + 998244353) % 998244353);
  }
  return pr;
}
vector<long long> sub(const vector<long long>& p1,
                      const vector<long long>& p2) {
  int n1 = p1.size(), n2 = p2.size(), n3 = max(n1, n2);
  vector<long long> pr(n3);
  for (int i = 0; i != n3; ++i) {
    if (i < n1) pr[i] = (((pr[i] + p1[i]) + 998244353) % 998244353);
    if (i < n2) pr[i] = (((pr[i] - p2[i]) + 998244353) % 998244353);
  }
  return pr;
}
vector<long long> mul(const vector<long long>& p1, long long k) {
  int n1 = p1.size();
  vector<long long> p2(n1);
  for (int i = 0; i != n1; ++i) p2[i] = (((k * p1[i]) + 998244353) % 998244353);
  return p2;
}
void ntt(long long* p, int f) {
  static const long long g = 3;
  for (int i = 0; i != fs; ++i)
    if (i < fr[i]) swap(p[i], p[fr[i]]);
  for (int i = 1; i != fs; i <<= 1) {
    long long e = (998244353 - 1) / (i << 1),
              w0 = qp(g, f == 1 ? e : 998244353 - 1 - e);
    for (int j = 0; j != fs; j += (i << 1)) {
      long long w = 1;
      for (int k = 0; k != i; k++, w = (((w * w0) + 998244353) % 998244353)) {
        long long u = p[j + k],
                  v = (((w * p[i + j + k]) + 998244353) % 998244353);
        p[j + k] = (((u + v) + 998244353) % 998244353);
        p[i + j + k] = (((u - v) + 998244353) % 998244353);
      }
    }
  }
  if (f == -1)
    for (long long i = 0; i != fs; ++i)
      p[i] = (((p[i] * invs[fs]) + 998244353) % 998244353);
}
vector<long long> mul(const vector<long long>& p1, const vector<long long>& p2,
                      int n = 0) {
  int n1 = p1.size(), n2 = p2.size(), n3 = n1 + n2 - 1;
  init(n3 + 1);
  vector<long long> pr(n3);
  copy_n(p1.begin(), n1, pa);
  fill(pa + n1, pa + fs, 0);
  copy_n(p2.begin(), n2, pb);
  fill(pb + n2, pb + fs, 0);
  ntt(pa, 1);
  ntt(pb, 1);
  for (int i = 0; i != fs; ++i)
    pc[i] = (((pa[i] * pb[i]) + 998244353) % 998244353);
  ntt(pc, -1);
  copy(pc, pc + n3, pr.begin());
  if (n && pr.size() > n) pr.resize(n, 0);
  return pr;
}
vector<long long> inv(const vector<long long>& p1) {
  int n1 = p1.size(), n2 = (n1 + 1) >> 1;
  if (n1 == 1)
    return {::inv(p1[0])};
  else {
    vector<long long> p2 = inv(vector<long long>(p1.begin(), p1.begin() + n2));
    return sub(mul(p2, 2), mul(p1, mul(p2, p2, n1), n1));
  }
}
pair<vector<long long>, vector<long long>> div(const vector<long long>& p1,
                                               const vector<long long>& p2) {
  int n1 = p1.size(), n2 = p2.size(), n3 = n1 - n2 + 1;
  vector<long long> p1r = p1, p2r = p2;
  reverse(p1r.begin(), p1r.end());
  reverse(p2r.begin(), p2r.end());
  p1r.resize(n3, 0);
  p2r.resize(n3, 0);
  vector<long long> p3 = mul(p1r, inv(p2r), n3);
  reverse(p3.begin(), p3.end());
  vector<long long> p4 = sub(p1, mul(p2, p3));
  p4.resize(n2 - 1, 0);
  return {p3, p4};
}
vector<long long> deriv(const vector<long long>& p1) {
  int n1 = p1.size();
  vector<long long> p2(n1 - 1);
  for (int i = 1; i != n1; ++i)
    p2[i - 1] = (((i * p1[i]) + 998244353) % 998244353);
  return p2;
}
vector<long long> integ(const vector<long long>& p1) {
  int n1 = p1.size();
  vector<long long> p2(n1 + 1, 0);
  for (int i = 0; i != n1; ++i)
    p2[i + 1] = (((p1[i] * invs[i + 1]) + 998244353) % 998244353);
  return p2;
}
vector<long long> log(const vector<long long>& p1) {
  return integ(mul(deriv(p1), inv(p1), p1.size() - 1));
}
vector<long long> exp(const vector<long long>& p1) {
  if (p1.size() == 1)
    return {1};
  else {
    vector<long long> p2 = exp({p1.begin(), p1.begin() + (p1.size() + 1 >> 1)});
    p2.resize(p1.size(), 0);
    return mul(p2, add(sub({1}, log(p2)), p1), p1.size());
  }
}
vector<long long> sqrt(const vector<long long>& p1) {
  int n1 = p1.size(), n2 = (n1 + 1) >> 1;
  if (n1 == 1)
    return {::msqrt(p1[0], 998244353)};
  else {
    vector<long long> p2 = sqrt(vector<long long>(p1.begin(), p1.begin() + n2));
    vector<long long> p3 = mul(p2, 2);
    p3.resize(n1);
    p3 = inv(p3);
    return mul(add(mul(p2, p2, n1), p1), p3, n1);
  }
}
vector<long long> pow(const vector<long long>& p1, int k) {
  int n1 = p1.size(), n2 = n1;
  while (n2 && !p1[n1 - n2]) n2--;
  int n3 = max(n1 - 1ll * (n1 - n2) * k, 0ll);
  if (!n2 || !n3) return vector<long long>(n1, 0);
  vector<long long> p2(p1.begin() + n1 - n2, p1.begin() + n1 - n2 + n3);
  long long c = p2[0];
  p2 = mul(exp(mul(log(mul(p2, ::inv(c))), k)), qp(c, k));
  p2.resize(n1, 0);
  rotate(p2.begin(), p2.begin() + n3, p2.end());
  return p2;
}
vector<long long> conv(const vector<long long>& g) { return inv(sub({1}, g)); }
vector<long long> egf(const vector<long long>& g) {
  vector<long long> r(g.size());
  for (int i = 0; i != g.size(); ++i)
    r[i] = (((g[i] * fi[i]) + 998244353) % 998244353);
  return r;
}
vector<long long> iegf(const vector<long long>& g) {
  vector<long long> r(g.size());
  for (int i = 0; i != g.size(); ++i)
    r[i] = (((g[i] * f[i]) + 998244353) % 998244353);
  return r;
}
}  // namespace poly
using namespace poly;
vector<long long> solve(const vector<long long>& a, int k) {
  if (a.size() == 1)
    return {1, a[0]};
  else {
    int n = a.size();
    vector<long long> a1(a.begin(), a.begin() + n / 2);
    vector<long long> a2(a.begin() + n / 2, a.end());
    return mul(solve(a1, k), solve(a2, k), k + 1);
  }
}
long long a[(1 << 19)];
int main(void) {
  ginv();
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]), a[i] %= 998244353;
  int q;
  scanf("%d", &q);
  while (q--) {
    int o;
    scanf("%d", &o);
    if (o == 1) {
      int p;
      long long w, d;
      scanf("%lld%d%lld", &w, &p, &d);
      vector<long long> b(n);
      w %= 998244353;
      d %= 998244353;
      for (int i = 1; i <= n; ++i) {
        if (p == i)
          b[i - 1] = (((w - d) + 998244353) % 998244353);
        else
          b[i - 1] = (((w - a[i]) + 998244353) % 998244353);
      }
      printf("%d\n", solve(b, k)[k]);
    } else {
      int l, r;
      long long w, d;
      scanf("%lld%d%d%lld", &w, &l, &r, &d);
      w %= 998244353;
      d %= 998244353;
      vector<long long> b(n);
      for (int i = 1; i <= n; ++i) {
        if (l <= i && i <= r)
          b[i - 1] =
              (((w - (((a[i] + d) + 998244353) % 998244353)) + 998244353) %
               998244353);
        else
          b[i - 1] = (((w - a[i]) + 998244353) % 998244353);
      }
      printf("%d\n", solve(b, k)[k]);
    }
  }
  return 0;
}