#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int a[maxn];
int func(int i) {
  if ((i / 2) * 2 == i) {
    return 1;
  } else
    return 0;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (func(a[i])) {
      a[i] = a[i] - 1;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  return 0;
}
