#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout << fixed;
  cout.tie(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  int p = 2 * n + 1;
  int a[p + 2];
  for (int i = 1; i <= p; i++) cin >> a[i];
  a[0] = -INF;
  a[p + 1] = +INF;
  for (int i = 1; i <= p && k > 0; i++)
    if (i % 2 == 0 && a[i] > a[i - 1] && a[i] > a[i + 1] &&
        a[i] - a[i - 1] > 1 && a[i] - a[i + 1] > 1) {
      k--;
      a[i]--;
    }
  for (int i = 1; i <= p; i++) cout << a[i] << " ";
  return 0;
}
