#include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, q; cin >> n >> q; vector a(n); for(int i = 0; i < n; i++){ int v; cin >> v; a[i] = mint::raw(v); } vector tmp(n); auto f = [&](int k, int x){ mint e = mint::raw(k); tmp[0] = 1; for(int i = 0; i + 1 < n; i++) tmp[i + 1] = tmp[i] * e * x; a = convolution(a, tmp); while(a.size() > n) a.pop_back(); return; while(x){ if(x & 1){ a = convolution(a, tmp); while(a.size() > n) a.pop_back(); } x /= 2; if(x){ tmp = convolution(tmp, tmp); while(tmp.size() > n) tmp.pop_back(); } } }; while(q--){ int cmd; cin >> cmd; if(cmd == 1){ int k, x; cin >> k >> x; f(k, x); }else{ int x; cin >> x; cout << a[x - 1].val() << '\n'; } } }