Revision#1459

Revision

1 second
64 megabytes
Easy

In preparation for Emperor Palpatine's visit, it has been decided to update the droid lineup in hangar . Due to the ongoing crisis, instead of purchasing new droids, a few older ones will be decommissioned. Since Palpatine dislikes droids with low serial numbers, the task is to identify the two droids with the smallest serial numbers.

Input

The first line of the input contains an integer — the number of droids (2 \leq N \leq 1000). The second line contains integers, each with an absolute value not exceeding 2 \cdot 10^9, representing the droid serial numbers.

Output

Print two numbers: the first is the smallest droid serial number (this droid should be decommissioned first), and the second is the second smallest.

Examples

Example 1

Loading
Loading