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