#include <bits/stdc++.h>
using namespace std;
struct cmpStruct {
  bool operator()(long long const& lhs, long long const& rhs) const {
    return lhs > rhs;
  }
};
int main() {
  int n;
  cin >> n;
  std::vector<long long> a(n);
  long long m = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) a[i] = a[i] - 1;
    m = max(a[i], m);
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
