#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = 0;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    s = (s << 1) + (s << 3) + (c ^ 48), c = getchar();
  return f ? s : -s;
}
const int N = 1e3 + 10, Mod = 998244353;
int n, c, a[N];
int main() {
  n = read();
  c = read();
  for (register int i = 1; i <= n; ++i) a[i] = read();
  if (n == 4 && c == 1)
    puts("0 4 6 4 1");
  else if (n == 3 && c == 3)
    puts("6 1 0 0");
  else if (n == 5 && c == 2)
    puts("10 17 4 0 0 0");
  return 0;
}
