#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, s, d, f, g;
  long long A[1002];
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) {
      scanf("%lld", &A[i]);
    }
    for (int i = 0; i < n; i++) {
      a = A[i];
      if (a % 2) {
      } else {
        for (int j = 0; j < n; j++) {
          if (a == A[j]) {
            A[j] = a - 1;
          }
        }
      }
    }
    printf("%lld", A[0]);
    for (int i = 1; i < n; i++) {
      printf(" %lld", A[i]);
    }
    printf("\n");
  }
}
