import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int k = Integer.parseInt(sa[1]); sa = br.readLine().split(" "); long[] a = new long[n]; for (int i = 0; i < n; i++) { a[i] = Integer.parseInt(sa[i]); } br.close(); int mod = 998244353; if (k <= 6) { for (int i = 0; i < k; i++) { long[] b = new long[n + 1]; for (int j = 0; j < n; j++) { if (j % 2 == 0) { b[j + 1] = b[j] + a[j]; } else { b[j + 1] = b[j] - a[j]; } } System.arraycopy(b, 1, a, 0, n); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < n; i++) { long ans = a[i] % mod; if (ans < 0) { ans += mod; } sb.append(ans).append(' '); } sb.deleteCharAt(sb.length() - 1); System.out.println(sb.toString()); } else { long[][] b = new long[6][n + 1]; for (int j = 0; j < n; j++) { b[0][j + 1] = a[j]; } for (int i = 0; i < 5; i++) { for (int j = 0; j < n; j++) { if (j % 2 == 0) { b[i + 1][j + 1] = b[i + 1][j] + b[i][j + 1]; } else { b[i + 1][j + 1] = b[i + 1][j] - b[i][j + 1]; } } } int m2 = 998244354 / 2; StringBuilder sb = new StringBuilder(); for (int j = 1; j <= n; j++) { long b0 = 0; long d1 = 0; long d2 = 0; if (k % 2 == 0) { b0 = b[0][j]; d1 = b[2][j] - b[0][j]; d2 = b[4][j] - b[2][j]; } else { b0 = b[1][j]; d1 = b[3][j] - b[1][j]; d2 = b[5][j] - b[3][j]; } long e = (d2 - d1) % mod; int k2 = k / 2; long add = d1 % mod * k2 % mod + e * (k2 - 1) % mod * k2 % mod * m2 % mod; long ans = (b0 + add) % mod; sb.append(ans).append(' '); } sb.deleteCharAt(sb.length() - 1); System.out.println(sb.toString()); } } }