Sereja loves integer sequences very much. He especially likes stairs. Sequence a 1, a 2, ..., a a (a is the length of the sequence) is stairs if there is such index i (1 ≤ i ≤ a), that the following condition is met: a 1 a 2 a i - 1 a i a i + 1 ... a a - 1 a a. For example, sequences [1, 2, 3, 2] and [4, 2] are stairs and sequence [3, 1, 2] isn't. Sereja has m cards with numbers. He wants to put some cards on the table in a row to get a stair sequence. What maximum number of cards can he put on the table?
输入描述:
The first line contains integer m(1 ≤ m ≤ 105) — the number of Sereja's cards. The second line contains m integers bi(1 ≤ bi ≤ 5000) — the numbers on the Sereja's cards.


输出描述:
In the first line print the number of cards you can put on the table. In the second line print the resulting stairs.
示例1

输入

5<br />1 2 3 4 5<br />6<br />1 1 2 2 3 3<br />

输出

5<br />5 4 3 2 1<br />5<br />1 2 3 2 1<br />
加载中...