~/algor $ cat problems/minmax-1-eng-kichik-va-eng-katta
Smallest and largest number
Easy
1000 ms
256 MB
20%
A positive integer $N$ and a sequence of $N$ integers are given. Find the smallest and the largest number of the sequence.
Input
The first line contains an integer $N$. The next line contains $N$ integers $A_{i}$.
Output
One line with two integers separated by a space: the smallest and the largest.
Note
$1 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$
Examples
Input #1
5 3 1 7 2 5
Output #1
1 7
Input #2
4 -5 0 -12 8
Output #2
-12 8