Mishka got an integer array $a$ of length $n$ as a birthday present (what a surprise!).

Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps:  Replace each occurrence of $1$ in the array $a$ with $2$;  Replace each occurrence of $2$ in the array $a$ with $1$;  Replace each occurrence of $3$ in the array $a$ with $4$;  Replace each occurrence of $4$ in the array $a$ with $3$;  Replace each occurrence of $5$ in the array $a$ with $6$;  Replace each occurrence of $6$ in the array $a$ with $5$;  $\dots$  Replace each occurrence of $10^9 - 1$ in the array $a$ with $10^9$;  Replace each occurrence of $10^9$ in the array $a$ with $10^9 - 1$. 

Note that the dots in the middle of this algorithm mean that Mishka applies these replacements for each pair of adjacent integers ($2i - 1, 2i$) for each $i \in\{1, 2, \ldots, 5 \cdot 10^8\}$ as described above.

For example, for the array $a = [1, 2, 4, 5, 10]$, the following sequence of arrays represents the algorithm: 

$[1, 2, 4, 5, 10]$ $\rightarrow$ (replace all occurrences of $1$ with $2$) $\rightarrow$ $[2, 2, 4, 5, 10]$ $\rightarrow$ (replace all occurrences of $2$ with $1$) $\rightarrow$ $[1, 1, 4, 5, 10]$ $\rightarrow$ (replace all occurrences of $3$ with $4$) $\rightarrow$ $[1, 1, 4, 5, 10]$ $\rightarrow$ (replace all occurrences of $4$ with $3$) $\rightarrow$ $[1, 1, 3, 5, 10]$ $\rightarrow$ (replace all occurrences of $5$ with $6$) $\rightarrow$ $[1, 1, 3, 6, 10]$ $\rightarrow$ (replace all occurrences of $6$ with $5$) $\rightarrow$ $[1, 1, 3, 5, 10]$ $\rightarrow$ $\dots$ $\rightarrow$ $[1, 1, 3, 5, 10]$ $\rightarrow$ (replace all occurrences of $10$ with $9$) $\rightarrow$ $[1, 1, 3, 5, 9]$. The later steps of the algorithm do not change the array.

Mishka is very lazy and he doesn't want to apply these changes by himself. But he is very interested in their result. Help him find it.


-----Input-----

The first line of the input contains one integer number $n$ ($1 \le n \le 1000$) — the number of elements in Mishka's birthday present (surprisingly, an array).

The second line of the input contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^9$) — the elements of the array.


-----Output-----

Print $n$ integers — $b_1, b_2, \dots, b_n$, where $b_i$ is the final value of the $i$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $a$. Note that you cannot change the order of elements in the array.


-----Examples-----
Input
5
1 2 4 5 10

Output
1 1 3 5 9

Input
10
10000 10 50605065 1 5 89 5 999999999 60506056 1000000000

Output
9999 9 50605065 1 5 89 5 999999999 60506055 999999999



-----Note-----

The first example is described in the problem statement.

Difficulty: EASY

Solutions:
n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	if arr[i] % 2 == 0:
		arr[i] -= 1
print(*arr)


def solve(nums):
	return [x if x % 2 != 0 else x - 1 for x in nums]
n = input()
arr = list(map(int, input().split()))
print(*solve(arr))


n = int(input().strip())
elements = [int(x) for x in input().strip().split(' ')]
for i in range(n):
	if elements[i] % 2 == 0:
		elements[i] -= 1
for element in elements:
	print(element, end=' ')


n = input()
a = list(map(int, input().split()))
ans = [i + i % 2 - 1 for i in a]
for i in ans:
	print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
for i in a:
	if i % 2 == 0:
		i -= 1
	print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] % 2 == 0:
		a[i] -= 1
	else:
		pass
print(' '.join(map(str, a)))


n = int(input())
b = list(map(int, input().split()))
for i in range(len(b)):
	if b[i] % 2 == 0:
		b[i] -= 1
print(*b)


n = int(input())
print(' '.join(map(str, (x if x % 2 else x - 1 for x in map(int, input().split())))))


n = input()
x = input()
a = [int(z) for z in x.split()]
for i in range(0, len(a)):
	if a[i] % 2 == 0:
		a[i] = a[i] - 1
	print(a[i], end=' ')


n = int(input())
a = [int(x) for x in input().split()]
print(*[x - ((x ^ 1) & 1) for x in a])


n = int(input())
m = list(map(int, input().split()))
maxi = max(m)
if maxi & 1 == 1:
	for i in range(n):
		if m[i] & 1 == 0:
			m[i] = m[i] - 1
else:
	for i in range(n):
		if m[i] & 1 == 0:
			m[i] -= 1
		elif m[i] == maxi:
			m[i] -= 1
for i in m:
	print(str(i), end=' ')


n = input()
print(*list(map(lambda x: int(x) - (int(x) % 2 == 0), input().split())))


in1 = int(input())
in2 = input().split()
in2 = list(map(int, in2))
for i in range(in1):
	if in2[i] % 2 == 0:
		in2[i] = in2[i] - 1
	print(in2[i], end=' ')


input()
ls = [*map(int, input().split())]
for i in ls:
	if i % 2 == 0:
		print(i - 1, end=' ')
	else:
		print(i, end=' ')


n = int(input())
lis = list(map(int, input().split()))
for i in range(n):
	if lis[i] % 2 == 0:
		lis[i] = lis[i] - 1
for i in lis:
	print(i, end=' ')


n = int(input())
l = list(map(int, input().split()))
ln = []
for i in l:
	if i % 2 == 0:
		ln.append(i - 1)
	else:
		ln.append(i)
for i in ln:
	print(i, end=' ')


m = int(input())
s = list(map(int, input().split()))
y = []
for i in range(m):
	x = s[i]
	if x % 2 == 0:
		m = x - 1
		y.append(m)
	elif x % 2 == 1:
		y.append(x)
for i in range(len(y)):
	print(y[i], end=' ')


_ = int(input())
org_lis = [int(x) for x in input().split(' ')]
check_for = set()
for val in org_lis:
	if val % 2 == 0:
		check_for.add((val, val - 1))
		check_for.add((val - 1, val))
	else:
		check_for.add((val, val + 1))
		check_for.add((val + 1, val))
check_for = sorted(check_for)
for (n1, n2) in check_for:
	idx = 0
	while idx < len(org_lis):
		if org_lis[idx] == n1:
			org_lis[idx] = n2
		idx += 1
print(' '.join([str(x) for x in org_lis]))


n = int(input())
nums = [int(x) for x in input().split(' ')]
for i in range(len(nums)):
	if nums[i] % 2 == 0:
		nums[i] -= 1
print(*nums, sep=' ')


n = int(input())
x = [int(i) for i in input().split()]
x = [a - (1 - a % 2) for a in x]
for a in x:
	print(a, '', end='', flush=True)


n = int(input())
arr = list(map(int, input().split(' ')))
steps = sorted(arr)
for x in steps:
	if x % 2 == 0:
		for i in range(len(arr)):
			if arr[i] == x:
				arr[i] = x - 1
print(' '.join(map(str, arr)))


n = int(input())
l = list(map(int, input().split()))
for j in range(n):
	if l[j] % 2 == 0:
		print(l[j] - 1, end=' ')
	else:
		print(l[j], end=' ')
print()


n = int(input())
l = list(map(int, input().rstrip().split()))
print(*[i - 1 if i % 2 == 0 else i for i in l])


n = input()
l = list(map(int, input().split()))
print(' '.join((str(x - 1) if x % 2 == 0 else str(x) for x in l)))


n = int(input())
T = input().split(' ')
for i in range(n):
	T[i] = int(T[i])
for i in range(n - 1):
	if T[i] % 2 == 0:
		print(T[i] - 1, end=' ')
	else:
		print(T[i], end=' ')
if T[n - 1] % 2 == 0:
	print(T[n - 1] - 1)
else:
	print(T[n - 1])


def solve(n, ar):
	for i in range(n):
		if ar[i] % 2 == 0:
			ar[i] -= 1
		else:
			continue
	print(' '.join(map(str, ar)))
n = int(input())
ar = list(map(int, input().split()))
solve(n, ar)


n = int(input())
a = list(map(int, input().split()))
b = []
for i in a:
	if i % 2 == 0:
		b.append(int(i - 1))
	else:
		b.append(i)
for i in range(n):
	print(b[i], end=' ')


n = int(input())
x = [int(a) for a in input().split()]
for i in range(n):
	if not x[i] % 2:
		x[i] = x[i] - 1
for i in range(n):
	print(x[i], end=' ')


n = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	print(a[i] - (not a[i] & 1), end=' ')


import os
import sys
from io import BytesIO, IOBase
import math
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	if l[i] % 2 == 0:
		l[i] -= 1
print(*l, end=' ')


import sys
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
N = INT()
A = LIST()
for i in range(N):
	if A[i] % 2 == 0:
		A[i] -= 1
print(*A)


n = int(input())
print(' '.join(map(lambda _: str(_ - 1 if _ % 2 == 0 else _), map(int, input().split()))))


n = int(input())
a = [int(s) for s in input().split(' ')]
b = [str(c - (c + 1) % 2) for c in a]
print(' '.join(b))


a = input()
b = list(map(int, input().split()))
for i in range(len(b)):
	if b[i] % 2 == 0:
		b[i] -= 1
for i in b:
	print(i, end=' ')


n = int(input())
l = list(map(int, input().split()))
s = ''
for i in range(n):
	if l[i] % 2 == 0:
		s = s + ' ' + str(l[i] - 1)
	elif l[i] == n - 1:
		s = s + ' ' + str(l[i] + 1)
	else:
		s = s + ' ' + str(l[i])
print(s)


def solve():
	n = int(input())
	arr = [int(x) for x in input().split(' ')]
	for i in range(n):
		if arr[i] % 2 == 0:
			arr[i] -= 1
	for i in range(n - 1):
		print(arr[i], end=' ')
	print(arr[n - 1])
solve()


n = int(input())
a = input().split()
for i in range(n):
	a[i] = int(a[i])
for i in range(n):
	if a[i] % 2 == 0:
		a[i] -= 1
for i in a:
	print(i, end=' ')


input()
array = map(int, input().split())
modified_array = (n if n % 2 == 1 else n - 1 for n in array)
print(*modified_array)


n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	arr[i] = arr[i] - (not arr[i] % 2)
for x in arr:
	print(x, end=' ')


def main():
	array_length = int(input())
	array = [int(x) for x in input().split(' ')]
	for i in range(0, array_length):
		if array[i] % 2 == 0:
			array[i] -= 1
	for item in array:
		print(item, end=' ')
	print('')
main()


n = int(input())
A = list(map(int, input().split()))
for i in range(n):
	if A[i] % 2 == 0:
		A[i] -= 1
for elem in A:
	print(elem, end=' ')


def f(x):
	return x if x % 2 else x - 1
input()
print(' '.join((str(f(int(k))) for k in input().split())))


input()
l = list(map(int, input().split()))
for i in range(len(l)):
	q = 0
	if l[i] % 2 != 0:
		q = l[i]
	for j in range(len(l)):
		if l[j] == q:
			l[j] += 1
	else:
		q = l[i]
		for j in range(len(l)):
			if l[j] == q:
				l[j] -= 1
for i in l:
	print(i, end=' ')


n = int(input())
ar = list(map(int, input().split()))
for i in range(n):
	if ar[i] % 2 == 0:
		ar[i] -= 1
print(' '.join((str(i) for i in ar)))


noUse = int(input())
Nfilter = lambda x: x - 1 if x % 2 == 0 else x
for i in list(map(int, input().split())):
	print(Nfilter(i), end=' ')


from sys import stdin, stdout
from collections import defaultdict
import math
import copy
N = int(input())
arr = [int(x) for x in stdin.readline().split()]
ans = [0] * N
for i in range(N):
	if arr[i] % 2 == 0:
		ans[i] = arr[i] - 1
	else:
		ans[i] = arr[i]
print(*ans)


z = input
import math
n = int(input())
c = 1
l = list(map(int, z().split()))
p = []
for i in l:
	if i % 2 == 0:
		p.append(i - 1)
	else:
		p.append(i)
print(*p)


input()
a = [int(i) for i in input().split()]
for i in range(len(a)):
	a[i] -= (a[i] + 1) % 2
print(' '.join([str(i) for i in a]))


from sys import stdin, stdout
import cProfile, math
printHeap = str()
test = False

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def test_print(output):
	if test:
		stdout.write(str(output) + '\n')

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def get_int():
	return int(stdin.readline())

def get_tuple():
	return map(int, stdin.readline().split())

def get_str_list():
	return list(map(str, stdin.readline().split()))

def get_list():
	return list(map(int, stdin.readline().split()))
arguments = list()
results = list()

def clear_cache():
	global arguments, results
	(arguments, results) = (list(), list())

def cached_fn(fn, *args):
	global arguments, results
	if args in arguments:
		return results[arguments.index(args)]
	else:
		result = fn(*args)
		arguments.append(args)
		results.append(result)
		return result

def main():
	get_int()
	arr = get_list()
	for (i, ele) in enumerate(arr):
		if ele % 2 == 0:
			arr[i] = ele - 1
	display_list(arr, ' ')
