Readability

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

The Martian alphabet consists of 10910^9 integers from 11 to 10910^9. Odd integers are vowels, and even integers are consonants. A word is a sequence of such integers.

Why do Martians have such a big alphabet? It gives the language an interesting property: changing the order of the integers in a word does not change its meaning. But, it does change its pronunciation. If each pair of adjacent integers in a word contains one vowel and one consonant, such word is called readable.

Vasya Pupkin decided to open a restaurant of Earthern cuisine on Mars. He bought nn wooden integers for its name and placed them in a row on nn pedestals, numbered from 11 to nn. The integer placed on ii-th pedestal is denoted as a_ia\_i.

Now Vasya wants to reorder the integers, because he wants the name of the restaurant to be readable. But moving an integer from pedestal ii to pedestal jj costs ij|i - j| Martian rubles. Integers are flat, so two or more of them can be placed on one pedestal while reordering, but in the end, each pedestal must have exactly one integer on it.

Help Vasya to find a readable word formed by reordering the integers that requires him to pay as little Martian rubles as possible. If there are several such words, choose one that is the smallest lexicographically, because that will put the name of the restaurant earlier in the telephone directory.

A sequence of integers b_ib\_i is lexicographically smaller than a sequence of the same length c_ic\_i if there exists such index jj that b_i=c_ib\_i = c\_i for all i<ji < j, but b_j<c_jb\_j < c\_j.

입력

The first line contains an integer nn, the number of Martian letters in the word (1n1051 \leq n \leq 10^5).

The second line contains nn space-separated integers a_ia\_i: the letters themselves (1a_i1091 \leq a\_i \leq 10^9).

It is guaranteed that the solution exists.

출력

Output one line. It must contain nn space-separated integers: the required readable word.