#include #include int main() { using namespace std; cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; using Mint = atcoder::modint998244353; vector a(n); for (auto&& e : a) { int v; cin >> v; e = Mint::raw(v); } vector c(n); c[0] = 1 / Mint(2); for (int i = 1; i < n - 1; ++i) c[i] = c[i - 1] / (2 * i + 2); for (int i = 0; i < n - 1; ++i) c[i] = 1 - c[i]; c.back() = n - accumulate(begin(c), end(c) - 1, Mint(0)); Mint coeff = 1; for (int i = 1; i < n; ++i) coeff *= 4 * i; for (int s = 0; s <= n; ++s) { Mint ans; for (int i = 0; i < n; ++i) ans += c[i] * a[i]; ans *= coeff; cout << ans.val() << '\n'; vector na(n); na[0] += a[0] * (n - 2); na[1] += a[0]; for (int i = 1; i < n - 1; ++i) { na[i - 1] += a[i]; na[i] += a[i] * (n - 3); na[i + 1] += a[i]; } na[n - 2] += a[n - 1]; na[n - 1] += a[n - 1] * (n - 2); a = move(na); } }