Competitions

# July 12 - ADA Training

# Increasing subsequence

Given **n** (**1** ≤ **n** ≤ `10`

) integers ^{5}`x`

, _{1}`x`

, ..., _{2}`x`

(_{n}**1** ≤ `x`

≤ _{i}**60000**). Delete from them the least amount of numbers so that the rest were in ascending order.

#### Input

First line contains the number **n**. In the second line the integers `x`

, _{1}`x`

, ..., _{2}`x`

are given._{n}

#### Output

Print in the first line the amount of not erased numbers, in the second print the list of unerased numbers in the original order. If several answers exist, print any.

Input example #1

6 2 5 3 4 6 1

Output example #1

4 2 3 4 6