#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); } auto E = convolution(vector(n, 1), vector(n, 1)); vector tmp(n); auto f = [&](int k, int x){ tmp[0] = 1; for(int i = 0; i + 1 < n; i++) tmp[i + 1] = tmp[i] * mint::raw(k); while(x){ if(x & 1){ a = convolution(a, tmp); while(a.size() > n) a.pop_back(); } x /= 2; if(x){ for(int i = 0; i < n; i++){ tmp[i] *= E[i]; } } } }; 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'; } } }