#include <bits/stdc++.h>
using namespace std;
int y[120 * 2];
int r[120 * 2];
int N, K;
int main() {
  int i, j;
  while (scanf("%d%d", &N, &K) != EOF) {
    for (i = 1; i <= 2 * N + 1; i++) scanf("%d", &y[i]);
    int t = K;
    for (i = 1; i <= 2 * N + 1; i += 2) r[i] = y[i];
    for (i = 2; i <= 2 * N + 1; i += 2) {
      if (y[i] > r[i - 1] + 1 && y[i] > r[i + 1] + 1 && t && y[i])
        r[i] = y[i] - 1, t--;
      else
        r[i] = y[i];
    }
    for (i = 1; i <= 2 * N + 1; i++) {
      if (i != 1) printf(" ");
      printf("%d", r[i]);
    }
    printf("\n");
  }
  return 0;
}
