{"raw_statement":[{"iden":"statement","content":"Mishka got an integer array $a$ of length $n$ as a birthday present (what a surprise!).\n\nMishka 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:\n\n*   Replace each occurrence of $1$ in the array $a$ with $2$;\n*   Replace each occurrence of $2$ in the array $a$ with $1$;\n*   Replace each occurrence of $3$ in the array $a$ with $4$;\n*   Replace each occurrence of $4$ in the array $a$ with $3$;\n*   Replace each occurrence of $5$ in the array $a$ with $6$;\n*   Replace each occurrence of $6$ in the array $a$ with $5$;\n*   $\\dots$\n*   Replace each occurrence of $10^9 - 1$ in the array $a$ with $10^9$;\n*   Replace each occurrence of $10^9$ in the array $a$ with $10^9 - 1$.\n\nNote 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.\n\nFor example, for the array $a = [1, 2, 4, 5, 10]$, the following sequence of arrays represents the algorithm:\n\n$[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.\n\nMishka 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."},{"iden":"input","content":"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).\n\nThe 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."},{"iden":"output","content":"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."},{"iden":"examples","content":"Input\n\n5\n1 2 4 5 10\n\nOutput\n\n1 1 3 5 9\n\nInput\n\n10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000\n\nOutput\n\n9999 9 50605065 1 5 89 5 999999999 60506055 999999999"},{"iden":"note","content":"The first example is described in the problem statement."}],"translated_statement":[{"iden":"statement","content":"Mishka 得到了一个长度为 $n$ 的整数数组 $a$ 作为生日礼物（真是惊喜！）。\n\nMishka 不喜欢这份礼物，想要以某种方式改变它。他发明了一个算法，并称之为 \"Mishka 的相邻替换算法\"。该算法可以表示为一系列步骤：\n\n注意，该算法中间的省略号表示 Mishka 对每一对相邻整数 $(2i - 1, 2i)$，对每个 $i \\in \\{1, 2, dots.h, 5 \\dot.op 10^8\\}$ 均按上述方式应用替换。\n\n例如，对于数组 $a = [ 1, 2, 4, 5, 10 ]$，以下数组序列表示该算法：\n\n$[ 1, 2, 4, 5, 10 ]$ $arrow.r$（将所有 $1$ 替换为 $2$）$arrow.r$ $[ 2, 2, 4, 5, 10 ]$ $arrow.r$（将所有 $2$ 替换为 $1$）$arrow.r$ $[ 1, 1, 4, 5, 10 ]$ $arrow.r$（将所有 $3$ 替换为 $4$）$arrow.r$ $[ 1, 1, 4, 5, 10 ]$ $arrow.r$（将所有 $4$ 替换为 $3$）$arrow.r$ $[ 1, 1, 3, 5, 10 ]$ $arrow.r$（将所有 $5$ 替换为 $6$）$arrow.r$ $[ 1, 1, 3, 6, 10 ]$ $arrow.r$（将所有 $6$ 替换为 $5$）$arrow.r$ $[ 1, 1, 3, 5, 10 ]$ $arrow.r$ $dots.h$ $arrow.r$ $[ 1, 1, 3, 5, 10 ]$ $arrow.r$（将所有 $10$ 替换为 $9$）$arrow.r$ $[ 1, 1, 3, 5, 9 ]$。算法的后续步骤不再改变数组。\n\nMishka 非常懒，不想自己手动应用这些更改。但他非常关心它们的结果。请帮助他找出结果。\n\n输入的第一行包含一个整数 $n$（$1 lt.eq n lt.eq 1000$）——Mishka 生日礼物中元素的个数（令人惊讶的是，这是一个数组）。\n\n输入的第二行包含 $n$ 个整数 $a_1, a_2, dots.h, a_n$（$1 lt.eq a_i lt.eq 10^9$）——数组的元素。\n\n请输出 $n$ 个整数——$b_1, b_2, dots.h, b_n$，其中 $b_i$ 是将 \"Mishka 的相邻替换算法\" 应用于数组 $a$ 后第 $i$ 个元素的最终值。注意，你不能改变数组中元素的顺序。\n\n第一个例子已在问题描述中给出。\n\n"},{"iden":"input","content":"输入的第一行包含一个整数 $n$（$1 lt.eq n lt.eq 1000$）——Mishka 生日礼物中元素的个数（令人惊讶的是，这是一个数组）。输入的第二行包含 $n$ 个整数 $a_1, a_2, dots.h, a_n$（$1 lt.eq a_i lt.eq 10^9$）——数组的元素。"},{"iden":"output","content":"请输出 $n$ 个整数——$b_1, b_2, dots.h, b_n$，其中 $b_i$ 是将 \"Mishka 的相邻替换算法\" 应用于数组 $a$ 后第 $i$ 个元素的最终值。注意，你不能改变数组中元素的顺序。"},{"iden":"examples","content":"输入\n5\n1 2 4 5 10\n输出\n1 1 3 5 9\n\n输入\n10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000\n输出\n9999 9 50605065 1 5 89 5 999999999 60506055 999999999"},{"iden":"note","content":"第一个例子已在问题描述中给出。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the length of the array.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be the input array, where $ a_i \\in \\mathbb{Z} $ for all $ i \\in \\{1, \\dots, n\\} $.  \n\nLet $ R: \\mathbb{Z} \\to \\mathbb{Z} $ be the transformation function induced by Mishka’s Adjacent Replacements Algorithm, defined as:  \nFor each $ k \\in \\mathbb{Z}^+ $,  \n- If $ k $ is odd, then $ R(k) = k + 1 $,  \n- If $ k $ is even, then $ R(k) = k - 1 $.  \n\nThe algorithm applies $ R $ iteratively to all elements of the array in sequence for all adjacent pairs $ (2i-1, 2i) $, $ i = 1, 2, \\dots, 5 \\times 10^8 $.  \n\n**Constraints**  \n1. $ 1 \\le n \\le 1000 $  \n2. $ 1 \\le a_i \\le 10^9 $ for all $ i \\in \\{1, \\dots, n\\} $  \n\n**Objective**  \nCompute the final array $ B = (b_1, b_2, \\dots, b_n) $, where for each $ i \\in \\{1, \\dots, n\\} $:  \n$$\nb_i = \n\\begin{cases} \na_i - 1 & \\text{if } a_i \\text{ is even} \\\\\na_i & \\text{if } a_i \\text{ is odd}\n\\end{cases}\n$$","simple_statement":null,"has_page_source":false}