#include <bits/stdc++.h>
using namespace std;
const int MAXN = 501;
int n, k, x;
int h[MAXN];
int main() {
  scanf("%d %d\n", &n, &k);
  for (int i = 1; i <= 2 * n + 1; ++i) scanf("%d", &h[i]);
  for (int i = 1; i <= n; ++i) {
    int j = 2 * i;
    if (k && h[j] - 1 > h[j - 1] && h[j] - 1 > h[j + 1]) {
      h[j]--;
      k--;
    }
  }
  for (int i = 1; i <= 2 * n + 1; ++i)
    printf("%d%s", h[i], (i <= 2 * n) ? " " : "\n");
  fclose(stdin);
  fclose(stdout);
  return 0;
}
