func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n, M;   vector<long long> cards;   map<int, vector<int>> m;   int sodd = 1, seven = 2;   int oddbalance;   int nextOdd() {     for (int i = sodd;; i += 2) {       if (m[i].empty()) {         sodd = i + 2;         if (i > M) {           cout << -1 << endl;           exit(0);         }         return i;       }     }   }   int nextEven() {     for (int i = seven;; i += 2) {       if (m[i].empty()) {         seven = i + 2;         if (i > M) {           cout << -1 << endl;           exit(0);         }         return i;       }     }   }   int cnt;   int main() {     cin >> n >> M;     cards.resize(n);     for (int i = 0; i < n; i++) {       cin >> cards[i];       if (cards[i] % 2)         oddbalance++;       else         oddbalance--;       m[cards[i]].push_back(i);     }     for (auto p : m) {       while (p.second.size() > 1) {         cnt++;         if (p.first % 2 == 1)           oddbalance--;         else           oddbalance++;         int pos = p.second.back();         p.second.pop_back();         int val;         if (oddbalance > 0) {           val = nextEven();           oddbalance--;         } else {           val = nextOdd();           oddbalance++;         }         m[val].push_back(pos);         cards[pos] = val;       }     }     for (int i = 0; i < n && oddbalance; i++) {       if (oddbalance > 0 && cards[i] % 2 == 1) {         cnt++;         cards[i] = nextEven();         oddbalance -= 2;       } else if (oddbalance < 0 && cards[i] % 2 == 0) {         cnt++;         cards[i] = nextOdd();         oddbalance += 2;       }     }     if (oddbalance != 0) {       cout << -1 << endl;       exit(0);     }     cout << cnt << endl;     for (int c : cards) {       cout << c <<    ;     }     cout << endl;   }   