#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  vector<int> numbers(N);
  set<int> uniqueNumbers;
  for (int i = 0; i < N; i += 1) {
    scanf("%d", &numbers[i]);
    uniqueNumbers.insert(numbers[i]);
  }
  while (!uniqueNumbers.empty()) {
    int curr = *uniqueNumbers.begin();
    for (int i = 0; i < N; i += 1) {
      if (numbers[i] == curr) {
        if (numbers[i] % 2 == 0) {
          numbers[i] -= 1;
        } else {
          numbers[i] += 1;
          uniqueNumbers.insert(numbers[i]);
        }
      }
    }
    uniqueNumbers.erase(uniqueNumbers.begin());
  }
  for (int i = 0; i < N; i += 1) {
    if (i != 0) {
      printf(" ");
    }
    printf("%d", numbers[i]);
  }
  printf("\n");
  return 0;
}
