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