#include <bits/stdc++.h>
using namespace std;
const int MX = (1 << 20);
map<int, int> cnt;
int codd, ceven;
int arr[MX], C[2];
;
set<int> S[2];
int hat(int coef) {
  coef %= 2;
  ++C[coef];
  if (S[coef].empty()) {
    puts("-1");
    exit(0);
  }
  int ret = *S[coef].begin();
  S[coef].erase(ret);
  return ret;
}
int main() {
  int n, m;
  cin >> n >> m;
  m = min(m, n);
  for (int j = 1; j <= m; j++) S[j % 2].insert(j);
  for (int j = 1; j <= n; j++) {
    int x;
    scanf("%d", &x);
    C[x % 2]++;
    cnt[x]++;
    S[x % 2].erase(x);
    arr[j] = x;
  }
  int ans = 0;
  for (int j = 1; j <= n; j++) {
    int x = arr[j];
    if (cnt[arr[j]] > 1) {
      if (C[x % 2] > n - C[x % 2])
        arr[j] = hat(x % 2 + 1);
      else
        arr[j] = hat(x % 2);
      --C[x % 2];
      --cnt[x];
      ++ans;
    }
  }
  for (int j = 1; j <= n; j++) {
    int x = arr[j];
    if (C[x % 2] > n - C[x % 2]) {
      arr[j] = hat(x % 2 + 1);
      --C[x % 2];
      ++ans;
    }
  }
  cout << ans << endl;
  for (int j = 1; j <= n; j++) printf("%d\n", arr[j]);
}
