#include <bits/stdc++.h>
using namespace std;
int fac(int x) {
  if (x > 1) return x * fac(x - 1);
  return 1;
}
bool is_prime(int x) {
  if (x == 1) return false;
  for (int i = 2; i <= sqrt(x); i++)
    if (x % i == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int k, n, arr[206];
  cin >> n >> k;
  for (int i = 1; i < 2 * n + 2; i++) cin >> arr[i];
  for (int i = 2; i <= 2 * n + 1; i += 2) {
    if (k > 0) {
      if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1]) {
        if (arr[i] - 1 > arr[i - 1] && arr[i] - 1 > arr[i + 1]) {
          arr[i]--;
          k--;
        }
      }
    } else
      break;
  }
  for (int i = 1; i < 2 * n + 2; i++) cout << arr[i] << " ";
}
