#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  set<int> arr2;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] & 1) {
      arr2.insert(arr[i]);
      arr2.insert(arr[i] + 1);
    } else {
      arr2.insert(arr[i] - 1);
      arr2.insert(arr[i]);
    }
  }
  for (auto k : arr2) {
    if (k & 1) {
      for (int i = 0; i < n; i++)
        if (arr[i] == k) arr[i] = k + 1;
    } else {
      for (int i = 0; i < n; i++)
        if (arr[i] == k) arr[i] = k - 1;
    }
  }
  for (auto it : arr) cout << it << " ";
}