cProfile.run('main()') if test else main()


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if not a[i] & 1:
		a[i] = a[i] - 1
print(*a)


t = int(input())
s = list(map(int, input().split()))
for i in s:
	if i % 2 == 0:
		for z in s:
			if z == i:
				ind = s.index(z)
				s[ind] -= 1
print(*s)


def mi():
	return map(int, input().split())
n = int(input())
a = list(mi())
for i in a:
	if i % 2:
		print(i, end=' ')
	else:
		print(i - 1, end=' ')


input()
for i in input().split(' '):
	print(str(int(i) - (int(i) + 1) % 2) + ' ', end='')


t = int(input())
l = list(map(int, input().split()))
for i in range(t):
	if l[i] % 2 == 0:
		l[i] = l[i] - 1
for i in l:
	print(i, end=' ')
print()


_ = int(input())
a = list(map(int, input().split()))
b = [x - 1 | 1 for x in a]
print(*b)


from math import *
n = int(input())
s = list(map(int, input().split()))
for i in range(n):
	if s[i] % 2 == 0:
		s[i] -= 1
print(*s)


n = int(input())
m = list(map(int, input().split()))
arr = []
for i in range(len(m)):
	if m[i] % 2 == 1:
		arr.append(m[i])
	elif m[i] % 2 == 0:
		arr.append(m[i] - 1)
for i in range(len(arr)):
	print(arr[i], end=' ')


t = int(input().strip(' '))
a = list(map(int, input().strip(' ').split(' ')))
for i in a:
	if i % 2 == 0:
		print(i - 1, end=' ')
	else:
		print(i, end=' ')
print()


n = int(input())
s = [int(i) for i in input().split()]
for i in range(n):
	if s[i] % 2 == 0:
		s[i] -= 1
print(' '.join(map(str, s)))


pocCis = int(input())
cisla = list(map(int, input().split()))
vysledok = []
for i in range(pocCis):
	if cisla[i] % 2 == 1:
		vysledok.append(cisla[i])
	else:
		vysledok.append(cisla[i] - 1)
for i in vysledok:
	print(i, end=' ')
print('')


n = int(input())
arr = [int(elem) for elem in input().split()]
for i in range(n):
	if arr[i] % 2 == 0:
		arr[i] -= 1
print(' '.join([str(elem) for elem in arr]))


input()
ans = map(lambda x: x - 1 if x % 2 is 0 else x, map(int, input().split()))
print(*ans)


a = input()
b = input().split()
for i in range(int(a)):
	b[i] = int(b[i])
	if b[i] % 2 == 0:
		b[i] -= 1
print(*b)


n = int(input())
l = list(map(int, input().split()))
for i in range(len(l)):
	if l[i] % 2 == 0:
		l[i] = l[i] - 1
for i in l:
	print(i, end=' ')


n = int(input())
nums = list(map(int, input().split()))
for i in range(n):
	if nums[i] % 2 == 0:
		print(nums[i] - 1, end=' ')
	else:
		print(nums[i], end=' ')


input()
a = [*map(int, input().split())]
for i in range(len(a)):
	if a[i] % 2:
		print(a[i], end=' ')
	else:
		print(a[i] - 1, end=' ')


input()
print(' '.join([str(int(k) - 1 + int(k) % 2) for k in input().split()]))


n = int(input().strip())
presents = [k for k in map(int, input().strip().split())]
results = []
for k in presents:
	if k % 2 == 0:
		results.append(str(k - 1))
	else:
		results.append(str(k))
print(' '.join(results))


n = int(input())
array = list(map(int, input().split()))
current = min(array)
while True:
	if current % 2 == 1:
		add = 1
	else:
		add = -1
	for x in range(n):
		if array[x] == current:
			array[x] += add
	minimum = float('inf')
	for x in range(n):
		if array[x] > current and array[x] < minimum:
			minimum = array[x]
	if minimum == float('inf'):
		break
	else:
		current = minimum
print(' '.join(map(str, array)))


n = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	a[i] = a[i] - 1 + a[i] % 2
for x in a:
	print(x, end=' ')


n = int(input())
a = list(map(int, input().split(' ')))
for i in range(n):
	a[i] = a[i] if a[i] % 2 == 1 else a[i] - 1
print(*a)


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	x = a[i]
	for j in range(n):
		if x == a[j]:
			if x % 2 == 0:
				a[i] -= 1
				x = a[i]
for i in range(n):
	print(a[i], end=' ')


n = int(input())
nums = input()
nums = nums.split(' ')
for i in nums:
	if int(i) % 2 == 0:
		print(int(i) - 1, end=' ')
	else:
		print(int(i), end=' ')


a = int(input())
b = input().split(' ')
for zam in b:
	zam = int(zam)
	if zam % 2 == 0:
		zam -= 1
	print(zam, end=' ')


def __starting_point():
	n = int(input().strip())
	arr = [int(__) for __ in input().strip().split()]
	for i in range(n):
		if arr[i] % 2 == 0:
			arr[i] -= 1
	for i in arr:
		print(i, end=' ')
__starting_point()


input()
num = list(map(int, input().split()))
ans = []
for i in num:
	ans.append(i if i & 1 else i - 1)
print(' '.join((str(i) for i in ans)))


N = int(input().strip())
A = list(map(int, input().strip().split()))
for i in range(N):
	if A[i] % 2 == 0:
		print(A[i] - 1, end='')
	else:
		print(A[i], end='')
	if i < N - 1:
		print(' ', end='')
print()


q = int(input())
w = list(map(int, input().split()))
for i in range(len(w)):
	if w[i] % 2 == 0:
		w[i] -= 1
print(*w)


from sys import stdin, stdout

def main():
	n = int(stdin.readline().strip())
	A = [int(num) for num in stdin.readline().strip().split()]
	output = []
	for num in A:
		if num % 2 != 0:
			output.append(str(num))
		else:
			output.append(str(num - 1))
	stdout.write(' '.join(output))
main()


def main():
	n = int(input())
	mylist = [int(x) for x in input().split()]
	for i in mylist:
		if i % 2 == 0:
			i = i - 1
		print(i, end=' ')
main()


n = int(input())
a = list(map(int, input().split()))
b = sorted(list(set([i - 1 for i in a] + a + [i + 1 for i in a])))
for i in range(len(b)):
	for j in range(len(a)):
		if a[j] == b[i]:
			if a[j] & 1:
				a[j] += 1
			else:
				a[j] -= 1
print(' '.join([str(i) for i in a]))


n = int(input())
l = [int(x) for x in input().split()]
for i in range(n):
	if l[i] % 2 == 0:
		l[i] -= 1
	print(l[i], end=' ')


import math
import itertools
getInputList = lambda : list(input().split())
getInputIntList = lambda : list(map(int, input().split()))
n = int(input())
arr = getInputIntList()
arrc = arr[:]
for i in arrc:
	if i % 2 != 0:
		arrc.append(i + 1)
arrc.sort()
for i in arrc:
	for j in range(len(arr)):
		if arr[j] == i:
			if arr[j] % 2 == 0:
				arr[j] -= 1
			else:
				arr[j] += 1
for i in arr:
	print(i, end=' ')


n = int(input())
a = list(map(int, input().strip().split()))
a = [str(x - 1 + x % 2) for x in a]
print(' '.join(a))


from collections import Counter
x = int(input())
x = list(map(int, input().split()))
s = ''
for i in x:
	if i % 2 == 0:
		s += str(i - 1) + ' '
	else:
		s += str(i) + ' '
print(s)


n = int(input())
s = list(map(int, input().split()))
for i in range(n):
	if not s[i] % 2:
		s[i] -= 1
for i in s:
	print(i, end=' ')


n = int(input())
a = [int(i) for i in input().split()]
for i in range(0, len(a)):
	if a[i] % 2 == 0:
		a[i] = a[i] - 1
	else:
		pass
print(*a)


N = int(input())
x = [0] * N
print(' '.join(map(str, [a - (1 - a % 2) for a in map(int, input().split())])))


a = input()
a = [int(x) for x in input().split()]
b = a.copy()
b.sort()
for x in b:
	for i in range(len(a)):
		if x & 1 == 0 and a[i] == x:
			a[i] -= 1
for x in a:
	print(x, end=' ')


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	N = Scanner.int()
	A = Scanner.map_int()
	A = [a if a % 2 == 1 else a - 1 for a in A]
	print(*A)
main()


lens = int(input())
l = [int(i) for i in input().split()]
x = max(l)
for i in range(lens):
	if l[i] % 2 == 0:
		l[i] -= 1
l = [str(i) for i in l]
print(' '.join(l))


def solve(arr):
	l = len(arr)
	ans = [None for _ in range(l)]
	for (i, c) in enumerate(arr):
		if arr[i] % 2 == 0:
			ans[i] = arr[i] - 1
		else:
			ans[i] = arr[i]
	return ' '.join(map(str, ans))

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(arr))
main()


n = int(input())
l = [int(i) for i in input().split()]
for i in range(n):
	if l[i] % 2 == 0:
		l[i] -= 1
print(' '.join((str(i) for i in l)))


input()
arr = list(map(int, input().split(' ')))
for item in arr:
	if item % 2 == 0:
		print(item - 1, end=' ')
	else:
		print(item, end=' ')


n = int(input())
array = list(map(int, input().split()))

def replace(array):
	for (i, num) in enumerate(array):
		if num % 2 == 0:
			array[i] -= 1
	print(' '.join(list(map(str, array))))
replace(array)


(n, a) = (input(), list(map(int, input().split())))
print(*[v if v % 2 else v - 1 for v in a])


n = int(input())
ls = [int(i) for i in input().split()]
for i in ls:
	if not i & 1:
		i -= 1
	print(i, end=' ')


n = int(input())
a = [*map(int, input().split())]
b = []
for e in a:
	if e % 2 == 0:
		b.append(e - 1)
	else:
		b.append(e)
print(*b, sep=' ')


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	for i in range(n):
		if arr[i] % 2 == 0:
			arr[i] -= 1
	print(*arr)
	return
main()


Length = int(input())
Numbers = list(map(int, input().split()))
for i in range(Length):
	if Numbers[i] % 2 == 0:
		Numbers[i] = Numbers[i] - 1
	else:
		continue
print(' '.join(list(map(str, Numbers))))


def Do(x):
	x = int(x)
	if x % 2 == 0:
		return str(x - 1)
	return str(x)
n = input()
List = list(map(Do, input().split()))
print(' '.join(List))


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
n = int(input())
a = list(map(int, sys.stdin.readline().split(' ')))
for i in range(n):
	if a[i] % 2 == 0:
		a[i] -= 1
print(*a)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


n = int(input())
numbers = input().split(' ')
for i in range(n):
	numbers[i] = int(numbers[i])
	if numbers[i] % 2 == 0:
		numbers[i] = numbers[i] - 1
print(' '.join((str(x) for x in numbers)))


input()
x = [int(i) for i in input().split()]
for i in x:
	if i % 2 == 0:
		i -= 1
	print(i, end=' ')


n = int(input())
array = list(map(int, input().split()))
if len(array) == n:
	res = [str(x - 1) if x % 2 == 0 else str(x) for x in array]
	print(' '.join(res))


N = int(input())
nums = [int(x) for x in input().split()]
for (index, num) in enumerate(nums):
	if num % 2 == 0:
		nums[index] = num - 1
print(' '.join([str(x) for x in nums]))


import sys
n = int(input())
lst = list(map(int, input().split()))
out = []
for idx in range(len(lst)):
	if lst[idx] % 2 == 0:
		sys.stdout.write(str(lst[idx] - 1) + ' ')
	else:
		sys.stdout.write(str(lst[idx]) + ' ')


c = int(input())
l = list(map(int, input().split()))
a = []
for i in l:
	if i % 2 == 0:
		a.append(i - 1)
	else:
		a.append(i)
print(*a)


n = int(input())
arr = [int(x) for x in input().split()]
for (ind, i) in enumerate(arr):
	if i % 2 == 0:
		arr[ind] = i - 1
for i in arr:
	print(i, end=' ')


n = int(input())
a = [int(x) if int(x) % 2 else int(x) - 1 for x in input().split()]
for x in a:
	print(x, end=' ')


number = int(input())
array = list(map(int, input().split()))
for m in range(number):
	if array[m - 1] % 2 == 0:
		array[m - 1] = array[m - 1] - 1
for m in array:
	print(m, end=' ')


n = int(input())
bir_present = list(map(int, input().split()))
for i in bir_present:
	if i % 2 == 0:
		i = i - 1
		print(i, end=' ')
	else:
		print(i, end=' ')


i = int(input())
x = list(map(int, input().split()))
for s in range(i):
	if x[s] % 2 == 0:
		x[s] = x[s] - 1
	else:
		x[s] = x[s]
print(*x, sep=' ')


n = int(input())
a = [int(n) for n in input().split()]
for e in a:
	print(e - 1 | 1, end=' ')


n = int(input())
a = [int(i) for i in input().split()][:n]
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] -= 1
print(' '.join([str(i) for i in a]))


n = int(input())

def lone(l):
	l = int(l)
	if l % 2 == 0:
		return l - 1
	return l
array = list(map(lone, input().split()))
for i in range(n):
	print(array[i], end=' ')


