
Two functions and (\mathbf{f}, \mathbf{g}: \mathbf{X} \rightarrow \mathbf{X}) are commuting if and only if for every , \mathbf{f}(\mathbf{g}(x)) = \mathbf{g}(\mathbf{f}(x)). For example, the functions \mathbf{f}(x) = x+1 and \mathbf{g}(x) = x-2 are commuting, while the functions \mathbf{f}(x) = x+1 and \mathbf{g}(x) = 2x are not commuting.


Each function (\mathbf{h}: N_n \rightarrow N_n, where N_n = \{1, 2, \ldots, n\} and is a positive integer) can be represented as a value list—a list in which the -th element is equal to . For example, the function \mathbf{h}(x) = \lfloor x/2 \rfloor from N_5 to N_5 has the value list [1, 1, 2, 2, 3].
Value lists are ordered lexicographically: the list [a_1, \ldots, a_n] is smaller than the list [b_1, \ldots, b_n] if and only if there exists an index such that a_k < b_k, and a_l = b_l for all indices l < k.
The function (\mathbf{f}: X \rightarrow X) is called bijective if for every in , there is exactly one in such that \mathbf{f}(x) = y.
Given a bijective function (\mathbf{f}: N_n \rightarrow N_n, where is a positive integer), find a function that commutes with and has the lexicographically smallest possible value list.
The first line contains a single integer —the number of elements in the value list of the bijective function (1 \leq n \leq 200\,000).
The second line contains the value list of function .
Output a single line with integers—the value list of the function that commutes with and has the lexicographically smallest possible value list.
Example 1