favorite We need a little bit of your help to keep things running, click on this banner to learn more

Week 5: December 7 - 13. Integer arrays. Part 2

Two minimums

Find two different minimal elements in the given sequence of numbers.


First line contains the number of elements n (3n1000) in the sequence. Then given n integers, each of them is no more than 2 * 109 by absolute value.


Print in increasing order two different minimal elements from the given sequence. It is known that they always exist.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 10 2 3 -1 5 -1
Output example #1
-1 2