n = int(input())
a = [int(x) for x in input().split()]
b = a.copy()
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] = a[i] - 1
for j in a:
	print(j, end=' ')


n = int(input())
a = map(int, input().split())
print(' '.join((str(el - (el + 1) % 2) for el in a)))


_ = input()
present = list(map(int, input().split()))
output = [pressie if pressie % 2 == 1 else pressie - 1 for pressie in present]
print(' '.join((str(o) for o in output)))


x = int(input())
y = input().split(' ')
for i in y:
	y = list(map(int, y))
for i in y:
	if i % 2 == 0:
		y[y.index(i)] -= 1
	else:
		pass
print(*y)


a = int(input())
b = [int(x) for x in input().split()]
for i in range(len(b)):
	if b[i] % 2 == 0:
		print(b[i] - 1, end=' ')
	else:
		print(b[i], end=' ')


import math

def main():
	n = int(input())
	li = list(map(int, input().split()))
	for i in range(len(li)):
		if li[i] % 2 == 0:
			li[i] -= 1
	for i in li:
		print(i, end=' ')
	print()
main()


n = input()
for i in map(int, input().split()):
	print(i - 1 + i % 2, end=' ')


n = int(input())
a = list(map(int, input().split()))
a = list(map(lambda x: x + (x & 1) - 1, a))
print(*a)


n = int(input())
a = map(int, input().split(' '))
for elem in a:
	if elem % 2 == 0:
		print(elem - 1, end=' ')
	else:
		print(elem, end=' ')


inp = input()
lis = map(int, input().split(' '))
for m in lis:
	if m % 2 == 0:
		print(m - 1, end=' ')
	else:
		print(m, end=' ')


n = int(input())
f = [int(i) for i in input().split()]
for i in range(n):
	if f[i] % 2 == 0:
		f[i] -= 1
print(*f)


def red(x):
	x = int(x)
	if x % 2 == 0:
		return str(x - 1)
	else:
		return str(x)
n = int(input())
result = list(map(red, input().split()))
print(' '.join((x for x in result)))


