#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[(n * 2) + 1];
  for (int i = 0; i < (n * 2) + 1; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i < (n * 2); i = i + 2) {
    if (k == 0) break;
    if (a[i] - a[i - 1] > 1 && a[i] - a[i + 1] > 1) {
      --k;
      --a[i];
    }
  }
  for (int i = 0; i < (n * 2) + 1; ++i) {
    cout << a[i] << " ";
  }
  return 0;
}
