#include <bits/stdc++.h>
using namespace std;
vector<int> rep(vector<int>& y) {
  int x, yy, firstdec, firstdig, removed;
  for (int i = 0; i < y.size(); i++) {
    x = y[i] % 10;
    yy = (y[i] - x) / 10;
    if (yy == 0) {
      if (y[i] == 1) y[i] = 2;
      if (y[i] == 2) y[i] = 1;
      if (y[i] == 3) y[i] = 4;
      if (y[i] == 4) y[i] = 3;
      if (y[i] == 5) y[i] = 6;
      if (y[i] == 6) y[i] = 5;
      if (y[i] == 7) y[i] = 8;
      if (y[i] == 8) y[i] = 7;
      if (y[i] / 10 == 1 || y[i] / 10 == 10 || y[i] / 10 == 100 ||
          y[i] / 10 == 1000 || y[i] / 10 == 10000 || y[i] / 10 == 100000 ||
          y[i] / 10 == 1000000 || y[i] / 10 == 10000000 ||
          y[i] / 10 == 100000000)
        y[i] = y[i] - 1;
    } else if (yy >= 1) {
      if (x == 1) {
        y[i] = y[i] - x;
        y[i] = y[i] + 2;
        x = 2;
      }
      if (x == 2) {
        y[i] = y[i] - x;
        y[i] = y[i] + 1;
        x = 1;
      }
      if (x == 3) {
        y[i] = y[i] - x;
        y[i] = y[i] + 4;
        x = 4;
      }
      if (x == 4) {
        y[i] = y[i] - x;
        y[i] = y[i] + 3;
        x = 3;
      }
      if (x == 5) {
        y[i] = y[i] - x;
        y[i] = y[i] + 6;
        x = 6;
      }
      if (x == 6) {
        y[i] = y[i] - x;
        y[i] = y[i] + 5;
        x = 5;
      }
      if (x == 0) y[i] = y[i] - 1;
      if (x == 7) {
        y[i] = y[i] - x;
        y[i] = y[i] + 8;
        x = 8;
      }
      if (x == 8) {
        y[i] = y[i] - x;
        y[i] = y[i] + 7;
        x = 7;
      }
    }
  }
  return y;
}
int main() {
  int x;
  cin >> x;
  vector<int> y;
  vector<int> res;
  for (int i = 0; i < x; i++) {
    int temp;
    cin >> temp;
    y.push_back(temp);
  }
  res = rep(y);
  for (int i = 0; i < x; i++) {
    cout << y[i] << " ";
  }
  return 0;
}