N = int(input())
print(' '.join(map(str, [int(x) - 1 if int(x) % 2 == 0 else int(x) for x in input().split()])))


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	a[i] = 2 * ((a[i] - 1) // 2) + 1
print(' '.join(map(str, a)))


a = int(input())
b = list(map(int, input().split()))
for i in range(a):
	b[i] -= (b[i] + 1) % 2
print(*b)


def send(x):
	print(x)
	return x

def convert(x):
	if x % 2 == 0:
		return x - 1
	else:
		return x
times = int(input(''))
num = input('').split()
for i in range(1, times + 1):
	num[i - 1] = int(num[i - 1])
	num[i - 1] = convert(num[i - 1])
	num[i - 1] = str(num[i - 1])
result = ' '.join(num)
send(result)


input()
arr = list(map(int, input().split(' ')))
for i in range(len(arr)):
	if arr[i] == 1:
		continue
	arr[i] -= 1 - arr[i] % 2
print(' '.join(map(str, arr)))


input()
a = map(int, input().split())
print(*[x - 1 if x % 2 == 0 else x for x in a])


n = int(input())
l = list(map(int, input().split()))
for f in range(n):
	if l[f] % 2 == 0:
		l[f] -= 1
ans = ''
for f in l:
	ans += str(f) + ' '
print(ans)


n = int(input())
B = map(int, input().split())
print(*[b - (1 - b % 2) for b in B])


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
n = int(input())
li = get_list()
for i in li:
	if not i & 1:
		i -= 1
	printsp(i)


def adjacent_replacements(arr):
	for i in range(len(arr)):
		if arr[i] % 2 == 0:
			arr[i] -= 1
	print(*arr)
n = int(input())
arr = list(map(int, input().split()))
adjacent_replacements(arr)


input()
ls = [int(x) if int(x) & 1 else int(x) - 1 for x in input().split()]
print(*ls)


input()
print(*(x - 1 + x % 2 for x in map(int, input().split())))


n = int(input())
v = list(map(int, input().split()))
for i in v:
	print(i - (i % 2 == 0), end=' ')


N = int(input())
arr = [int(c) for c in input().split()]
for c in range(N):
	if arr[c] % 2 == 0:
		arr[c] = str(arr[c] - 1)
	else:
		arr[c] = str(arr[c])
print(' '.join(arr))


def mishka_algo():
	new_l = []
	for ele in arr:
		if ele % 2 == 0:
			print(ele - 1, end=' ')
		else:
			print(ele, end=' ')
n = int(input())
arr = list(map(int, input().split()))
mishka_algo()


def calc(a):
	for i in range(len(a)):
		item = a[i]
		if item % 2 == 0:
			a[i] = item - 1
	return [str(i) for i in a]

def get_ints():
	return [int(n) for n in input().split()]

def get_floats():
	return [float(n) for n in input().split()]
a = get_ints()
assert len(a) == 1
n = a[0]
a = get_ints()
assert len(a) == n
res = calc(a)
print(' '.join(res))


def replace(x, n, a):
	for i in range(len(a)):
		if a[i] == x:
			a[i] = n
n = int(input())
a = list(map(int, input().split()))
b = a
for i in b:
	if i % 2 == 0:
		replace(i - 1, i, a)
		replace(i, i - 1, a)
	else:
		replace(i, i + 1, a)
		replace(i + 1, i, a)
for i in range(len(a)):
	print(a[i], end=' ')


n = int(input())
a = [int(i) for i in input().split()]
for elem in a:
	print(elem - 1 + elem % 2, end=' ')


n = int(input())
l = input().split()
l = list(map(int, l))
for i in range(len(l)):
	if l[i] % 2 == 0:
		l[i] = l[i] - 1
a = map(str, l)
result = ' '.join(a)
print(result)


import sys
n = int(sys.stdin.readline())
a = [int(i) for i in sys.stdin.readline().split()]
assert n == len(a)
print(' '.join([str(x if x % 2 else x - 1) for x in a]))


import sys
n = int(sys.stdin.readline())
array = sys.stdin.readline().split()[:n]
array = [int(tmp) - (int(tmp) + 1) % 2 for tmp in array]
print(*array)


def main():
	a = input()
	p = [int(i) for i in input().split()]
	r = []
	for e in p:
		if e % 2 == 0:
			r.append(e - 1)
		else:
			r.append(e)
	print(' '.join(map(str, r)))
main()


n = int(input())
L = list(map(int, input().split()))
for a in range(n):
	if L[a] % 2 != 0:
		L[a] += 1
for a in range(n):
	if L[a] % 2 == 0:
		L[a] -= 1
print(' '.join(map(str, L)))


from math import fmod as mod
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if mod(a[i], 2) == 0:
		a[i] -= 1
for val in a:
	print(val, end=' ')


a = int(input())
f = ' '
b = list(map(int, input().split()))
g = ''
for i in range(len(b)):
	if b[i] % 2 == 0:
		b[i] = b[i] - 1
for i in b:
	g = g + str(i)
	g = g + f
print(g)


n = int(input())
a = [int(x) for x in input().split()]
for c in a:
	if c % 2 == 0:
		c -= 1
	print(c, end=' ')
print('')


a = int(input())
li = list(map(int, input().split()))
for i in range(a):
	if li[i] % 2 == 1:
		pass
	else:
		li[i] -= 1
for i in li:
	print(i, end=' ')


input()
print(' '.join(map(lambda x: str((int(x) + 1) // 2 * 2 - 1), input().split())))


t = int(input())
L = [int(x) for x in input().split()]
for i in L:
	print(i if i % 2 == 1 else i - 1, end=' ')


c = input()
y = list(map(int, input().split()))
win = ''
for x in y:
	if x % 2 == 1:
		win = win + str(x) + ' '
	else:
		win = win + str(x - 1) + ' '
print(win)


size = int(input())
arr = list(map(int, input().split()))
for i in range(size):
	if arr[i] % 2 == 0:
		arr[i] -= 1
for element in arr:
	print(element, end=' ')


n = int(input())
a = list(map(int, input().split()))
for (m, element) in enumerate(a):
	if element % 2 == 0:
		a[m] -= 1
a = ' '.join(map(str, a))
print(a)


def swapper(a: list, i: int) -> list:
	if i % 2 == 1:
		for j in range(len(a)):
			if a[j] == i:
				a[j] += 1
		for j in range(len(a)):
			if a[j] == i + 1:
				a[j] -= 1
	else:
		for j in range(len(a)):
			if a[j] == i:
				a[j] -= 1
		return a

def main():
	n = int(input())
	a = list(map(int, input().split()))
	z = set(sorted(a))
	q = 0
	for i in z:
		if i in a:
			q = swapper(a, i)
	return print(*a)
main()


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : [int(i) for i in inp().split()]
li0 = lambda x: [0 for i in range(x)]
stent = lambda : [i for i in inp()]
n = iinp()
res = [int(i) if int(i) % 2 != 0 else int(i) - 1 for i in inp().split()]
print(*res)


n = int(input())
ls = list(map(int, input().split()))
for i in ls:
	if i % 2:
		print(i, end=' ')
	else:
		print(i - 1, end=' ')
print()


n = int(input())
a = list(map(int, input().strip().split()))[:n]
for i in range(n):
	if a[i] % 2 == 0:
		a[i] -= 1
print(*a)


n = int(input())
s = list(map(int, input().split()))
for i in range(n):
	if s[i] % 2 == 0:
		s[i] -= 1
st = ''
for i in s:
	st += str(i) + ' '
print(st)


n = int(input())
a = list(map(int, input().split()))
for (i, ai) in enumerate(a):
	if ai % 2 == 0:
		a[i] = ai - 1
print(' '.join(map(str, a)))


input()
print(*map(lambda x: x if x % 2 == 1 else x - 1, [int(x) for x in input().split()]))


input()
arr = list(map(int, input().split()))
print(*(e if e % 2 else e - 1 for e in arr))


n = int(input())
li = list(map(int, input().strip().split()))
for i in range(n):
	if li[i] % 2 == 0:
		li[i] = li[i] - 1
	else:
		pass
for i in li:
	print(i, end=' ')


n = int(input())
pop = list(map(int, input().split()))
tam = []
for item in pop:
	if item not in tam:
		tam.append(item)
	else:
		pass
for item in tam:
	if item % 2 == 0:
		ja = pop.count(item)
		for x in range(ja):
			na = pop.index(item)
			pop[na] = item - 1
	else:
		kam = pop.count(item + 1)
		for x in range(kam):
			nap = pop.index(item + 1)
			pop[nap] = item
print(*pop)


n = int(input())
l = list(map(int, input().split()))
ans = []
for (i, x) in enumerate(l):
	if x & 1:
		ans.append(x)
	else:
		ans.append(x - 1)
print(*ans)


def inversion(a):
	if a % 2 == 1:
		return a + 1
	else:
		return a - 1
a = ''
termes = int(input(''))
cadeau = input('').split(' ')
cadeau2 = [int(i) for i in cadeau]
maxi = max(cadeau2)
cadeau3 = []
for i in cadeau2:
	cadeau3.append(i)
	cadeau3.append(inversion(i))
cadeau3.sort()
for j in cadeau3:
	for i in range(termes):
		if cadeau2[i] == j:
			cadeau2[i] = inversion(cadeau2[i])
for i in cadeau2:
	a += str(i)
	a += ' '
print(a)


mmmmmm = int(input())
a = input() + ' '
b = ''
A = []
for j in range(len(a)):
	if a[j] == ' ':
		A.append(int(b))
		b = ''
	else:
		b += a[j]
for i in range(len(A)):
	if A[i] % 2 == 0:
		A[i] -= 1
print(*A)


n = int(input())
A = [int(item) for item in input().split()]
for i in range(n):
	if A[i] % 2 == 0:
		A[i] -= 1
	if i == n - 1:
		print(A[i])
	else:
		print(A[i], end=' ')


n = int(input())
a = list(map(int, input().split()))
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] = a[i] - 1
s = ''
for elem in a:
	s += str(elem) + ' '
print(s)


r = lambda : list(map(int, input().split()))
n = r()[0]
a = r()
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] -= 1
	print(a[i], end=' ')


_ = input()
array = [int(item) for item in input().split()]
result = ''
for number in array:
	if number % 2 == 0:
		number -= 1
	result += str(number) + ' '
print(result)


k = int(input())
a = list(map(int, input().split()))
for i in range(k):
	if a[i] % 2 == 0:
		a[i] -= 1
print(*a)


def mishka(array):
	output = ''
	for num in array:
		if num % 2 == 0:
			output += str(num - 1) + ' '
		else:
			output += str(num) + ' '
	return output
n = int(input())
array = [int(x) for x in input().split()]
print(mishka(array))


n = int(input())
arr = list(map(int, input().split()))
ans = []
for i in arr:
	if i % 2 == 0:
		ans.append(i - 1)
	else:
		ans.append(i)
print(*ans, sep=' ')


input()
print(' '.join(map(lambda x: str(int(x) - (int(x) % 2 == 0)), input().split())))


n = int(input())
arr = [int(i) for i in input().split(' ')]
for i in range(len(arr)):
	if arr[i] % 2 == 0:
		arr[i] = arr[i] - 1
for i in range(len(arr)):
	print(arr[i], end=' ')


n = int(input())
l = [int(i) for i in input().split()]
for i in l:
	if i & 1:
		print(i, end=' ')
	else:
		print(i - 1, end=' ')


n = int(input())
lst = [int(x) for x in input().split()]
for i in range(len(lst)):
	if lst[i] % 2 == 0:
		lst[i] -= 1
lst = [str(x) for x in lst]
print(' '.join(lst))


_ = input()
arr = list(map(int, input().split()))
output = []
for elem in arr:
	output.append(elem if elem % 2 == 1 else elem - 1)
print(*output)


n = int(input())
a = [int(i) - (int(i) % 2 == 0) for i in input().split()]
print(' '.join(map(str, a)))


n = int(input())
a = list(map(int, input().split(' ')))
res = []
for x in a:
	if x % 2 == 0:
		res.append(x - 1)
	else:
		res.append(x)
print(*res)


input()
a = map(int, input().split())
b = ((x + 1) // 2 * 2 - 1 for x in a)
print(*b)


n = int(input())
l = list(map(int, input().split()))
for x in range(n):
	if l[x] % 2 == 0:
		l[x] -= 1
	print(l[x], end=' ')


from sys import stdin, stdout

def rint():
	return map(int, stdin.readline().split())
n = int(input())
a = list(rint())
for i in range(n):
	if a[i] % 2 is 0:
		a[i] = a[i] - 1
print(*a)


from sys import stdin, stdout
input = lambda : stdin.readline().rstrip()
write = stdout.write

def main():
	N = int(input())
	A = tuple(map(int, input().split()))
	a = [0] * N
	for (i, v) in enumerate(A):
		if v % 2:
			a[i] = v
		else:
			a[i] = v - 1
	print(*a)
main()


N = int(input())
WTF = list(map(int, input().split()))
SORTED = WTF.copy()
SORTED.sort()
_ = 0
T = SORTED[_]
mx = len(SORTED) - 1
while True:
	if T % 2 != 0:
		for __ in range(N):
			if WTF[__] == T:
				WTF[__] = T + 1
		T += 1
		for __ in range(N):
			if WTF[__] == T:
				WTF[__] = T - 1
	else:
		for __ in range(N):
			if WTF[__] == T:
				WTF[__] = T - 1
	_ += 1
	if _ > mx:
		print(*WTF)
		exit()
	T = SORTED[_]


a = int(input())
x = list(map(int, input().split()))
for i in x:
	if i % 2 == 0:
		print(i - 1, end=' ')
	else:
		print(i, end=' ')
print()


input()
print(*[int(p) + int(p) % 2 - 1 for p in input().split()])


no = int(input())
value = list(map(int, input().split()))
res = [0] * no
for i in range(no):
	res[i] = value[i] - (not value[i] % 2)
res = []
for i in range(no):
	if value[i] % 2 == 0:
		res.append(value[i] - 1)
	else:
		res.append(value[i])
for i in res:
	print(i, end=' ')


from sys import stdin
n = int(stdin.readline())
nums = list(map(int, stdin.readline().rstrip().split(' ')))
for (i, e) in enumerate(nums):
	if e > 1 and e % 2 == 0:
		nums[i] -= 1
for num in nums:
	print('{} '.format(num), end='')


n = input()
l = list(map(int, input().split()))
s = set(l)
for i in s:
	if i % 2 == 0:
		for j in range(len(l)):
			if l[j] == i:
				l[j] = i - 1
print(' '.join([str(i) for i in l]))


n = int(input())
a = [int(i) for i in input().split()]
t = sorted(list(map(lambda x: x + 1, a)) + a + list(map(lambda x: x - 1, a)))
for j in t:
	if j in a:
		indices = [i for (i, x) in enumerate(a) if x == j]
		if j % 2:
			for i in indices:
				a[i] += 1
		else:
			for i in indices:
				a[i] -= 1
for i in a:
	print(i, end=' ')


input()
a = [*map(lambda x: x if x % 2 != 0 else x - 1, map(int, input().split()))]
print(*a)


n = int(input())
lst = [int(x) for x in input().split()]
for no in range(len(lst)):
	if lst[no] % 2 == 0:
		lst[no] -= 1
for i in lst:
	print(i, end=' ')


n = int(input())
lst = [int(x) for x in input().split()]
for (i, v) in enumerate(lst):
	if v % 2 == 0:
		lst[i] = v - 1
lst = [str(x) for x in lst]
print(' '.join(lst))


def go():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	for i in range(n):
		if a[i] % 2 == 0:
			a[i] -= 1
	return ' '.join((str(i) for i in a))
print(go())


input()
s = list(map(int, input().split(' ')))
for x in s:
	if x % 2 == 0:
		x -= 1
	print(x, end=' ')


n = int(input())
print(*map(lambda x: int(x) + (int(x) & 1) - 1, input().split()))


a = int(input())
b = list(map(int, input().split()))
for x in range(a):
	if b[x] % 2 != 0:
		b[x] = b[x]
	else:
		b[x] -= 1
	print(b[x], end=' ')


n = int(input())
n1 = list(map(int, input().split()[:n]))
lst = []
for i in n1:
	if i % 2 == 0:
		lst.append(i - 1)
	else:
		lst.append(i)
for j in lst:
	print(j, end=' ')


N = int(input())
A = [int(i) for i in input().split()]
for i in range(N):
	if A[i] & 1 == 0:
		A[i] -= 1
print(*A)


_ = input()
values = [int(x) for x in input().split()]
result = [x if x % 2 else x - 1 for x in values]
print(' '.join((str(x) for x in result)))


length = int(input())
numbers = input().split(' ')
numbers = map(int, numbers)
numbers = map(lambda i: i - 1 if i % 2 == 0 else i, numbers)
print(' '.join(map(str, numbers)))


n = int(input())
a = list(map(int, input().split()))
import array as ar
b = ar.array('l', a)
for i in range(n):
	if b[i] % 2 != 0:
		b[i] = b[i] + 1
	if b[i] % 2 == 0:
		b[i] = b[i] - 1
b = list(b)
for i in b:
	print(i, end=' ')


n = int(input())
q = [int(x) for x in input().split()]
for i in range(n):
	if q[i] % 2 == 0:
		q[i] -= 1
print(' '.join(map(str, q)))


n = int(input())
array = [int(x) for x in input().split()]
out_array = [0] * n
for i in range(n):
	out_array[i] = array[i] - 1 if array[i] % 2 == 0 else array[i]
print(*out_array)


def f(x: int) -> int:
	if x % 2 == 0:
		x -= 1
	return x
n = int(input())
a = [int(x) for x in input().split()]
b = [f(x) for x in a]
print(' '.join(map(str, b)))


z = input
mod = 10 ** 9 + 7
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0:
			return 0
	return 1
n = int(z())
l = list(map(int, z().split()))
for i in range(n):
	if l[i] % 2 == 0:
		l[i] -= 1
print(*l)


import sys

class array:

	def __init__(self, arr):
		self.arr = arr

	def cal(self):
		for i in range(len(self.arr)):
			if self.arr[i] % 2 == 0:
				self.arr[i] -= 1
		print(*self.arr, sep=' ')

def main():
	n = sys.stdin.readline()
	arr = [int(x) for x in sys.stdin.readline().split()]
	t = array(arr)
	t.cal()
	return
main()


a = int(input())
s = [int(x) for x in input().split()]
for i in s:
	print(i - abs(1 - (i - i // 2 * 2)), end=' ')


n = int(input())
nums = list(map(int, input().split()))

def toOdd(x):
	if x % 2 == 1:
		return x
	else:
		return x - 1
print(*map(toOdd, nums))


n = int(input())
ls = []
ls = [int(x) for x in input().split()]
for l in ls:
	if l % 2 == 1:
		print(l, end=' ')
	else:
		print(l - 1, end=' ')


n = int(input())

def trans(x: str) -> str:
	num = int(x)
	return str(num) if num % 2 == 1 else str(num - 1)
res = [*map(trans, input().split())]
print(' '.join(res))


import sys
from collections import defaultdict
import math
lines = [line.strip() for line in sys.stdin.readlines()]
n = int(lines[0].split(' ')[0])
a = list(map(int, lines[1].split(' ')))
for i in sorted([x + 1 for x in a] + [x - 1 for x in a if x - 1 >= 1] + a):
	for (idx, elem) in enumerate(a):
		if elem == i:
			if elem % 2 == 0:
				a[idx] -= 1
			else:
				a[idx] += 1
print(' '.join(map(str, a)))


input()
nums = map(int, str(input()).split(' '))
print(' '.join(map(str, map(lambda x: x if x % 2 == 1 else x - 1, nums))))


n = int(input())
a = [int(x) for x in input().split()]
b = set()
for x in a:
	if x % 2 == 0:
		b.add(x)
		b.add(x - 1)
	else:
		b.add(x)
		b.add(x + 1)
for k in sorted(list(b)):
	for i in range(n):
		if a[i] == k:
			if k % 2 == 0:
				a[i] -= 1
			else:
				a[i] += 1
print(*a)


pocetcisel = input()
pocetcisel = int(pocetcisel)
cisla = list(map(int, input().split()))
for i in range(pocetcisel):
	if cisla[i] % 2 == 0:
		print(cisla[i] - 1, end=' ')
	else:
		print(cisla[i], end=' ')
print()


a = input()
x = [int(x) for x in input().split()]
r = ''
for i in x:
	if i % 2 == 0:
		i = i - 1
		r += str(i) + ' '
	else:
		r += str(i) + ' '
print(r)


a = int(input())
o = [int(x) for x in input().split()]
for i in range(0, len(o)):
	if o[i] % 2 == 0:
		o[i] = o[i] - 1
	print(o[i], end=' ')


size = int(input())
list = input()
list = list.split()
newlist = []
counter = 0
while counter < size:
	newlist.append(int(list[counter]))
	counter += 1
counter = 0
while counter < size:
	for i in range(size):
		if newlist[i] % 2 == 1:
			newlist[i] += 1
	for i in range(size):
		if newlist[i] % 2 == 0:
			newlist[i] -= 1
	counter += 1
newlist = str(newlist)
final = newlist[1:-1]
print(final.replace(',', ''))


n = int(input())
temp = input().split(' ')
lst = []
for i in temp:
	lst.append(int(i))
max_ = max(lst)
a = 0
for i in range(len(lst)):
	if lst[i] % 2 == 1:
		lst[i] = lst[i]
	else:
		lst[i] = lst[i] - 1
new_lst = []
for i in lst:
	new_lst.append(str(i))
print(' '.join(new_lst))


n = int(input())
a = list(map(int, input().split()))
for i in a:
	if i % 2 == 0:
		for j in range(0, len(a)):
			if i == a[j]:
				a[j] = a[j] - 1
	elif i % 2 != 0 and i != max(a):
		for j in range(0, len(a)):
			if i == a[j]:
				a[j] = a[j]
print(*a)


input()
l = []
for w in input().split():
	n = int(w)
	l.append(n + n % 2 - 1)
print(*l)


input()
(*a,) = map(int, input().split())
print(*[i if i % 2 else i - 1 for i in a])


n = int(input())
print(*[int(i) + int(i) % 2 - 1 for i in input().split()])


n = int(input())
li = list(map(int, input().split()))
li = [x - 1 if x % 2 == 0 else x for x in li]
for x in li:
	print(x, end=' ')


n = int(input())
array = [int(c) for c in input().split()]
for i in range(n):
	if array[i] % 2 == 0:
		array[i] -= 1
print(' '.join([str(i) for i in array]))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = LI()
	for i in range(n):
		if l[i] % 2 == 0:
			l[i] -= 1
	return ' '.join([str(x) for x in l])
print(main())


n = int(input())
a = []
string = input().split(' ')
for i in range(n):
	c = int(string[i])
	if c % 2 == 0:
		c = c - 1
	a.append(c)
for elem in a:
	print(elem, end=' ')


import os
import sys
leng = int(input())
arr = list(map(int, input().split()))
for x in arr:
	if x % 2 == 0:
		arr[arr.index(x)] = x - 1
		x = x - 1
	print(x, end=' ')


class CodeforcesTask1006ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.sequence = []

	def read_input(self):
		self.n = int(input())
		self.sequence = [int(x) for x in input().split(' ')]

	def process_task(self):
		result = [(x - 1) // 2 * 2 + 1 for x in self.sequence]
		self.result = ' '.join([str(x) for x in result])

	def get_result(self):
		return self.result
Solution = CodeforcesTask1006ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
for j in input().split():
	i = int(j)
	if i % 2 == 0:
		i -= 1
	print(i, end=' ')
print()


def m(n):
	return int(n) - (int(n) - 1) % 2
n = int(input())
print(*list(map(m, input().split())))


input()
print(*[x - [0, 1][x % 2 == 0] for x in [int(y) for y in input().split()]])


n = int(input())
L = [int(e) for e in input().split(' ')]
for k in range(n):
	if L[k] % 2:
		print(L[k], end=' ')
	else:
		print(L[k] - 1, end=' ')
print()


noe = int(input())
arr = [int(x) for x in input().split()]
for (i, v) in enumerate(arr):
	if v % 2 == 0:
		arr[i] -= 1
print(*arr)


a = int(input())
b = map(int, input().split())
for i in b:
	print(i - 1 + i % 2, end=' ')


def solution(a):
	ans = list()
	for i in a:
		ans.append(i if i % 2 != 0 else i - 1)
	return ans
n = int(input())
a = list(map(int, input().split()))
a = solution(a)
for i in a:
	print(i, end=' ')


n = int(input())
arr = [int(x) for x in input().split()]
for val in arr:
	if val % 2 == 0:
		print(val - 1, end=' ')
	else:
		print(val, end=' ')


input()
print(*map(lambda x: int(x) + int(x) % 2 - 1, input().split()))


n = int(input())
l = [int(e) for e in input().split(' ')]
i = 0
while i < len(l):
	if l[i] % 2 == 0:
		l[i] = l[i] - 1
	i += 1
for j in l:
	print(j, end=' ')


n = int(input())
A = list(map(int, input().split()))
m = []
for i in range(len(A)):
	if A[i] % 2 == 0:
		A[i] -= 1
for i in range(len(A)):
	m.append(str(A[i]))
print(' '.join(m))


n = int(input())
l = [int(x) for x in input().split()]
ans = ''
for i in l:
	if i % 2 == 0:
		ans += str(i - 1)
		ans += ' '
	else:
		ans += str(i)
		ans += ' '
print(ans)


a = int(input())
b = list(map(int, input().split()))
for i in range(a):
	if b[i] == 1:
		pass
	elif b[i] == 2:
		b[i] -= 1
	elif b[i] % 2 == 0:
		b[i] -= 1
	else:
		pass
for j in range(a):
	print(int(b[j]), end=' ')


import itertools
a = int(input())
l = [int(x) for x in input().split()]
for i in l:
	if i % 2 == 0:
		i = i - 1
	print(i, end=' ')


k = int(input())
a = [int(x) for x in input().split()]
for i in range(k):
	if a[i] % 2 == 0:
		a[i] -= 1
for i in range(k):
	print(a[i], end=' ')


n = int(input())
nlist = list(map(int, input().split()))
for (i, item) in enumerate(nlist):
	if item % 2 == 0:
		nlist[i] -= 1
print(' '.join(map(str, nlist)))


input()
print(' '.join((str(x - 1 + x % 2) for x in map(int, input().split()))))


n = input()
arr = [int(i) for i in input().split()]
print(*(i - 1 if i % 2 == 0 else i for i in arr))


from __future__ import print_function
import sys
import math
import os.path
import random
from copy import deepcopy
from functools import reduce
from collections import Counter, ChainMap, defaultdict
from itertools import cycle, chain
from queue import Queue, PriorityQueue
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, nlargest, nsmallest
import bisect
from statistics import mean, mode, median, median_low, median_high
sys.setrecursionlimit(10 ** 9)

def log(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def ni():
	return map(int, input().split())

def nio(offset):
	return map(lambda x: int(x) + offset, input().split())

def nia():
	return list(map(int, input().split()))

def toString(aList, sep=' '):
	return sep.join((str(x) for x in aList))

def toMapInvertIndex(aList):
	return {k: v for (v, k) in enumerate(aList)}

def sortId(arr):
	return sorted(range(len(arr)), key=lambda k: arr[k])
(n,) = ni()
a = [x - (x + 1) % 2 for x in nia()]
print(toString(a))


n = int(input())
a = input().split()
b = []
for i in range(len(a)):
	p = int(a[i])
	if p % 2 == 1:
		b.append(p)
	if p % 2 == 0:
		p = p - 1
		b.append(p)
	print(b[i], end=' ')


def main():
	import sys
	l = int(sys.stdin.readline())
	nums = [int(x) for x in sys.stdin.readline().strip('\n').split(' ')]
	for (ix, x) in enumerate(nums):
		if x % 2 == 0:
			nums[ix] -= 1
	print(*nums)
main()


n = int(input())
a = input()
a = a.split()
m = [int(i) for i in a]
k = []
for i in range(0, len(m)):
	if m[i] % 2 == 0:
		k = k + [m[i] - 1]
	else:
		k = k + [m[i]]
o = [str(i) for i in k]
l = ' '.join(o)
print(l)


n = int(input())
present = list(map(int, input().split()))
for i in present:
	if i & 1 != 1:
		print(i - 1, end=' ')
	else:
		print(i, end=' ')


n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	if arr[i] & 1:
		continue
	else:
		arr[i] -= 1
print(*arr)


num = int(input())
lst = list(map(int, input().split()))
for i in range(len(lst)):
	if lst[i] % 2 == 0:
		lst[i] = lst[i] - 1
for i in lst:
	print(i, end=' ')


def solve(test):
	ans = 1
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(n):
		print(a[i] if a[i] % 2 > 0 else a[i] - 1, end=' ')
t = 1
for _ in range(t):
	solve(_ + 1)


x = int(input())
a = list(map(int, input().split(' ')))
y = []
for i in range(len(a)):
	if a[i] % 2 != 0:
		y.append(a[i])
	else:
		y.append(a[i] - 1)
for i in range(len(y)):
	print(y[i], end=' ')


n = int(input())
p = list(map(int, input().split()))
w = list(p)
w.sort()
for i in w:
	for j in range(n):
		if i % 2 == 0 and p[j] == i:
			p[j] -= 1
		elif i % 2 != 0 and p[j] == i:
			pass
for i in p:
	print(i, end=' ')


import sys

def replace(ls, num1, num2):
	for item in ls:
		if item == num1:
			ls[ls.index(item)] = num2
	return ls
Var1 = int(sys.stdin.readline())
var2 = sys.stdin.readline()
tmp = []
for x in var2.split(' '):
	tmp.append(int(x))
for x in tmp:
	if x % 2 == 0:
		tmp[tmp.index(x)] = x - 1
print(tmp[0], end='')
for x in range(1, len(tmp)):
	print('', tmp[x], end='')
print()


import sys
import math
import bisect

def main():
	n = int(input())
	A = list(map(int, input().split()))
	for i in range(n):
		if A[i] % 2 == 0:
			A[i] -= 1
	print(' '.join(list((str(a) for a in A))))
main()


n = int(input())
a = [int(x) for x in input().split()]
for (i, num) in enumerate(a):
	if num % 2 == 0:
		print(num - 1, end=' ')
	else:
		print(num, end=' ')


def go(s):
	for i in range(len(s)):
		if not s[i] & 1:
			s[i] -= 1
	return s
n = input()
s = list(map(int, input().strip().split(' ')))
s = go(s)
for elem in s:
	print(elem, end=' ')


n = int(input())
for a in input().split():
	a = int(a)
	a = (a - 1) // 2 * 2 + 1
	print(a, end=' ')


def func1(a):
	arr = a
	for i in range(len(a)):
		if arr[i] % 2 == 1:
			arr[i] += 1
	return arr

def func2(a):
	arr = a
	for i in range(len(a)):
		if arr[i] % 2 == 0:
			arr[i] -= 1
	return arr
n = int(input())
st = input()
a = []
for i in range(n):
	a.append(int(st.split()[i]))
a = func1(a)
a = func2(a)
for i in range(len(a)):
	print(a[i], end=' ')


__author__ = 'Md. Imrul Hasan @UAP-CSE'

def func(n, arr):
	for i in range(0, n):
		if arr[i] % 2 == 0:
			arr[i] -= 1
	return ' '.join((str(_) for _ in arr))
n = int(input())
arr = list(map(int, input().split(' ')))
print(func(n, arr))


input()
a = [int(x) for x in input().split()]
result = [str(x) if x % 2 == 1 else str(x - 1) for x in a]
print(' '.join(result))


n = int(input())
arr = [int(x) for x in input().split()]
for i in range(n):
	if not arr[i] % 2:
		arr[i] = str(arr[i] - 1)
	else:
		arr[i] = str(arr[i])
print(' '.join(arr))


n = int(input())
tab = list(map(int, input().split()))
for i in range(n):
	if tab[i] % 2 == 1:
		print(tab[i], end=' ')
	else:
		print(tab[i] - 1, end=' ')


n = int(input())
s = [int(i) for i in input().split()]
s1 = s[:]
s1 += [i - 1 if i % 2 == 0 else i + 1 for i in s]
s1 = sorted(list(set(s1)))
for i in range(len(s1)):
	if s1[i] % 2 != 0:
		p = s1[i] + 1
	else:
		p = s1[i] - 1
	for j in range(n):
		if s[j] == s1[i]:
			s[j] = p
print(' '.join(list(map(str, s))))


n = int(input())
a = list(map(int, input().strip().split(' ')))
st = set()
for i in a:
	if i % 2 != 0:
		st.add(i + 1)
	st.add(i)
b = []
for i in st:
	b.append(i)
b.sort()
for i in b:
	for j in range(n):
		if i % 2 == 0:
			if a[j] == i:
				a[j] = i - 1
		elif a[j] == i:
			a[j] = i + 1
ot = ''
for i in range(n):
	ot += str(a[i]) + ' '
print(ot)


n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	if arr[i] & 1 != 1:
		arr[i] -= 1
for num in arr:
	print(num, end=' ')


n = input()
inp = input()
lis = inp.split(' ')
for i in range(len(lis)):
	lis[i] = int(lis[i])
for i in range(int(n)):
	if lis[i] % 2 == 0:
		lis[i] = lis[i] - 1
for i in range(int(n)):
	print(lis[i], end=' ')
print('\n')


def sint():
	return int(input())

def sints():
	return map(int, input().split())

def sara():
	return list(map(int, input().split()))

def sstr():
	s = input()
	return list(s[:len(s)])

def main():
	n = sint()
	ara = sara()
	for i in ara:
		if i % 2:
			print(i, end=' ')
		else:
			print(i - 1, end=' ')
	print('')
main()


input()
matrix = []
for x in list(map(int, input().split())):
	if x == 1:
		matrix.append(str(x))
	elif x % 2 == 0:
		matrix.append(str(x - 1))
	elif x % 2 == 1:
		matrix.append(str(x))
print(' '.join(matrix))


import sys
num = input()
arr = input()
arr = arr.split(' ')
arr = [int(i) for i in arr]

def changeNum(num):
	if num % 2 == 0:
		return num - 1
	else:
		return num
for num in range(len(arr)):
	arr[num] = changeNum(arr[num])
out = ''
for i in arr:
	out += str(i) + ' '
print(out)


n = int(input())
arr = list(map(int, input().strip().split(' ')))
for a in range(n):
	if arr[a] % 2 == 0:
		arr[a] -= 1
print(*arr, sep=' ')


def replac(arr):
	for (n, i) in enumerate(arr):
		if i % 2 == 0:
			arr[n] -= 1
	for i in arr:
		print(i, '', end='')
	print()
n = int(input())
x = list(map(int, input().rstrip().split()))
replac(x)


n = int(input())
A = list(map(int, input().split()))
ans = []
for a in A:
	if a % 2 == 0:
		ans.append(a - 1)
	else:
		ans.append(a)
print(*ans)


n = int(input())
A = list(map(int, input().split()))
for i in range(n):
	if A[i] & 1:
		continue
	A[i] -= 1
print(*A)


n = int(input())
a = input()
parts = a.split()
b = []
a = []
for p in parts:
	a.append(int(p))
for i in a:
	if i % 2 == 0:
		b.append(i - 1)
	else:
		b.append(i)
for x in b:
	print(x, end=' ')


n = int(input())
a = input().split(' ')
s = ''
for i in range(n):
	x = int(a[i])
	if x % 2 == 0:
		x = x - 1
	s = s + str(x) + ' '
print(s)


def readints():
	return [int(x) for x in input().strip().split()]

def main():
	_ = readints()
	a = readints()
	for x in a:
		print(x - (1 - x % 2), end=' ')
main()


input()
k = ()
for i in map(int, input().split()):
	k = k + (i - 1 if i % 2 == 0 else i,)
print(*k)


n = int(input())
a = [int(x) for x in input().split()]
for i in range(n):
	if a[i] % 2 == 0:
		a[i] = a[i] - 1
ans = ' '.join((str(x) for x in a))
print(ans)


x = int(input())
s = input().split()
a = [int(num) for num in s]
for i in range(0, len(a)):
	if a[i] % 2 == 0:
		a.insert(i, a[i] - 1)
		a.pop(i + 1)
y = str(a).replace('[', '')
e = y.replace(']', '')
r = e.replace(',', '')
print(r)


input()
print(*(x - (x % 2 == 0) for x in map(int, input().split())))


input()
seq = input()
seq = seq.split(' ')
seq = list(map(int, seq))
for i in range(0, len(seq)):
	if seq[i] % 2 == 0:
		seq[i] = seq[i] - 1
seq = list(map(str, seq))
print(' '.join(seq))


num = int(input())
list1 = [int(v) for v in input().split()]
str1 = ''
for i in range(len(list1) * 2):
	if i % 2 == 0:
		if list1[i // 2] % 2 == 0:
			str1 += str(list1[i // 2] - 1)
		else:
			str1 += str(list1[i // 2])
	else:
		str1 += ' '
print(str1)


n = int(input())
L = [int(x) for x in input().split()]
S = []
for i in L:
	if i % 2 == 0:
		S.append(str(i - 1))
	else:
		S.append(str(i))
print(' '.join(S))


def answer():
	n = int(input())
	a = [int(x) for x in input().split()]
	ans = ''
	i = 0
	while i < len(a):
		if n:
			if a[i] % 2 == 0:
				a[i] -= 1
		i += 1
	j = 0
	for x in a:
		j += 1
		ans += str(x)
		if j != len(a):
			ans += ' '
	print(ans)
answer()


from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
a = li()
for i in range(n):
	if a[i] % 2 == 0:
		a[i] -= 1
print(*a)


N = int(input())
s = [int(x) for x in input().split()]
for j in range(0, len(s)):
	if s[j] % 2 == 0:
		s[j] = s[j] - 1
for j in range(0, len(s)):
	print(s[j], end=' ')
print(' ')


n = int(input())
ai = list(map(int, input().split()))
for i in range(n):
	ai[i] = ai[i] - (ai[i] + 1) % 2
for i in range(n):
	print(ai[i], end=' ')


def main():
	n = int(input())
	a = list(map(int, input().split()))
	for (i, val) in enumerate(a):
		if val % 2 == 0:
			a[i] = val - 1
	print(*a)
main()


def findNthMin(arr, n):
	sortedArr = list(sorted(set(arr)))
	return sortedArr[n - 1]
cnt = int(input())
numbers = [int(i) for i in input().split(' ')]
mx = max(numbers) + 1
curMin = 0
minNth = 1
while curMin < mx:
	curMin = findNthMin(numbers, minNth)
	if curMin % 2 == 1:
		numbers = [item + 1 if item == curMin else item for item in numbers]
		numbers = [item - 1 if item == curMin + 1 else item for item in numbers]
		curMin += 2
	else:
		numbers = [item - 1 if item == curMin else item for item in numbers]
		curMin += 1
	minNth += 1
print(*numbers)


n = int(input())
a = [0] * (n + 10)
a = list(map(int, input().split()))
c = int(n - 1)
for i in range(0, n):
	if a[i] % 2 == 0:
		a[i] -= 1
for i in range(0, c):
	print(a[i], end=' ')
print(a[n - 1], end=' ')


N = int(input())
a = list(input().split(' '))
for val in a:
	if int(val) % 2 == 1:
		print(int(val), end=' ')
	else:
		print(int(val) - 1, end=' ')


n = int(input())
arr = [int(i) for i in input().split()]
for i in range(len(arr)):
	if not arr[i] & 1:
		arr[i] -= 1
for i in range(len(arr)):
	print(arr[i], end=' ')


R = lambda : map(int, input().split())
n = int(input())
a = list(R())
b = list(map(lambda x: x if x % 2 else x - 1, a))
print(*b, sep=' ')


def main():
	n = int(input())
	x = [int(i) for i in input().split()]
	ans = []
	for i in x:
		if i % 2 == 0:
			ans.append(i - 1)
		else:
			ans.append(i)
	print(*ans)
main()


m = int(input())
a = list(map(int, input().split()))
for (i, e) in enumerate(a):
	if e % 2 == 0:
		a[i] -= 1
print(' '.join(map(str, a)))


import sys

def Algo(a):
	for i in range(len(a)):
		if a[i] % 2 == 0:
			a[i] = a[i] - 1
	return a
n = int(input())
a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
A = Algo(a)
for ele in A:
	print(ele, end=' ')


n = int(input())
a = list(map(int, input().split()))
for (i, v) in enumerate(a):
	a[i] = v + v % 2 - 1
print(*a)


n = int(input())
a = list(map(int, input().split()))
for x in range(len(a)):
	if a[x] % 2 == 0:
		a[x] -= 1
print(*a)


n = int(input())
a = list(map(int, input().split()))
for (i, k) in enumerate(a):
	if k % 2 == 0:
		print(k - 1, end=' ')
	else:
		print(k, end=' ')


n = int(input())
s = list(map(int, input().split()))
for i in range(0, n - 1):
	if s[i] != s[i + 1]:
		if s[i] & 1:
			pass
		else:
			s[i] -= 1
	elif s[i] & 1:
		pass
	else:
		s[i] -= 1
	if s[i] == 100000000:
		s[i] = 99999999
if s[n - 1] & 1:
	pass
else:
	s[n - 1] -= 1
for i in s:
	print(i, end=' ')


def replace(n, a):
	s = ''
	for i in range(0, n):
		if a[i] % 2 == 0:
			a[i] = a[i] - 1
		s = s + str(a[i]) + ' '
	print(s)
n = int(input())
list1 = [int(i) for i in input().split()]
replace(n, list1)


_ = int(input())
arr = [int(num) for num in input().split()]
for i in arr:
	if i % 2 == 0:
		print(i - 1, end=' ')
	else:
		print(i, end=' ')


n = int(input())
l1 = list(map(int, input().split()))
s = sorted(l1)
for i in s:
	for (index, item) in enumerate(l1):
		if item == i:
			l1[index] = [item - 1, item + 1][item % 2]
	if i % 2:
		m = i + 1
		for (index, item) in enumerate(l1):
			if item == m:
				l1[index] = [item - 1, item + 1][item % 2]
print(*l1)


n = int(input())
z = list(input().split())
m = str()
for i in range(n):
	z[i] = int(z[i])
for i in range(n):
	if z[i] % 2 == 0:
		z[i] -= 1
for i in range(n):
	m += str(z[i]) + ' '
print(m)


import math
n = int(input())
a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
	if a[i] % 2 == 0:
		a[i] -= 1
for i in range(n):
	print(a[i], end=' ')


from sys import stdin

def solve(tc):
	n = int(stdin.readline().strip())
	li = list(map(int, stdin.readline().split()))
	for i in range(n):
		if li[i] % 2 == 0:
			li[i] -= 1
		print(li[i], end=' ')
	print()
LOCAL_TEST = not __debug__
if LOCAL_TEST:
	infile = __file__.split('.')[0] + '-test.in'
	stdin = open(infile, 'r')
tcs = int(stdin.readline().strip()) if LOCAL_TEST else 1
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


int(input())
listin = [int(x) for x in input().split(' ')]
listout = []
for i in listin:
	if i % 2 == 0:
		listout.append(i - 1)
	else:
		listout.append(i)
for i in listout:
	print(i, end=' ')


n = int(input())
a = map(int, input().split())
b = map(lambda x: x - 1 if x % 2 == 0 else x, a)
print(' '.join(map(str, b)))


n = int(input())
l = list(map(int, input().strip().split()[:n]))
for x in range(len(l)):
	if l[x] % 2 == 0:
		l[x] = l[x] - 1
print(*l)


input()
arr = [int(x) for x in input().split()]
for num in arr:
	if num % 2 == 0:
		print(num - 1, end=' ')
	else:
		print(num, end=' ')
print()


n = int(input())
arr = list(map(int, input().split()))
for (i, j) in enumerate(arr):
	if j % 2 == 0:
		arr[i] = j - 1
for i in arr:
	print(i, end=' ')


n = int(input())
lst = [int(elem) for elem in input().split()]
for elem in lst:
	if elem % 2 == 0:
		print(elem - 1, end=' ')
	else:
		print(elem, end=' ')


n = int(input())
a = list(map(int, input().split(' ')))
m = max(a)
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] = a[i] - 1
for i in a:
	print(i, end=' ')
print()


T = int(input())
l = list(map(int, input().split()))
new_l = []
for ele in l:
	if ele % 2 == 0:
		print(ele - 1, end=' ')
	else:
		print(ele, end=' ')


from collections import deque
q = deque()
n = int(input())
a = list(map(int, input().split()))
b = a.copy()
b = list(set(b))
b.sort()
for i in b:
	q.append(i)
while len(q) != 0:
	x = q.popleft()
	delta = 1
	if x % 2 == 0:
		delta = -1
	for i in range(n):
		if a[i] == x:
			a[i] += delta
			if delta == 1:
				q.appendleft(x + 1)
print(*a)


X = int(input())
L = list(map(int, input().split()))
for i in range(len(L)):
	if L[i] % 2 == 0:
		L[i] = L[i] - 1
print(*L)


n = int(input())
a = list(map(int, input().split()))
b = []
for e in a:
	if e % 2 == 0:
		b.append(e - 1)
	else:
		b.append(e)
print(' '.join(list(map(str, b))))


n = int(input())
a = list(map(int, input().split()))
big = max(a) + 2
for i in range(len(a)):
	if a[i] % 2 == 0:
		a[i] -= 1
print(' '.join(map(str, a)))


n = int(input())
dat = list(map(int, input().split()))
for i in range(n):
	if dat[i] & 1 == 0:
		dat[i] -= 1
print(' '.join(list(map(str, dat))))

def templ():
	from pprint import pprint
	q = int(input())
	for _ in range(q):
		s = input()
		n = int(input())
		(n, k) = map(int, input().split())
		dat = list(map(int, input().split()))
	dat = [1, 2, 3]
	print(' '.join(list(map(str, res))))
	pass
	import math
	math.ceil(1.2)
	math.floor(1.2)
	round(1.2, 3)


n = int(input(''))
s = [int(x) for x in input('').split()]
for i in range(len(s)):
	x = s[i]
	for j in range(len(s)):
		if x == s[j]:
			if s[j] % 2 == 0:
				s[j] = s[j] - 1
			else:
				continue
		else:
			continue
x = [str(y) for y in s]
print(' '.join(x))


a = int(input())
c = list(map(int, input().split()))
for k in c:
	if k % 2 == 0:
		print(k - 1, end=' ')
	else:
		print(k, end=' ')


n = int(input())
array = list(map(int, input().split()))

def func(x):
	if x == 1:
		x = 1
	elif x == 100000000:
		x -= 1
	elif x % 2 == 0:
		x -= 1
	else:
		x += 0
	return x
k = 0
while k < n:
	l = array[k]
	array[k] = func(array[k])
	for t in range(n):
		if array[t] == l:
			array[t] = func(array[t])
	k += 1
print(*array)


def to(x):
	x = int(x)
	return str(x - 1) if x % 2 == 0 else str(x)
input()
print(' '.join(map(to, input().split())))


n = int(input())
arr = list(map(int, input().split(' ')))
steps = sorted(arr)

def is_even(x):
	return x % 2 == 0

def replace_adj(x, arr):
	if is_even(x):
		y = x - 1
	else:
		y = x + 1
	for i in range(len(arr)):
		if arr[i] == x:
			arr[i] = y
	return arr
for x in steps:
	arr = replace_adj(x, arr)
	if not is_even(x):
		arr = replace_adj(x + 1, arr)
print(' '.join(map(str, arr)))


input()
print(*(i + i % 2 - 1 for i in map(int, input().split())))


n = int(input().strip())
lst = list(map(int, input().strip().split()))
for i in range(n):
	if lst[i] % 2 == 0:
		lst[i] = str(lst[i] - 1)
	else:
		lst[i] = str(lst[i])
print(' '.join(lst))


x = int(input(''))
i = 0
list = [int(x) for x in input('').split()]
for elsements in list:
	if elsements % 2 == 0:
		g = list.index(elsements)
		list[g] -= 1
for elsements in list:
	print(elsements, end=' ')
print('\n')


n = int(input(''))
a = input('').split(' ')
output = ''
for k in range(0, n):
	j = int(a[k])
	if j % 2 != 0:
		output = output + str(j) + ' '
	else:
		j = j - 1
		output = output + str(j) + ' '
print(output)


n = int(input())
M = [*map(int, input().split())]
for i in range(n):
	if M[i] % 2 == 0:
		M[i] -= 1
print(*M)


def zamena(lst):
	for i in range(len(lst)):
		if lst[i] == 1:
			continue
		elif lst[i] % 2 == 0:
			lst[i] -= 1
		elif lst[i] % 2 != 0:
			continue
	return lst
n = int(input())
a = [int(i) for i in input().split()]
print(*zamena(a))


def transformToInt(A):
	for i in range(0, len(A)):
		A[i] = int(A[i])

def main():
	n = int(input())
	second_string = input()
	array_A = list(second_string.split(' '))
	transformToInt(array_A)
	counter = 0
	max_in_array = max(array_A)
	i_values_arr = list()
	for i in range(0, n):
		if array_A[i] // 2 < 1:
			i_values_arr.append(1)
		else:
			i_values_arr.append(array_A[i] // 2)
	i_values_arr.sort()
	for i in range(0, len(i_values_arr)):
		for j in range(0, n):
			if array_A[j] == 2 * i_values_arr[i] - 1:
				array_A[j] = 2 * i_values_arr[i]
			if array_A[j] == 2 * i_values_arr[i]:
				array_A[j] = 2 * i_values_arr[i] - 1
	answer_str = ''
	for digit in array_A:
		answer_str += str(digit) + ' '
	print(answer_str)
main()


input()
print(*[int(i) if int(i) % 2 else int(i) - 1 for i in input().split()])


def arr_inp():
	return [int(x) for x in input().split()]
n = int(input())
a = arr_inp()
for i in range(n):
	if a[i] % 2 == 0:
		print(a[i] - 1, end=' ')
	else:
		print(a[i], end=' ')


try:
	n = int(input())
	l = list(map(int, input().split()))
	m = []
	for i in l:
		if i % 2 == 0:
			m.append(i - 1)
		else:
			m.append(i)
	for j in m:
		print(j, end=' ')
except:
	pass


n = int(input())
x = [int(x) for x in input().split()]
for num in x:
	if num % 2 == 0:
		val = -1
	else:
		continue
	for (idx, item) in enumerate(x):
		if item == num:
			x[idx] += val
joined_string = ' '.join([str(v) for v in x])
print(joined_string)


input()
print(' '.join([str(i - (i + 1) % 2) for i in map(int, input().split())]))


lista = []
num = input()
lista = input().split(' ')
lista2 = []
for i in lista:
	i = int(i)
	if i % 2 == 0:
		lista2.append(i - 1)
	else:
		lista2.append(i)
final = ''
for i in lista2:
	final += str(i) + ' '
final = final[:len(final) - 1]
print(final)


def main():
	no_of_test_cases = int(input())
	l = list(map(int, input().split()))
	for i in range(len(l)):
		if l[i] % 2 == 0:
			l[i] -= 1
	print(*l)
main()


from sys import stdin, stdout
n = int(input())
present = [int(x) for x in stdin.readline().split()]
for i in range(n):
	if present[i] % 2 == 0:
		present[i] -= 1
for i in range(n):
	if i > 0:
		stdout.write(' ')
	stdout.write(str(present[i]))


import atexit, io, sys, collections, math, heapq, fractions, copy, os, functools
import sys
import random
import collections
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
ais = list(map(int, input().split()))
print(' '.join(map(str, [ai + (-1 if ai & 1 == 0 else 0) for ai in ais])))


import sys
data = sys.stdin.readlines()
mass = [int(i) for i in data[1].split()]
if len(mass) == 1:
	if mass[0] % 2 == 0:
		mass[0] = mass[0] - 1
else:
	for i in range(len(mass)):
		if mass[i] % 2 == 0:
			mass[i] = mass[i] - 1
mass = [str(i) for i in mass]
print(' '.join(mass))


n = int(input())
xs = list(map(int, input().split(' ')))
changes = set()
for x in xs:
	changes.add(x - 1)
	changes.add(x)
	changes.add(x + 1)
changes = list(changes)
changes.sort()
for change in changes:
	for i in range(n):
		if xs[i] == change:
			if change % 2 == 0:
				xs[i] -= 1
			else:
				xs[i] += 1
print(' '.join(list(map(str, xs))))


number = int(input())
first = list(map(int, input().split()))
for i in range(number):
	if first[i] % 2 == 0:
		first[i] -= 1
print(*first)


query = int(input())
a = list(map(int, input().split()))
for i in range(query):
	if not a[i] % 2:
		a[i] -= 1
print(' '.join(map(str, a[:query])))


n = int(input())
a = [int(s) for s in input().split()]
for i in a:
	if i % 2 == 0:
		print(i - 1, end=' ')
	else:
		print(i, end=' ')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = LI()
	for i in range(n):
		if a[i] % 2 == 0:
			a[i] -= 1
	return ' '.join(map(str, a))
print(main())


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
(n,) = I()
for i in I():
	print(i - (not i % 2), end=' ')


def replace_all(lst, a, b):
	for i in range(len(lst)):
		if lst[i] == a:
			lst[i] = b
	return lst
n = int(input())
x = [int(i) for i in input().split()]
for i in x:
	if i % 2 == 1:
		replace_all(x, i, i + 1)
		replace_all(x, i + 1, i)
	else:
		replace_all(x, i, i - 1)
print(' '.join([str(i) for i in x]))


a = int(input())
b = list(map(int, input().split()))
for i in range(len(b)):
	if b[i] % 2 == 0:
		b[i] = b[i] - 1
print(' '.join((str(x) for x in b)))


n = int(input())
x = [int(i) for i in input().split()]
for i in range(n):
	x[i] = x[i] - (x[i] + 1) % 2
print(*x)


import sys
n = sys.stdin.readline().strip()
numlist = sys.stdin.readline().strip()
numlist = list(map(int, numlist.split()))
for n in numlist:
	if n % 2 == 0:
		print(n - 1, '', end='')
	else:
		print(n, '', end='')


n = int(input())
array = list(map(int, input().split()))
output = []
for e in array:
	if e % 2 == 0:
		e -= 1
	output.append(str(e))
print(' '.join(output))


n = int(input())
l = [int(x) for x in input().split()]
s = set(l)
if 1 in s:
	s.remove(1)
for elem in s:
	if elem % 2 != 0:
		continue
	while elem in l:
		l[l.index(elem)] -= 1
print(*l)


n = int(input())
l = list(map(int, input().split()))
l = [x if x % 2 else x - 1 for x in l]
print(*l)


import sys
from collections import defaultdict
input = sys.stdin.readline

def main():
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	for x in a:
		if x % 2 == 0:
			ans.append(x - 1)
		else:
			ans.append(x)
	print(' '.join(map(str, ans)))
main()


def transform_element(num):
	if num % 2:
		return num
	return num - 1
n = int(input())
a = list(map(int, input().split()))
b = list(map(lambda x: transform_element(x), a))
b = ' '.join(map(str, b))
print(b)


n = int(input())
a = map(int, input().split())
l = []
for aa in a:
	if aa % 2 == 0:
		l.append(str(aa - 1))
	else:
		l.append(str(aa))
print(' '.join(l))


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
n = int(input())
a = li()
for i in range(0, n):
	if a[i] % 2 == 0:
		a[i] -= 1
print(*a)


input()
for num in map(int, input().split()):
	print(num if num % 2 == 1 else num - 1, end=' ')


n = int(input())
l = list(map(int, input().split()))
d = {}
for i in l:
	d[i] = d.get(i, 0) + 1
x = []
for i in l:
	if i & 1:
		if i + 1 in d:
			x.append(i)
		else:
			x.append(i)
	else:
		x.append(i - 1)
print(*x)


list_size = int(input())
input_list = list(map(int, input().split()))
for (idx, i) in enumerate(input_list):
	if i % 2 == 0:
		input_list[idx] = i - 1
ans_string = ''
for (idx_, ans) in enumerate(input_list):
	ans_string += str(ans)
	if idx_ != len(input_list) - 1:
		ans_string += ' '
print(ans_string)


n = int(input())
arr = list(map(int, input().strip().split(' ')))
ans = []
for i in range(n):
	if arr[i] % 2 == 0:
		ans.append(arr[i] - 1)
	else:
		ans.append(arr[i])
for i in ans:
	print(i, end=' ')


z = int(input())
x = list(map(int, input().split()))
for i in range(len(x)):
	if x[i] % 2 == 0:
		x[i] = x[i] - 1
print(*x)


n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	if l[i] % 2 == 0:
		l[i] -= 1
print(*l, sep=' ')


n = int(input())
numbers = [int(i) for i in input().split(' ')]
for i in range(n):
	numbers[i] -= (numbers[i] - 1) % 2
print(*numbers)


inp = input()
array = list(map(int, input().split()))
test = []
for i in array:
	if i % 2 == 0:
		test.append(i - 1)
	else:
		test.append(i)
for j in test:
	print(j, end=' ')


n = int(input())
a = input().split(' ')
b = list()
for si in a:
	i = int(si)
	if i % 2 == 0:
		b.append(str(i - 1))
	else:
		b.append(str(i))
print(' '.join(b))


n = int(input())
data = list(map(int, input().split()))
d = set()
for el in data:
	d.add(el)
for el in d:
	if el % 2 == 0:
		for i in range(n):
			if data[i] == el:
				data[i] -= 1
print(' '.join((str(el) for el in data)))


n = int(input())
a = [int(i) for i in input().split()]
if n % 2 == 1:
	for i in range(n):
		if a[i] % 2 == 0:
			a[i] -= 1
else:
	for i in range(n):
		if a[i] % 2 == 0:
			a[i] -= 1
print(*a, sep=' ')


import collections
n = int(input())
a = [int(x) for x in input().split()]
for i in range(n):
	if a[i] % 2 == 0:
		a[i] -= 1
	print(a[i], end=' ')
print()


length = int(input())
present = [int(x) for x in input().split()]
for i in range(0, length):
	if present[i] % 2 == 0:
		present[i] = present[i] - 1
	else:
		pass
	print(present[i], end=' ')


a = input()
a = list(map(int, input().split()))
for el in a:
	if el % 2 == 0:
		el -= 1
	print(el, end=' ')


n = int(input())
q = list(map(int, input().strip().split()))
for i in q:
	for j in range(n):
		if i == q[j]:
			if q[j] % 2 == 0:
				q[j] = i - 1
print(*q)


useless = int(input())
modifier = lambda x: x if x % 2 != 0 else x - 1
print(' '.join([str(modifier(i)) for i in list(map(int, input().split()))]))


input()
n = list(map(int, input().split()))
n = [ni - 1 if ni % 2 == 0 else ni for ni in n]
print(*n)


length = int(input())
numbers = list(map(int, input().split(' ')))
for i in range(length):
	if numbers[i] % 2 == 0:
		numbers[i] -= 1
res = ''
for i in numbers:
	res += str(i) + ' '
print(res.strip())


n = int(input())
sk = input()
sk2 = []
for x in sk.split(' '):
	sk2.append(int(x))
for i in range(0, n):
	if sk2[i] % 2 == 0:
		sk2[i] = sk2[i] - 1
	else:
		pass
ans = ''
for x in sk2:
	ans += str(x)
	ans += ' '
print(ans)


n = int(input())
print(*map(lambda x: int(x) if int(x) % 2 else int(x) - 1, input().split()))


t = int(input())
l = [int(i) for i in input().split()]
for i in l:
	if i % 2 == 0:
		print(i - 1, end=' ')
	else:
		print(i, end=' ')


t = int(input())
for i in map(int, input().split()):
	print(i - 1 + i % 2, end=' ')


n = int(input())
nums = [int(s) for s in input().split()]
for i in range(len(nums)):
	if nums[i] % 2 == 0:
		nums[i] = nums[i] - 1
print(*nums)


trash = input()
arr = [int(x) for x in input().split()]
output = ''
for i in range(len(arr)):
	if arr[i] % 2 == 0:
		arr[i] -= 1
	output += str(arr[i])
	if i != len(arr) - 1:
		output += ' '
print(output)


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi
import sys
primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919]
import timeit

def primef(n, plst=[]):
	if n == 1:
		return plst
	else:
		for m in primes:
			if n % m == 0:
				return primef(n // m, plst + [m])
		return primef(1, plst + [n])

def lmii():
	return list(map(int, input().split()))

def ii():
	return int(input())

def countOverlapping(string, sub):
	count = start = 0
	while True:
		start = string.find(sub, start) + 1
		if start > 0:
			count += 1
		else:
			return count
n = ii()
nums = lmii()
nums = [i if i % 2 == 1 else i - 1 for i in nums]
print(*nums)


def main():
	input()
	l = list(map(int, input().split()))
	print(*[x - 1 + x % 2 for x in l])
main()


t = int(input())
v = list(map(int, input().split()))
for i in v:
	if i % 2 == 1:
		print(i, end=' ')
	else:
		print(i - 1, end=' ')


input()
input_list = list(map(int, input().split(' ')))
max_value = min(max(input_list), int(10000000000.0))
if max_value % 2 == 0:
	max_value += 1
for (idx, el) in enumerate(input_list):
	if el > max_value:
		continue
	if el % 2 == 0:
		input_list[idx] = el - 1
print(' '.join(map(str, input_list)))


t = int(input())
s = list(map(int, input().split()))
t = []
for k in s:
	if k % 2 == 0:
		if k - 1 <= 1:
			t.append(1)
		else:
			t.append(k - 1)
	else:
		t.append(k)
print(*t)


n = int(input())
s = list(map(int, input().split()))
i = 0
ans = ''
while i < n:
	a = s[i]
	if a % 2 == 0:
		a = a - 1
	ans += str(a) + ' '
	i += 1
print(ans)


n = int(input())
ar = [int(x) for x in input().split()]
for i in range(n):
	if ar[i] % 2 == 0:
		print(ar[i] - 1, end=' ')
	else:
		print(ar[i], end=' ')
print()


n = int(input())
ans = []
l = [int(x) for x in input().split()]
for e in l:
	if e % 2 == 0:
		ans.append(str(e - 1))
	else:
		ans.append(str(e))
print(' '.join(ans))


countNumbers = int(input())
numbers = [int(num) for num in input().split()]
for index in range(countNumbers):
	if numbers[index] % 2 == 0:
		numbers[index] -= 1
	print(numbers[index], end=' ')


n = int(input())
arr = input().split()
arr = [int(x) for x in arr]
arr = [x - 1 + x % 2 for x in arr]
for x in arr:
	print(x, end=' ')
print()


def main():
	n = int(input())
	a = list(map(int, input().split()))
	a = [str(i) if i % 2 else str(i - 1) for i in a]
	print(' '.join(a))
	return 0
main()


n = int(input())
seq = list(map(lambda a: int(a), input().split(' ', -1)))
seq = list(map(lambda a: a - 1 if a % 2 == 0 else a, seq))
for s in seq:
	print(s, end=' ')


def adjacent(n, ls):
	for i in range(n):
		if ls[i] % 2 == 0:
			ls[i] = ls[i] - 1
	return ls
n = int(input())
ls = [int(i) for i in input().split()]
print(' '.join(map(str, adjacent(n, ls))))


input()
X = map(int, input().strip().split(' '))
for x in X:
	p = [x - 1, x]
	print(p[x % 2], end=' ')


def func(x):
	if x % 2 == 0:
		return x - 1
	return x
n = int(input())
array = [int(x) for x in input().split()]
array = [func(x) for x in array]
print(*array)


n = int(input())
a = [int(x) for x in input().split(' ')]
a_prime = [x - 1 if x % 2 == 0 else x + 1 for x in a]
k = sorted(a + a_prime)
for x in k:
	cur = x
	rep = cur - 1 if cur % 2 == 0 else cur + 1
	for j in range(n):
		if a[j] == cur:
			a[j] = rep
new_a = [str(x) for x in a]
print(' '.join(new_a))


n = int(input())
num = input()
a = []

def get_the_data(count, num, arr):
	for i in range(0, len(num)):
		if num[i] == ' ':
			arr.append(int(num[count:i]))
			count = i + 1
		elif i == len(num) - 1:
			arr.append(int(num[count:len(num)]))
	return arr
arr = get_the_data(0, num, a)
i = 0
answer = ''
while i < len(arr):
	if arr[i] % 2 == 0:
		arr[i] -= 1
	answer += str(arr[i]) + ' '
	i += 1
print(answer)


n = int(input())
a = list(map(int, input().split()))
b = []
for i in a:
	if i not in b:
		b.append(i)
		if i % 2 == 0:
			b.append(i - 1)
		else:
			b.append(i + 1)
b.sort()
for i in b:
	for j in range(len(a)):
		if a[j] == i:
			if a[j] % 2 == 0:
				a[j] = i - 1
			else:
				a[j] = i + 1
print(' '.join(map(str, a)))


n = int(input())
ar = list(map(int, input().split()))
arr = []
for i in ar:
	if i % 2 == 0:
		arr.append(i - 1)
	else:
		arr.append(i)
print(' '.join((str(i) for i in arr)))


n = int(input())
l = list(map(int, input().strip().split()))
x = []
for i in l:
	if i % 2 == 0:
		x.append(i - 1)
	else:
		x.append(i)
print(*x)


f = lambda : map(int, input().split())
input()
[print(i - 1, end=' ') if i % 2 == 0 else print(i, end=' ') for i in f()]


a = int(input())
b = list(map(int, input().split()))
c = []
for x in b:
	if x % 2 == 0:
		c.append(x - 1)
	else:
		c.append(x)
print(*c)


import sys
n = int(input())
bn = list(map(int, sys.stdin.readline().split()))
for i in range(n):
	if bn[i] % 2 == 0:
		bn[i] -= 1
print(' '.join((str(b) for b in bn)))


import time

def mishkasAlgo(numArray):
	cArray = []
	for y in numArray:
		if y % 2 == 0:
			cArray.append(y - 1)
		else:
			cArray.append(y)
	return cArray

def solve():
	lenArr = int(input())
	origArr = []
	origArr = [int(x) for x in input().split()]
	origArr = mishkasAlgo(origArr)
	print(' '.join((str(x) for x in origArr)))
solve()


n = int(input())
l = list(input().split())
a = [int(i) for i in l]
for i in range(n):
	if a[i] % 2 == 0:
		a[i] -= 1
	else:
		continue
for i in a:
	print(i, end=' ')


n = int(input())
a = [int(s) for s in input().split()]
for i in range(n):
	a[i] = a[i] - (a[i] + 1) % 2
print(*a, sep=' ')


input()
l = list(map(int, input().split()))
k = list()
for i in l:
	if i % 2 == 0:
		k.append(i - 1)
	else:
		k.append(i)
print(*k)


input()
l = list(map(int, input().split()))
l = [i - (not i % 2) for i in l]
for i in l:
	print(i, end=' ')


import sys
import io
stream_enable = 0
inpstream = '\n\n'
if stream_enable:
	sys.stdin = io.StringIO(inpstream)
	input()

def inpmap():
	return list(map(int, input().split()))
n = int(input())
arr = inpmap()
for x in arr:
	print(x - 1 + x % 2, end=' ')
print()


n = int(input())
a = map(int, input().split())
ans = ''
for x in a:
	if x % 2 == 0:
		x -= 1
	ans += ' ' + str(x)
print(ans)


n = int(input())
a = list(map(int, input().split()))
for i in range(0, len(a)):
	if a[i] % 2 == 0:
		temp = a[i] - 1
		a[i] = temp
print(' '.join((repr(e) for e in a)))


def cal():
	for j in range(len(l)):
		if l[j] % 2 == 0:
			l[j] -= 1
input()
l = list(map(int, input().split()))
cal()
print(*l)


from sys import stdin
from math import *
line = stdin.readline().rstrip().split()
n = int(line[0])
numbers = list(map(int, stdin.readline().rstrip().split()))
for num in numbers:
	if num % 2 == 0:
		print(num - 1, end=' ')
	else:
		print(num, end=' ')


t = int(input())
lst = list(map(int, input().split()))
lst1 = list(set(lst))
lst1.sort()
for i in lst1:
	if i % 2 == 0:
		i -= 1
	for j in range(len(lst)):
		if lst[j] == i:
			lst[j] += 1
	for j in range(len(lst)):
		if lst[j] == i + 1:
			lst[j] = lst[j] - 1
print(*lst)


from math import ceil

def main():
	cc = int(input())
	vals = [int(v) for v in input().split()]
	print(' '.join([str(v) if v % 2 != 0 else str(v - 1) for v in vals]))
main()


n = int(input())
A = list(map(int, input().split()))
for i in range(n):
	A[i] = A[i] - (1 - A[i] % 2)
print(*A)


n = int(input())
a = list(map(int, input().split()))
c = 0
while c < n:
	if a[c] % 2 == 0:
		a[c] = a[c] - 1
	c += 1
l = ''
for i in a:
	print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
b = 0
while n != 0:
	n -= 1
	if a[b] % 2 == 0:
		a[b] -= 1
	b += 1
print(' '.join(map(str, a)))


def solve():
	n = int(input())
	m = [int(s) for s in input().split()]
	m = [s - 1 if s % 2 == 0 else s for s in m]
	print(*m)
solve()


n = int(input())
b = list(map(int, input().split()))
c = []
for j in range(n):
	if b[j] % 2 == 0:
		c.append(b[j] - 1)
	else:
		c.append(b[j])
print(*c)


a = int(input())
l = list(map(int, input().split()))
for i in range(a):
	if l[i] % 2 == 0:
		l[i] = l[i] - 1
	else:
		continue
print(' '.join((str(x) for x in l)))


from collections import *

def input_int():
	return list(map(int, input().split()))
n = int(input())
arr = input_int()
for a in arr:
	if a % 2 == 0:
		print(a - 1, end=' ')
	else:
		print(a, end=' ')


from sys import stdin, stdout
import bisect
import math
from collections import Counter

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def soe(limit):
	l = [1] * (limit + 1)
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
			n = n - 1
		else:
			a = a * a
			n = n >> 1
	return r

def solve():
	n = inp()
	l = li()
	d = {}
	for i in l:
		d[i] = d.get(i, 0) + 1
	x = []
	for i in l:
		if i & 1:
			if i + 1 in d:
				x.append(i)
			else:
				x.append(i)
		else:
			x.append(i - 1)
	print(*x)
for _ in range(1):
	solve()


input()
print(' '.join([str(int(n) - 1 + int(n) % 2) for n in input().split(' ')]))


__author__ = 'liuzixiang'

def main():
	n = int(input())
	v = list(map(int, input().split()))
	for x in list(map(lambda x: (x + 1) // 2 * 2 - 1, v)):
		print(x, end=' ')
main()


x = int(input())
y = list(map(int, input().split()))
for i in range(x):
	if y[i] % 2 == 0:
		y[i] = y[i] - 1
for i in y:
	print(i, end=' ')


n = int(input())
ms = [int(x) for x in input().split()]
for j in range(len(ms)):
	if ms[j] % 2 == 0:
		ms[j] = ms[j] - 1
s = ''
for x in ms:
	s = s + str(x) + ' '
s = s.strip()
print(s)


n = int(input())
a = list(map(int, input().split()))
res = []
for elem in a:
	if not elem % 2:
		res.append(elem - 1)
	else:
		res.append(elem)
print(*res)


N = int(input())
NUMBERS = list(map(int, input().strip().split()))
NUMBERS = list(map(lambda x: str(x - 1) if x % 2 == 0 else str(x), NUMBERS))
print(' '.join(NUMBERS).strip())


n = int(input())
nums = [v - 1 + (v & 1) for v in map(int, input().split()[:n])]
print(' '.join(map(str, nums)))


def func():
	n = int(input())
	val = [int(x) for x in input().strip().split(' ')]
	for x in val:
		l = len(val)
		if x % 2 == 0:
			for y in range(l):
				if val[y] == x:
					val[y] = x - 1
		else:
			for y in range(l):
				if val[y] == x:
					val[y] = x + 1
			for y in range(l):
				if val[y] == x + 1:
					val[y] = x
	for x in val:
		print(x, end=' ')
	print(end='\n')
func()


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
Read = lambda : list(map(int, input().split()))
Num = lambda : int(input())

def solve():
	n = Num()
	a = Read()
	ans = []
	for i in a:
		if i & 1:
			ans.append(i)
		else:
			ans.append(i - 1)
	print(*ans)
solve()


n = int(input())
a_i = [int(x) for x in input().split()]
for i in sorted(set(a_i)):
	if i % 2 == 0:
		a_i = [i - 1 if x == i else x for x in a_i]
for x in a_i:
	print(x, end=' ')


a = int(input())
arr = [int(x) for x in input().split()]
f = []
for i in arr:
	if i % 2 == 1:
		f.append(i)
	else:
		f.append(i - 1)
for i in f:
	print(i, end=' ')


x = int(input())
arr = []
text = input()
arr = text.split(' ')
for elem in arr:
	x = int(elem)
	if x % 2 == 0:
		x = x - 1
	print(x, end=' ')


t = 1
for test in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr2 = []
	for i in arr:
		if i % 2 == 0:
			arr2.append(i - 1)
		else:
			arr2.append(i)
	print(*arr2)


import sys
readline = sys.stdin.readline
N = int(readline())
A = list(map(int, readline().split()))
A = [a if a % 2 == 1 else a - 1 for a in A]
print(*A)


n = int(input())
a = [int(q) for q in input().strip().split()]
b = []
for k in range(n):
	if int(a[k]) % 2 == 0:
		b.append(str(a[k] - 1))
	else:
		b.append(str(a[k]))
print(' '.join(b))


n = int(input())
a = list(map(int, input().split()))

def adjacent_replacements(array):
	for number in array:
		if number % 2 == 0:
			print(number - 1, end=' ')
		else:
			print(number, end=' ')
adjacent_replacements(a)


num = int(input())
L = list(map(int, input().split()))
for i in L:
	if i % 2 == 1:
		print(i, end=' ')
	else:
		print(i - 1, end=' ')


_ = input()
for i in map(int, input().split()):
	if i % 2 == 1:
		print(i, end=' ')
	else:
		print(i - 1, end=' ')


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
(__, numbers) = (f_input(), [int(_) for _ in f_input().split()])
for i in numbers:
	if i % 2 == 0:
		i -= 1
	f_print(str(i) + ' ')


n = int(input())
a = [int(i) for i in input().split()]
res = ''
for i in a:
	if i % 2:
		res += str(i) + ' '
	else:
		res += str(i - 1) + ' '
print(res)


n = int(input())
lst = list(map(int, input().split()))
for element in lst:
	print(element - (element % 2 == 0), end=' ')


n = int(input())
a = [int(x) for x in input().split()]
ra = [e - (e & 1 == 0) for e in a]
print(' '.join([str(x) for x in ra]))


n = int(input())
ans = [int(x) - (int(x) + 1) % 2 for x in input().split()]
print(*ans)


input()
print(' '.join(map(lambda a: str((int(a) - 1 & ~1) + 1), input().strip().split())))


n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	if not l[i] % 2:
		l[i] -= 1
print(*l)


x = int(input())
a = [int(i) for i in input().split()]
l = []
l += a
l += [int(i + 1) for i in a]
l.sort()
d = len(l)
b = 0
while b < d:
	h = l[b]
	for i in range(x):
		if a[i] == h:
			if h % 2 == 0:
				a[i] = a[i] - 1
			else:
				a[i] = a[i] + 1
	b += 1
print(*a)


t = int(input())
a = [int(x) for x in input().split()]
sorted_a = set()
for ele in a:
	sorted_a.add(ele - 1)
	sorted_a.add(ele)
	sorted_a.add(ele + 1)
sorted_a = sorted(sorted_a)
for ele in sorted_a:
	if ele % 2 == 0:
		a = [ele - 1 if x == ele else x for x in a]
	else:
		a = [ele + 1 if x == ele else x for x in a]
for i in a:
	print(i, end=' ')


n = int(input())
A = [int(x) for x in input().split()]
for i in range(len(A)):
	if A[i] & 1 == 0:
		A[i] -= 1
	print(A[i], end=' ')


import os
import sys
n = int(input())
lista = [int(x) for x in input().strip().split()]
for i in range(n):
	if lista[i] % 2 == 0:
		lista[i] = lista[i] - 1
	print(lista[i], end=' ')