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