#include using namespace std; #include using namespace atcoder; using mint = modint998244353; using vm = vector; using vvm = vector; inline ostream &operator<<(ostream &os, const mint x) { return os << x.val(); }; inline istream &operator>>(istream &is, mint &x) { long long v; is >> v; x = v; return is; }; struct Fast { Fast() { std::cin.tie(nullptr); ios::sync_with_stdio(false); cout << setprecision(10); } } fast; #define all(a) (a).begin(), (a).end() #define contains(a, x) ((a).find(x) != (a).end()) #define rep(i, a, b) for (int i = (a); i < (int)(b); i++) #define rrep(i, a, b) for (int i = (int)(b) - 1; i >= (a); i--) #define YN(b) cout << ((b) ? "YES" : "NO") << "\n"; #define Yn(b) cout << ((b) ? "Yes" : "No") << "\n"; #define yn(b) cout << ((b) ? "yes" : "no") << "\n"; template inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using ll = long long; using vb = vector; using vvb = vector; using vi = vector; using vvi = vector; using vl = vector; using vvl = vector; template ostream &operator<<(ostream &os, pair &p) { os << "(" << p.first << "," << p.second << ")"; return os; } template ostream &operator<<(ostream &os, vector &vec) { for (int i = 0; i < (int)vec.size(); i++) { os << vec[i] << (i + 1 == (int)vec.size() ? "" : " "); } return os; } template istream &operator>>(istream &is, vector &vec) { for (int i = 0; i < (int)vec.size(); i++) is >> vec[i]; return is; } ll floor(ll a, ll b) { return a >= 0 ? a / b : (a + 1) / b - 1; } ll ceil(ll a, ll b) { return a > 0 ? (a - 1) / b + 1 : a / b; } template struct factorial { vector f, g, h; factorial(int MAX = 0) { f.resize(1, mint{1}); g.resize(1, mint{1}); h.resize(1, mint{1}); if (MAX > 0) extend(MAX + 1); } void extend(int m = -1) { int n = f.size(); if (m == -1) m = n * 2; if (n >= m) return; f.resize(m); g.resize(m); h.resize(m); for (int i = n; i < m; i++) f[i] = f[i - 1] * mint(i); g[m - 1] = f[m - 1].inv(); h[m - 1] = g[m - 1] * f[m - 2]; for (int i = m - 2; i >= n; i--) { g[i] = g[i + 1] * mint(i + 1); h[i] = g[i] * f[i - 1]; } } mint fact(int i) { if (i < 0) return mint(0); while (i >= (int)f.size()) extend(); return f[i]; } mint fact_inv(int i) { if (i < 0) return mint(0); while (i >= (int)g.size()) extend(); return g[i]; } mint inv(int i) { if (i < 0) return -inv(-i); while (i >= (int)h.size()) extend(); return h[i]; } mint binom(int n, int r) { if (n < 0 || n < r || r < 0) return mint(0); return fact(n) * fact_inv(n - r) * fact_inv(r); } mint multinom(const vector &r) { int n = 0; for (auto &x : r) { if (x < 0) return mint(0); n += x; } mint res = fact(n); for (auto &x : r) res *= fact_inv(x); return res; } mint binom_naive(int n, int r) { if (n < 0 || n < r || r < 0) return mint(0); mint ret = mint(1); r = min(r, n - r); for (int i = 1; i <= r; ++i) ret *= inv(i) * (n--); return ret; } mint P(int n, int r) { if (n < 0 || n < r || r < 0) return mint(0); return fact(n) * fact_inv(n - r); } mint H(int n, int r) { if (n < 0 || r < 0) return mint(0); return r == 0 ? 1 : binom(n + r - 1, r); } }; void solve() { int n, k; cin >> n >> k; vm a(n); cin >> a; factorial fact(1000000); if (k & 1) rep(i, 0, n) if (i & 1) a[i] = -a[i]; vm g(n); { int m = (k + 1) / 2; if (m) { rep(i, 0, n) g[i] = fact.binom(m - 1 + i, i); a = convolution(a, g); } } { int m = k / 2; if (m) { rep(i, 0, n) g[i] = fact.binom(m - 1 + i, i) * (i & 1 ? -1 : 1); a = convolution(a, g); } } rep(i, 0, n) cout << a[i] << " \n"[i + 1 == n]; } int main() { int t = 1; // cin >> t; while (t--) solve(); }